/* ============================================================
   FobCopy KWC — Custom Styles
   Supplements Tailwind CDN for animations, dynamic content,
   and components not easily handled by utilities alone.
   ============================================================ */

/* ---- Base ---- */
[x-cloak] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
.font-display {
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
}

/* ---- Hero animations ---- */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50%       { transform: translateY(-12px) rotate(-2deg); }
}
@keyframes floatDelayed {
  0%, 100% { transform: translateY(0px) rotate(2deg); }
  50%       { transform: translateY(-8px) rotate(2deg); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-float         { animation: float 4s ease-in-out infinite; }
.animate-float-delayed { animation: floatDelayed 4s ease-in-out 1s infinite; }

/* ---- Scroll reveal animations ---- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Hero CTA pulse effect ---- */
.hero-cta-primary {
  position: relative;
}
.hero-cta-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0.75rem;
  box-shadow: 0 0 0 0 rgba(37,99,235,0.5);
  animation: ctaPulse 3s ease-in-out 2s infinite;
}
@keyframes ctaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,99,235,0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(37,99,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}

/* ---- Brand/vehicle make cards ---- */
.brand-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: default;
}
.brand-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 12px rgba(37,99,235,0.1);
  transform: translateY(-2px);
}
.brand-initial {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #2563eb;
  color: white;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 36px;
  text-align: center;
  margin: 0 auto 0.5rem;
}
.brand-name {
  font-weight: 700;
  font-size: 0.8rem;
  color: #111827;
  margin: 0 0 2px;
}
.brand-note {
  font-size: 0.65rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.3;
}

/* ---- Area chips ---- */
.area-chip {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 100px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.area-chip:hover {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

/* ---- Form styles ---- */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
}
.form-input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  color: #111827;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.65rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-input::placeholder {
  color: #9ca3af;
}
select.form-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1.2em;
  padding-right: 2.5rem;
  -webkit-appearance: none;
  appearance: none;
}

/* ---- File upload ---- */
.file-upload-container {
  position: relative;
}
.file-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem;
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  background: white;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  min-height: 120px;
}
.file-upload-area:hover {
  border-color: #2563eb;
  background: #eff6ff;
}
.file-upload-area.dragover {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* File preview */
.file-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.75rem;
  background: white;
}
.file-preview img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
}
.file-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.remove-file-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}
.remove-file-btn:hover { background: #fecaca; }

/* ---- Submit button ---- */
.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  background: #2563eb;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.submit-btn:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
  transform: translateY(-1px);
}
.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}
.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ---- Form message notification ---- */
.message {
  display: none;
  padding: 0.9rem 1.1rem;
  border-radius: 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.message.show {
  display: block;
}
.message.success {
  background: #f0fdf4;
  color: #166534;
  border: 1.5px solid #bbf7d0;
}
.message.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1.5px solid #fecaca;
}

/* ---- Reviews grid (dynamic content from reviews.js) ---- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Skeleton loaders */
.review-card-skeleton {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 1rem;
  padding: 1.5rem;
}
.skeleton-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e5e7eb;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: #e5e7eb;
  margin-bottom: 8px;
  animation: shimmer 1.5s ease-in-out infinite;
  width: 100%;
}
@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Dynamic review cards (generated by reviews.js) */
.review-card {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
.review-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.review-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}
.reviewer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
}
.reviewer-info h4 {
  font-weight: 700;
  color: #111827;
  margin: 0 0 3px;
  font-size: 0.9rem;
}
.review-stars {
  display: flex;
  gap: 1px;
}
.review-text {
  color: #4b5563;
  font-style: italic;
  font-size: 0.875rem;
  line-height: 1.65;
  margin: 0 0 0.875rem;
}
.review-service {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Fade-in animation for dynamically loaded review cards */
.fade-in {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Google CTA card */
.google-cta {
  background: white;
  border: 2px dashed #e5e7eb;
  border-radius: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}
.google-cta:hover {
  border-color: #bfdbfe;
}
.google-cta-icon {
  width: 52px;
  height: 52px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.google-cta h3 {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 0.4rem;
}
.google-cta p {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #2563eb;
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.6rem 1.4rem;
  border-radius: 0.6rem;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.google-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* ---- Header scroll shadow ---- */
#mainHeader.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

/* ---- Responsive adjustments ---- */
@media (max-width: 640px) {
  .reviews-grid {
    grid-template-columns: 1fr;
  }
  .hero-cta-primary::after {
    display: none; /* no pulse on mobile to save battery */
  }
}

@media (max-width: 480px) {
  .brand-card {
    padding: 0.75rem 0.5rem;
  }
  .brand-note {
    display: none;
  }
}

/* ---- Accessibility ---- */
@media (prefers-reduced-motion: reduce) {
  .animate-float,
  .animate-float-delayed,
  .animate-on-scroll,
  .hero-cta-primary::after,
  .skeleton-line,
  .skeleton-circle,
  * {
    animation: none !important;
    transition: none !important;
  }
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* Focus visible styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ---- Print ---- */
@media print {
  .animate-on-scroll { opacity: 1; transform: none; }
  header, footer { display: none; }
}
