@import "tailwindcss";

@theme {
  /* ─── Unified Color Palette ─── */
  --color-primary: #16a34a;
  --color-primary-light: #22c55e;
  --color-primary-dark: #15803d;
  --color-secondary: #ff9f1c;
  --color-accent: #f97316;

  /* Dark surfaces */
  --color-dark-bg: #0f172a;
  --color-dark-surface: #1e293b;
  --color-dark-card: #273548;

  /* Light surfaces */
  --color-light-bg: #f1f5f9;
  --color-light-surface: #f8fafc;
  --color-neutral-bg: #e2e8f0;

  /* Text */
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-text-light: #f8fafc;
  --color-text-light-muted: #94a3b8;

  /* Borders */
  --color-border-light: #e2e8f0;
  --color-border-dark: #334155;

  /* Legacy aliases (keep Tailwind classes working) */
  --color-emerald-btn: #16a34a;
  --color-emerald-btn-hover: #15803d;
  --color-background-light: #f1f5f9;
  --color-background-off-white: #f1f5f9;
  --color-background-tint: #f1f5f9;
  --color-background-subtle: #f1f5f9;
  --color-background-dark: #0f172a;
  --color-btn-green: #16a34a;
  --color-btn-green-hover: #15803d;
  --color-about-primary: #22c55e;
  --color-about-primary-dark: #16a34a;
  --color-text-secondary: #64748b;

  /* Typography */
  --font-display: "Inter", sans-serif;
  --font-body: "Inter", sans-serif;

  /* Radii */
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-glow-green: 0 0 30px rgba(22, 163, 74, 0.3), 0 0 60px rgba(22, 163, 74, 0.1);
}

@theme {
  --radius: 0.75rem;
}

@layer base {
  body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    background-color: var(--color-light-bg);
    color: var(--color-text-main);
  }

  .material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  }
}

/* ─── FAQ Component Styles ─── */
@layer components {
  details>summary {
    list-style: none;
  }

  details>summary::-webkit-details-marker {
    display: none;
  }

  .group[open] summary .expand-icon {
    transform: rotate(45deg);
  }
}

/* ─── Interaction Effects ─── */
@layer components {

  /* Button hover micro-interactions */
  .btn-hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }

  /* Card hover lift effect */
  .card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  }

  .card-hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(0, 0, 0, 0.06);
  }

  /* ─── Gradient text utility ─── */
  .gradient-text {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #15803d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* ─── CTA button styles ─── */
  .btn-primary {
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
    font-weight: 700;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    /* Establish new stacking context */
  }

  .btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    /* Place behind button content */
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
      0 4px 14px rgba(22, 163, 74, 0.4),
      0 0 30px rgba(22, 163, 74, 0.15);
  }

  .btn-primary:hover::before {
    opacity: 1;
  }

  /* ─── CTA button glow on hover (legacy) ─── */
  .btn-glow {
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }

  .btn-glow:hover {
    transform: translateY(-2px);
    box-shadow:
      0 4px 14px rgba(22, 163, 74, 0.4),
      0 0 20px rgba(22, 163, 74, 0.15);
  }

  /* ─── Glassmorphism card (light context) ─── */
  .card-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  }

  /* ─── Glassmorphism card (dark context) ─── */
  .card-glass-dark {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  }

  /* ─── Modern card surface ─── */
  .card-modern {
    background: #ffffff;
    border: 1px solid var(--color-border-light);
    border-radius: 1rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  }

  .card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(22, 163, 74, 0.3);
  }

  /* ─── Dark section styling ─── */
  .section-dark {
    background: var(--color-dark-bg);
    color: var(--color-text-light);
  }

  .section-dark-surface {
    background: var(--color-dark-surface);
    color: var(--color-text-light);
  }

  /* ─── Hero gradient background ─── */
  .hero-gradient-bg {
    background:
      radial-gradient(ellipse 80% 60% at 70% 30%, rgba(22, 163, 74, 0.15) 0%, transparent 70%),
      radial-gradient(ellipse 60% 50% at 20% 80%, rgba(34, 197, 94, 0.08) 0%, transparent 70%),
      linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  }

  /* ─── Section divider ─── */
  .section-divider {
    position: relative;
  }

  .section-divider::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(22, 163, 74, 0.2), rgba(22, 163, 74, 0.15), transparent);
  }

  /* FAQ Accordion smooth animation */
  .faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease-out;
  }

  .faq-answer.faq-answer-open {
    grid-template-rows: 1fr;
  }

  .faq-answer>div {
    overflow: hidden;
  }

  /* Soft link underline animation */
  .link-underline {
    position: relative;
  }

  .link-underline::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width 0.3s ease;
  }

  .link-underline:hover::after {
    width: 100%;
  }

  /* ─── Green glow orb ─── */
  .glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    background: rgba(22, 163, 74, 0.15);
    pointer-events: none;
  }

  /* ─── Input focus green glow ─── */
  .input-focus-glow:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
    outline: none;
  }

  /* ─── Submit button pulse micro-animation ─── */
  .btn-submit-pulse {
    transition: all 0.3s ease;
  }

  .btn-submit-pulse:hover {
    box-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.3);
  }

  .btn-submit-pulse:active {
    transform: scale(0.98);
  }

  /* ─── Green glow shadow for featured elements ─── */
  .shadow-glow-green {
    box-shadow:
      0 0 20px rgba(22, 163, 74, 0.12),
      0 8px 32px rgba(22, 163, 74, 0.08);
  }

  @keyframes testimonial-reveal {
    from {
      opacity: 0;
      transform: translateY(20px) scale(0.98);
    }

    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .testimonial-card-reveal {
    opacity: 0;
    animation: testimonial-reveal 0.6s ease-out forwards;
    will-change: transform, opacity;
  }

  .testimonial-delay-0 { animation-delay: 0ms; }
  .testimonial-delay-1 { animation-delay: 80ms; }
  .testimonial-delay-2 { animation-delay: 160ms; }
  .testimonial-delay-3 { animation-delay: 240ms; }
  .testimonial-delay-4 { animation-delay: 320ms; }
  .testimonial-delay-5 { animation-delay: 400ms; }
  .testimonial-delay-6 { animation-delay: 480ms; }
  .testimonial-delay-7 { animation-delay: 560ms; }

  .star-filled {
    font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 0, 'opsz' 24;
  }

  .testimonial-belt {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, black 6%, black 94%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, black 6%, black 94%, transparent 100%);
  }

  .testimonial-track {
    display: flex;
    gap: 1.5rem;
    width: max-content;
    animation: testimonial-conveyor 48s linear infinite;
    will-change: transform;
  }

  .testimonial-belt:hover .testimonial-track {
    animation-play-state: paused;
  }

  .testimonial-item {
    width: min(22rem, 85vw);
    flex: 0 0 auto;
  }

  @keyframes testimonial-conveyor {
    from {
      transform: translateX(0);
    }

    to {
      transform: translateX(calc(-50% - 0.75rem));
    }
  }

  @media (min-width: 768px) {
    .testimonial-item {
      width: 24rem;
    }
  }

  /* ─── Enhanced section divider ─── */
  .section-divider {
    position: relative;
  }

  .section-divider::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #16a34a, transparent);
    border-radius: 2px;
  }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .faq-answer {
    transition: none;
  }

  .card-hover-lift:hover,
  .btn-hover-lift:hover,
  .card-modern:hover {
    transform: none;
  }

  .testimonial-card-reveal {
    animation: none;
    opacity: 1;
  }

  .testimonial-track {
    animation: none;
  }
}