/* ==========================================================================
   Base & Variables (Dark/Professional Theme)
   ========================================================================== */
:root {
  --color-bg: #050505; /* Deep professional black */
  --color-surface: #111111;
  --color-surface-hover: #1a1a1a;
  
  /* Placeholders to be replaced by Agent */
  --color-primary: #1F2937; 
  --color-accent: #D97706; 
  --color-accent-glow: color-mix(in oklch, var(--color-accent) 80%, white);
  
  --color-text: #ffffff;
  --color-text-muted: #9ca3af;
  --color-border: rgba(255, 255, 255, 0.08);
  
  --font-family: 'Tajawal', sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 40px -10px var(--color-accent-glow);
}

/* Micro QA & Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overscroll-behavior: none; scroll-padding-top: 80px; }
body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }

/* Typography */
h1, h2, h3, h4 { color: var(--color-text); line-height: 1.2; font-weight: 700; margin-bottom: 16px; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
p { color: var(--color-text-muted); font-size: 1.125rem; margin-bottom: 16px; }
.section-title { margin-bottom: 8px; color: var(--color-text); }
.section-subtitle { margin-bottom: 48px; max-width: 600px; margin-inline: auto; }

/* ==========================================================================
   Components ($70K Features)
   ========================================================================== */

/* 🔴 Demo Disclaimer */
.demo-disclaimer {
  background-color: #ef4444; color: white; padding: 12px 0; text-align: center;
  font-weight: 500; font-size: 0.875rem; position: relative; z-index: 9999;
}
.disclaimer-container { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 24px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 600;
  transition: var(--transition);
}
.btn-primary { background: var(--color-text); color: var(--color-bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 25px -5px rgba(255,255,255,0.2); }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--color-text); backdrop-filter: blur(10px); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); }
.btn-accent { background: var(--color-accent); color: var(--color-bg); }
.btn-accent:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }

/* Liquid Glass Navbar ⑩ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 16px 0; transition: var(--transition);
}
.navbar.glass {
  background: color-mix(in srgb, var(--color-bg) 70%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo-link { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.25rem; }
.logo-img { height: 40px; border-radius: var(--radius-sm); }
.nav-menu { display: flex; gap: 32px; }
.nav-link { font-size: 0.9375rem; font-weight: 500; color: var(--color-text-muted); transition: color 0.3s; }
.nav-link:hover, .nav-link.active { color: var(--color-text); }
.hamburger { display: none; color: var(--color-text); width: 24px; height: 24px; }

/* SVG Grain Overlay */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--color-bg); filter: url(#grain); opacity: 0.06; z-index: 1;
}

/* ==========================================================================
   Sections
   ========================================================================== */

/* Hero */
.hero {
  position: relative; min-height: 100vh; display: flex; align-items: center;
  padding-top: 80px; overflow: hidden;
  background: radial-gradient(circle at top right, color-mix(in srgb, var(--color-accent) 15%, transparent), transparent 50%), var(--color-bg);
}
.hero-content {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
  position: relative; z-index: 2;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--color-border);
  border-radius: 100px; font-size: 0.875rem; font-weight: 500; margin-bottom: 24px;
}
.hero-ctas { display: flex; gap: 16px; margin-top: 32px; }
.hero-logo-frame {
  background: var(--color-surface); padding: 40px; border-radius: var(--radius-lg);
  border: 1px solid var(--color-border); display: flex; justify-content: center;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}

/* About */
.about { padding: 120px 0; background: var(--color-bg); }
.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.badge-wrapper { margin-bottom: 24px; }
.status-badge { display: inline-block; padding: 6px 16px; background: rgba(34, 197, 94, 0.1); color: #4ade80; border-radius: 100px; font-weight: 500; font-size: 0.875rem; }
.clinic-highlight-card { background: var(--color-surface); border: 1px solid var(--color-border); padding: 32px; border-radius: var(--radius-md); }
.clinic-highlight-card ul { list-style: none; margin-top: 16px; }
.clinic-highlight-card li { position: relative; padding-right: 24px; margin-bottom: 12px; color: var(--color-text-muted); }
.clinic-highlight-card li::before { content: "✓"; position: absolute; right: 0; color: var(--color-accent); font-weight: bold; }

/* Services (Bento Grid) */
.services { padding: 120px 0; background: var(--color-surface); }
.bento-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.bento-card {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 32px;
  display: flex; flex-direction: column; height: 100%;
}
.bento-featured { grid-column: span 2; background: linear-gradient(145deg, var(--color-bg), var(--color-surface)); }
.bento-icon { width: 56px; height: 56px; background: rgba(255,255,255,0.05); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 24px; color: var(--color-accent); }
.bento-body h3 { font-size: 1.25rem; margin-bottom: 12px; }
.bento-body p { margin-bottom: 0; font-size: 1rem; }

/* Reviews */
.reviews { padding: 120px 0; background: var(--color-bg); }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 48px; }
.review-card { background: var(--color-surface); border: 1px solid var(--color-border); padding: 32px; border-radius: var(--radius-md); }
.review-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.reviewer-name { font-weight: 700; display: block; }
.review-stars { font-size: 0.875rem; letter-spacing: 2px; }
.review-text { font-style: italic; font-size: 1rem; color: var(--color-text-muted); line-height: 1.8; }
.reviews-footer { text-align: center; }

/* Contact */
.contact { padding: 120px 0; background: var(--color-surface); }
.contact-content { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contact-info-panel { display: flex; flex-direction: column; gap: 16px; }
.contact-card { background: var(--color-bg); border: 1px solid var(--color-border); padding: 24px; border-radius: var(--radius-md); transition: var(--transition); }
.contact-card:hover { border-color: rgba(255,255,255,0.2); }
.contact-card-icon { width: 48px; height: 48px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.contact-card-details h4 { margin-bottom: 4px; font-size: 1.125rem; }
.contact-card-details p { margin-bottom: 0; font-size: 0.9375rem; }

/* Footer */
footer { background: var(--color-bg); padding: 64px 0 32px; border-top: 1px solid var(--color-border); }
.footer-content { display: flex; flex-direction: column; align-items: center; gap: 32px; }
.footer-logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.25rem; }
.footer-logo img { height: 32px; border-radius: 4px; filter: grayscale(100%); opacity: 0.7; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--color-text-muted); font-size: 0.9375rem; transition: color 0.3s; }
.footer-links a:hover { color: var(--color-text); }
.footer-bottom { margin-top: 32px; text-align: center; color: var(--color-text-muted); font-size: 0.875rem; }

/* Smart Float WhatsApp */
.whatsapp-float { position: fixed; bottom: 30px; left: 30px; z-index: 99; opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.whatsapp-float.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.whatsapp-float-btn { width: 60px; height: 60px; background-color: #25D366; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3); }
.whatsapp-float-btn svg { width: 32px; height: 32px; }

/* ==========================================================================
   Animations & $70K Level Effects
   ========================================================================== */

/* ⑪ Staggered Entry Animation */
.stagger-1 { animation-delay: 0.1s !important; }
.stagger-2 { animation-delay: 0.2s !important; }
.stagger-3 { animation-delay: 0.3s !important; }
.stagger-4 { animation-delay: 0.4s !important; }

.stagger-1, .stagger-2, .stagger-3, .stagger-4 {
  opacity: 0;
  animation: slide-up-fade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-up-fade {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ⑧ CSS Scroll-Driven Reveal (Fallback included) */
.reveal-on-scroll {
  opacity: 1; /* Fallback for older browsers */
}

@supports (animation-timeline: view()) {
  .reveal-on-scroll {
    opacity: 0;
    animation: fade-slide-up linear forwards;
    animation-timeline: view();
    animation-range: entry 5% cover 20%;
  }
}

@keyframes fade-slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ⑨ 3D Tilt Cards (Base CSS, JS handles the rest) */
.tilt-card {
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.tilt-card-inner {
  transform: translateZ(30px);
  height: 100%;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 992px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; gap: 32px; }
  .hero-ctas { justify-content: center; }
  .hero-logo-frame { max-width: 400px; margin: 0 auto; }
  .about-content { grid-template-columns: 1fr; }
  .bento-grid { grid-template-columns: 1fr 1fr; }
  .bento-featured { grid-column: span 2; }
  .contact-content { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-menu {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-surface); padding: 24px; flex-direction: column;
    gap: 16px; border-bottom: 1px solid var(--color-border);
    display: none;
  }
  .nav-menu.active { display: flex; }
  .hamburger { display: block; }
  
  .bento-grid { grid-template-columns: 1fr; }
  .bento-featured { grid-column: span 1; }
  
  .hero::after { opacity: 0.04; } /* Less grain on mobile */
  .hero-ctas { flex-direction: column; }
  
  .whatsapp-float { bottom: 20px; left: 20px; }
  .whatsapp-float-btn { width: 50px; height: 50px; }
  .whatsapp-float-btn svg { width: 26px; height: 26px; }
}

/* Respect User Preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
