/* ==========================================================================
   MB MEDIA — Pearl Dental Clinic (عيادة اللؤلؤة لطب الأسنان)
   Engine E4 — Interactive Appointment Booking Demo
   Design System: Medical Sky Glassmorphism & Micro-animations
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-gradient: linear-gradient(135deg, #EBF1F5 0%, #F4F8FA 50%, #E6F0F5 100%);
  --accent-teal: #0E7C7B;
  --accent-teal-dark: #0A5A59;
  --accent-teal-light: #2D7A82;
  --accent-mint: #10B981;
  --accent-cyan: #06B6D4;
  --accent-gold: #D97706;

  /* Glassmorphism Specs */
  --glass-bg: rgba(255, 255, 255, 0.68);
  --glass-bg-hover: rgba(255, 255, 255, 0.85);
  --glass-border: 1px solid rgba(255, 255, 255, 0.85);
  --glass-border-teal: 1px solid rgba(14, 124, 123, 0.25);
  --glass-shadow: 0 16px 36px rgba(14, 124, 123, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
  --glass-shadow-hover: 0 24px 48px rgba(14, 124, 123, 0.16), 0 6px 16px rgba(0, 0, 0, 0.05);

  /* Typography & Colors */
  --text-main: #1E293B;
  --text-muted: #475569;
  --text-light: #64748B;

  /* Layout & Spacing */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-full: 9999px;
  --container-max: 1200px;
  --nav-height: 52px;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background: #EBF1F5;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  line-height: 1.6;
  position: relative;
  padding-top: var(--nav-height);
}

/* Watermark Background */
.watermark-bg {
  position: fixed;
  inset: 0;
  background-image: url('img/bg-smile-watermark.webp');
  background-repeat: repeat;
  background-size: 380px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

/* Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
  position: relative;
  z-index: 1;
}

.section-spacing {
  padding-block: 4.5rem;
}

/* Typography Helpers */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(14, 124, 123, 0.12);
  color: var(--accent-teal);
  border: 1px solid rgba(14, 124, 123, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.8rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Glass Card Component */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-hover);
}

/* Pure CSS Shimmer & Glow Effects */
@keyframes shimmer {
  0% { transform: translateX(-150%) rotate(25deg); }
  100% { transform: translateX(150%) rotate(25deg); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(14, 124, 123, 0.3); }
  50% { box-shadow: 0 0 30px rgba(14, 124, 123, 0.6); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 70%
  );
  transform: translateX(-150%) rotate(25deg);
  animation: shimmer 4.5s infinite;
  pointer-events: none;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-teal-light) 100%);
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(14, 124, 123, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(14, 124, 123, 0.42);
  background: linear-gradient(135deg, var(--accent-teal-dark) 0%, var(--accent-teal) 100%);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent-teal);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--accent-teal);
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: background 0.25s ease, transform 0.25s ease;
}

.btn-outline:hover {
  background: var(--accent-teal);
  color: #FFFFFF;
  transform: translateY(-2px);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding-block: 3.5rem 4.5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent-teal) 0%, var(--accent-teal-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-visual-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(16px);
  border: var(--glass-border);
}

.teeth-3d-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, rgba(14, 124, 123, 0.1) 0%, transparent 70%);
}

.teeth-3d-img {
  width: 100%;
  max-width: 380px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(14, 124, 123, 0.2));
  animation: pulseGlow 4s infinite ease-in-out;
}

.hero-doctor-avatar {
  position: absolute;
  bottom: -20px;
  right: -10px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #FFFFFF;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

[dir="ltr"] .hero-doctor-avatar {
  right: auto;
  left: -10px;
}

.hero-doctor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Floating Stats Badge */
.floating-stat-card {
  position: absolute;
  top: 15px;
  left: -15px;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(14, 124, 123, 0.18);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: floatSlow 3.5s infinite ease-in-out;
  z-index: 2;
}

[dir="ltr"] .floating-stat-card {
  left: auto;
  right: -15px;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(14, 124, 123, 0.12);
  color: var(--accent-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-number {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-teal);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==========================================================================
   Curved Background Separator & Services
   ========================================================================== */
.curved-section {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(235, 241, 245, 0.6) 100%);
  border-radius: var(--radius-lg);
  margin-block: 2rem;
  padding-block: 4rem;
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 640px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
}

.service-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  height: 100%;
}

.service-img-wrapper {
  width: 100%;
  height: 190px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: rgba(14, 124, 123, 0.05);
  position: relative;
}

.service-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.service-card:hover .service-img {
  transform: scale(1.06);
}

.service-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.6rem;
}

.service-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.service-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px dashed rgba(71, 85, 105, 0.18);
  margin-top: auto;
}

.service-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-teal);
}

.service-btn {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* ==========================================================================
   Zig-Zag Layout (About Section)
   ========================================================================== */
.zigzag-container {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.zigzag-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 992px) {
  .zigzag-row {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
  .zigzag-row.reverse {
    direction: rtl;
  }
  [dir="rtl"] .zigzag-row.reverse {
    direction: ltr;
  }
  .zigzag-row.reverse > * {
    direction: rtl;
  }
  [dir="rtl"] .zigzag-row.reverse > * {
    direction: ltr;
  }
}

.zigzag-img-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  border: var(--glass-border);
}

.zigzag-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}

.zigzag-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.feature-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-teal);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Booking Calendar & Form Section
   ========================================================================== */
.booking-section {
  background: linear-gradient(135deg, rgba(14, 124, 123, 0.06) 0%, rgba(255, 255, 255, 0.8) 100%);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  border: var(--glass-border-teal);
}

.booking-card {
  max-width: 860px;
  margin-inline: auto;
  padding: 2.5rem 1.75rem;
}

@media (min-width: 768px) {
  .booking-card {
    padding: 3rem 2.5rem;
  }
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-group-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-teal);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-teal);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
}

.pill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.85rem;
}

.pill-option {
  position: relative;
}

.pill-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-label {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(71, 85, 105, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-label strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

.pill-label span {
  font-size: 0.78rem;
  color: var(--text-light);
}

.pill-option input[type="radio"]:checked + .pill-label {
  background: rgba(14, 124, 123, 0.1);
  border-color: var(--accent-teal);
  box-shadow: 0 4px 14px rgba(14, 124, 123, 0.15);
}

.pill-option input[type="radio"]:checked + .pill-label strong {
  color: var(--accent-teal);
}

/* Date & Time Selector */
.date-time-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .date-time-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(71, 85, 105, 0.2);
  border-radius: var(--radius-md);
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.18);
}

/* ==========================================================================
   Before & After Gallery
   ========================================================================== */
.ba-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .ba-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ba-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.ba-images-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
  position: relative;
}

.ba-img-box {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 220px;
  background: rgba(14, 124, 123, 0.05);
}

.ba-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-tag {
  position: absolute;
  bottom: 8px;
  inset-inline-start: 8px;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.ba-tag.after {
  background: rgba(14, 124, 123, 0.85);
}

.ba-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.ba-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   FAQ Accordion
   ========================================================================== */
.faq-container {
  max-width: 800px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--glass-bg);
  border: var(--glass-border);
  transition: background 0.2s ease;
}

.faq-summary {
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent-teal);
  transition: transform 0.25s ease;
}

.faq-item[open] .faq-summary::after {
  content: '−';
  transform: rotate(180deg);
}

.faq-content {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px dashed rgba(71, 85, 105, 0.15);
  margin-top: 0.5rem;
  padding-top: 1rem;
}

/* ==========================================================================
   CTA & Footer
   ========================================================================== */
.cta-banner {
  background: linear-gradient(135deg, var(--accent-teal-dark) 0%, var(--accent-teal) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  box-shadow: 0 20px 40px rgba(14, 124, 123, 0.25);
  margin-bottom: 4rem;
}

.cta-banner h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.cta-banner p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 2rem;
}

.footer-unified {
  padding-block: 3rem 2rem;
  border-top: 1px solid rgba(71, 85, 105, 0.15);
  background: rgba(255, 255, 255, 0.4);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-brand h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-teal);
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.925rem;
  color: var(--text-muted);
  max-width: 360px;
}

.footer-links h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-teal);
}

.footer-bottom {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-light);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(71, 85, 105, 0.1);
}

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