/* ============================================
   PREMIUM DESIGN SYSTEM - Gemstar Eagle
   $250k Website Aesthetic Upgrade
   ============================================ */

/* --- FOUNDATION: Typography Override --- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --brand-primary: #c8102e;
  --brand-primary-light: #e8384f;
  --brand-primary-dark: #a00d24;
  --brand-primary-glow: rgba(200, 16, 46, 0.35);
  --color-primary: #c8102e;
  --surface-0: #09090b;
  --surface-1: #0f0f12;
  --surface-2: #16161a;
  --surface-3: #1c1c21;
  --text-primary: #f0f0f2;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --grain-opacity: 0.025;
  --section-gap: clamp(6rem, 10vw, 10rem);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Override base font */
html, :host {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--surface-0);
  color: var(--text-primary);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

.font-body, .font-heading {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif !important;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif !important;
  letter-spacing: -0.02em;
}

/* --- GRAIN TEXTURE OVERLAY --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- REFINED COLOR OVERRIDES --- */
.bg-\[\#050505\] {
  background-color: var(--surface-0) !important;
}

.bg-\[\#0a0a0a\] {
  background-color: var(--surface-1) !important;
}

.bg-red-600 {
  background-color: var(--brand-primary) !important;
}

.bg-red-500 {
  background-color: var(--brand-primary-light) !important;
}

.bg-red-600\/10 {
  background-color: rgba(200, 16, 46, 0.1) !important;
}

.bg-red-600\/20 {
  background-color: rgba(200, 16, 46, 0.15) !important;
}

.text-red-500 {
  color: var(--brand-primary-light) !important;
}

.text-red-400 {
  color: #f06275 !important;
}

.text-red-600 {
  color: var(--brand-primary) !important;
}

.text-red-100 {
  color: #fde2e7 !important;
}

.text-slate-200 {
  color: var(--text-primary) !important;
}

.text-slate-300 {
  color: #c4c4cc !important;
}

.text-slate-400 {
  color: var(--text-secondary) !important;
}

.text-slate-500 {
  color: var(--text-tertiary) !important;
}

.border-red-600 {
  border-color: var(--brand-primary) !important;
}

.border-red-600\/30 {
  border-color: rgba(200, 16, 46, 0.3) !important;
}

.border-white\/5 {
  border-color: var(--border-subtle) !important;
}

.border-white\/10 {
  border-color: var(--border-medium) !important;
}

/* --- PREMIUM TEXT GLOW --- */
.text-glow {
  text-shadow: 0 0 40px rgba(200, 16, 46, 0.2), 0 0 80px rgba(200, 16, 46, 0.08);
}

/* --- PREMIUM BUTTONS --- */
.btn {
  padding: 14px 36px;
  border-radius: 9999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.875rem;
  transition: transform 0.4s var(--ease-out-expo),
              box-shadow 0.4s var(--ease-out-expo),
              background-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.btn:hover::after {
  opacity: 1;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 8px 32px rgba(200, 16, 46, 0.3),
              0 2px 8px rgba(200, 16, 46, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brand-primary-light) 0%, var(--brand-primary) 100%);
  box-shadow: 0 12px 40px rgba(200, 16, 46, 0.4),
              0 4px 12px rgba(200, 16, 46, 0.25);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

/* --- PREMIUM CARDS --- */
.card {
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  transition: transform 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo),
              border-color 0.4s ease,
              background-color 0.4s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
              0 0 0 1px var(--border-medium);
  border-color: var(--border-medium);
}

.card:hover::before {
  opacity: 1;
}

/* --- PREMIUM GLASS EFFECT --- */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* --- PREMIUM HEADER --- */
.header-transparent {
  transition: background-color 0.5s var(--ease-out-expo),
              backdrop-filter 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo);
}

.header-transparent.scrolled {
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 1px 0 var(--border-subtle),
              0 8px 40px rgba(0, 0, 0, 0.3);
}

.header-solid {
  background: var(--surface-0);
  box-shadow: 0 1px 0 var(--border-subtle);
}

/* --- DROPDOWN MENU REFINEMENT --- */
.group:hover > div[class*="absolute"][class*="top-full"] {
  background: var(--surface-2) !important;
  border-color: var(--border-medium) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 0 1px var(--border-subtle);
}

/* --- PREMIUM NAVIGATION --- */
nav a, .nav-link {
  position: relative;
}

nav a::after, .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--brand-primary);
  transition: width 0.4s var(--ease-out-expo), left 0.4s var(--ease-out-expo);
  border-radius: 1px;
}

nav a:hover::after, .nav-link:hover::after {
  width: 100%;
  left: 0;
}

/* Fix for dropdown items - no underline */
div[class*="absolute"] a::after {
  display: none;
}

/* --- HERO SECTION PREMIUM --- */
section[data-hero] {
  min-height: 100dvh;
}

section[data-hero]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, var(--surface-0), transparent);
  z-index: 1;
  pointer-events: none;
}

/* Subtle vignette on hero */
section[data-hero] > div:first-child::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(9, 9, 11, 0.4) 100%);
  pointer-events: none;
}

/* --- PREMIUM SECTION SPACING --- */
section[class*="py-24"] {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

/* --- STATS BAR PREMIUM --- */
section[class*="border-y"] {
  background: var(--surface-1) !important;
  border-color: var(--border-subtle) !important;
  position: relative;
}

section[class*="border-y"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 16, 46, 0.2), transparent);
}

/* --- RED CTA SECTION PREMIUM --- */
section[class*="bg-red-600"] {
  background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-primary), var(--brand-primary-light)) !important;
  position: relative;
  overflow: hidden;
}

section[class*="bg-red-600"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

section[class*="bg-red-600"] .from-red-700 {
  display: none;
}

/* --- PREMIUM PROGRESS BAR --- */
.progress-bar {
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
  transition: width 0.6s var(--ease-out-expo);
  border-radius: 1px;
  opacity: 0.7;
}

.group:hover .progress-bar {
  width: 100%;
  opacity: 1;
}

/* --- FAQ PREMIUM --- */
details.card {
  border-radius: 16px;
  transition: all 0.4s var(--ease-out-expo);
}

details.card[open] {
  background: var(--surface-1);
  border-color: var(--border-medium);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

details summary .faq-icon {
  transition: transform 0.4s var(--ease-spring);
}

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

details .px-5.pb-5 {
  animation: faqReveal 0.4s var(--ease-out-expo);
}

@keyframes faqReveal {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- GALLERY IMAGES PREMIUM --- */
.grid img[class*="rounded-xl"][class*="hover\\:scale"] {
  transition: transform 0.6s var(--ease-out-expo),
              box-shadow 0.6s var(--ease-out-expo),
              filter 0.6s ease;
  border-radius: 16px;
}

.grid img[class*="rounded-xl"][class*="hover\\:scale"]:hover {
  transform: scale(1.03) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  filter: brightness(1.05) contrast(1.02);
}

/* --- SCROLL REVEAL ANIMATIONS --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out-expo),
              transform 0.6s var(--ease-out-expo);
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.revealed > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.revealed > *:nth-child(8) { transition-delay: 560ms; }
.reveal-stagger.revealed > *:nth-child(9) { transition-delay: 640ms; }

.reveal-stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- FIXED CTA BUTTON PREMIUM --- */
a[class*="fixed"][class*="bottom-6"][class*="right-6"] {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark)) !important;
  box-shadow: 0 8px 32px rgba(200, 16, 46, 0.35),
              0 0 0 0 rgba(200, 16, 46, 0.4);
  animation: ctaPulse 3s ease-in-out infinite;
  transition: transform 0.4s var(--ease-spring),
              box-shadow 0.4s ease !important;
}

a[class*="fixed"][class*="bottom-6"][class*="right-6"]:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 12px 40px rgba(200, 16, 46, 0.45),
              0 0 0 0 rgba(200, 16, 46, 0);
  animation: none;
}

@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(200, 16, 46, 0.35),
                0 0 0 0 rgba(200, 16, 46, 0.4);
  }
  50% {
    box-shadow: 0 8px 32px rgba(200, 16, 46, 0.35),
                0 0 0 12px rgba(200, 16, 46, 0);
  }
}

/* --- FOOTER PREMIUM --- */
footer {
  background: var(--surface-0) !important;
  border-top-color: var(--border-subtle) !important;
}

footer a {
  transition: color 0.3s ease, transform 0.3s var(--ease-out-expo);
}

footer a:hover {
  transform: translateX(2px);
}

/* --- FORM INPUTS PREMIUM --- */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  transition: border-color 0.3s ease,
              box-shadow 0.3s ease,
              background-color 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.15),
              0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* --- PREMIUM BADGE/TAG STYLES --- */
span[class*="bg-red-600\\/20"][class*="border-red-600"] {
  background: rgba(200, 16, 46, 0.08) !important;
  border-color: rgba(200, 16, 46, 0.2) !important;
  backdrop-filter: blur(8px);
}

/* --- TESTIMONIAL CARDS --- */
.card .text-yellow-500 {
  color: #f5a623 !important;
  filter: drop-shadow(0 0 4px rgba(245, 166, 35, 0.3));
}

/* --- PREMIUM SCROLLBAR --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-0);
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) var(--surface-0);
}

/* --- SERVICE AREA CARDS --- */
a[class*="card"][class*="flex"][class*="items-center"][class*="justify-between"] {
  border-left: 3px solid transparent;
  transition: transform 0.4s var(--ease-out-expo),
              border-color 0.4s ease,
              background-color 0.4s ease,
              box-shadow 0.4s ease;
}

a[class*="card"][class*="flex"][class*="items-center"][class*="justify-between"]:hover {
  border-left-color: var(--brand-primary);
  transform: translateX(4px);
  box-shadow: -4px 0 16px rgba(200, 16, 46, 0.1);
}

/* --- PREMIUM LINK STYLES (within prose) --- */
.prose a {
  color: var(--brand-primary-light) !important;
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 16, 46, 0.3);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.prose a:hover {
  color: #fff !important;
  border-bottom-color: var(--brand-primary);
}

/* --- SECTION DIVIDERS --- */
section + section {
  position: relative;
}

/* --- PREMIUM MOBILE MENU --- */
#mobile-menu {
  background: var(--surface-0) !important;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}

#mobile-menu-backdrop {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* --- SELECTION COLOR --- */
::selection {
  background: rgba(200, 16, 46, 0.3);
  color: #fff;
}

::-moz-selection {
  background: rgba(200, 16, 46, 0.3);
  color: #fff;
}

/* --- SMOOTH HOVER FOR SERVICE CARDS --- */
a[class*="group"][class*="card"] {
  transition: transform 0.5s var(--ease-out-expo),
              box-shadow 0.5s var(--ease-out-expo),
              border-color 0.4s ease,
              background-color 0.4s ease;
}

a[class*="group"][class*="card"]:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35),
              0 0 80px rgba(200, 16, 46, 0.06);
}

/* --- PREMIUM IMAGE TREATMENT --- */
img[class*="rounded-xl"] {
  border-radius: 16px;
}

/* --- SECTION HEADER REFINEMENT --- */
span[class*="tracking-widest"][class*="text-sm"][class*="font-bold"][class*="uppercase"] {
  font-size: 0.75rem !important;
  letter-spacing: 0.15em !important;
  font-weight: 600 !important;
}

/* --- PREMIUM NUMBER DISPLAY --- */
div[class*="text-5xl"][class*="font-black"],
div[class*="text-3xl"][class*="font-black"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

/* --- BORDER-L CARDS (Problem Section) --- */
.card[class*="border-l-4"] {
  border-left-color: var(--brand-primary) !important;
  border-radius: 0 20px 20px 0;
}

.card[class*="border-l-4"]:hover {
  border-left-color: var(--brand-primary-light) !important;
  background: var(--surface-2) !important;
}

/* --- PRICING BADGE GLOW --- */
.shadow-\[0_20px_40px_rgba\(220\,38\,38\,0\.2\)\] {
  box-shadow: 0 20px 40px rgba(200, 16, 46, 0.25),
              0 0 80px rgba(200, 16, 46, 0.08) !important;
}

/* --- MOBILE RESPONSIVE REFINEMENTS --- */
@media (max-width: 640px) {
  .btn {
    padding: 12px 28px;
  }

  section[data-hero] h1 {
    letter-spacing: -0.01em;
  }
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}
