:root {
  --primary: #0e7490; /* Dental Cyan / Teal */
  --primary-hover: #0891b2;
  --primary-light: #e0f2fe;
  --primary-dark: #0f172a; /* Navy Blue */
  --accent: #d97706; /* Premium Amber Gold */
  --accent-light: #fef3c7;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --border-color: rgba(14, 116, 144, 0.12);
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --navbar-bg: rgba(255, 255, 255, 0.85);
  --card-bg: rgba(255, 255, 255, 0.75);
}

[data-theme="dark"] {
  --bg-light: #0f172a;
  --bg-white: #1e293b;
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(248, 250, 252, 0.1);
  --primary-light: rgba(14, 116, 144, 0.15);
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.4);
  --navbar-bg: rgba(15, 23, 42, 0.85);
  --card-bg: rgba(30, 41, 59, 0.75);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg-light);
  color: var(--text-dark);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-size: 1rem;
}

main {
  overflow-x: hidden;
  width: 100%;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .brand-serif {
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 700;
  color: var(--text-dark);
}

h1 {
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .text-gradient {
  background: linear-gradient(135deg, #22d3ee, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.section-pad {
  padding: 100px 0;
}

.eyebrow {
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 0.75rem;
}

[data-theme="dark"] .eyebrow {
  color: #38bdf8;
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 3rem;
}

/* Header & Navbar */
.navbar {
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 0;
  min-height: 75px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

@media (min-width: 992px) {
  .navbar {
    height: 80px;
    padding: 0;
  }
}

.navbar-brand img {
  object-fit: contain;
}

.nav-link {
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-light);
}

/* Buttons */
.btn-theme, .btn-outline-theme {
  border-radius: 999px;
  padding: 0.75rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-theme.btn-sm, .btn-outline-theme.btn-sm:not(.btn-icon-only) {
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
}

.btn-theme {
  background: var(--primary);
  color: #ffffff !important;
  border: 2px solid var(--primary);
  box-shadow: 0 4px 14px rgba(14, 116, 144, 0.25);
}

.btn-theme:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(14, 116, 144, 0.35);
}

.btn-outline-theme {
  background: transparent;
  color: var(--primary) !important;
  border: 2px solid var(--primary);
}

.btn-outline-theme:hover {
  background: var(--primary);
  color: #ffffff !important;
  transform: translateY(-2px);
}

.btn-icon-only {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

/* Hero Section */
.hero {
  min-height: 95vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  background: 
    radial-gradient(circle at 80% 20%, rgba(14, 116, 144, 0.08), transparent 40%),
    radial-gradient(circle at 10% 80%, rgba(217, 119, 6, 0.05), transparent 45%),
    var(--bg-light);
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.hero .lead {
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-image-container {
  position: relative;
  z-index: 1;
}

.hero-image-container::before {
  content: '';
  position: absolute;
  inset: -10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.15;
  filter: blur(10px);
}

.hero-image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  object-fit: cover;
  border: 4px solid var(--bg-white);
}

/* Stats Badges */
.stat-card-glow {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 0.75rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.stat-card-glow:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.glass-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(14, 116, 144, 0.25);
}

/* About Clinic */
.about-box {
  padding: 2.5rem;
  border-radius: var(--radius-lg);
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.about-feat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.about-feat-item i {
  color: var(--primary);
  font-size: 1.25rem;
}

/* Services */
.service-icon-wrap {
  width: 60px;
  height: 60px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary);
  font-size: 1.5rem;
  transition: var(--transition);
}

.glass-card:hover .service-icon-wrap {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.1) rotate(5deg);
}

/* Doctor Section */
.doctor-img-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 6px solid var(--bg-white);
  position: relative;
}

.doctor-img-wrap img {
  transition: var(--transition);
}

.doctor-img-wrap:hover img {
  transform: scale(1.05);
}

.doctor-badge {
  background: var(--accent);
  color: #ffffff;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 1rem;
}

/* Testimonials Swiper */
.testimonial-swiper {
  padding-bottom: 3rem;
}

.swiper-pagination-bullet-active {
  background: var(--primary) !important;
  width: 24px !important;
  border-radius: 4px !important;
}

.client-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.rating-stars {
  color: var(--accent);
  margin-bottom: 1rem;
}

/* Gallery Section */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4/3;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent 80%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: var(--transition);
}

.gallery-card:hover img {
  transform: scale(1.08);
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-filter-btn {
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.gallery-filter-btn.active, .gallery-filter-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
}

.gallery-filter-btn .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  transition: var(--transition);
}

.gallery-filter-btn.active .badge {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

/* FAQ Accordion */
.faq-accordion .accordion-item {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) !important;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.faq-accordion .accordion-button {
  background: var(--bg-white);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 1.25rem 1.5rem;
  box-shadow: none;
  font-family: "Outfit", sans-serif;
}

.faq-accordion .accordion-button:not(.collapsed) {
  color: var(--primary);
  background: var(--primary-light);
}

.faq-accordion .accordion-body {
  color: var(--text-muted);
  padding: 1.25rem 1.5rem;
  line-height: 1.7;
}

/* Appointment Form */
.booking-form-wrap {
  border-radius: var(--radius-lg);
  padding: 3rem;
}

.form-control, .form-select {
  background: var(--bg-light);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text-dark);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  background: var(--bg-white);
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px rgba(14, 116, 144, 0.15);
  color: var(--text-dark);
}

/* Floating Tools */
.floating-whatsapp {
  position: fixed;
  bottom: 85px;
  right: 25px;
  width: 52px;
  height: 52px;
  background: #25d366;
  color: #ffffff !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 999;
  transition: var(--transition);
}

.floating-whatsapp:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 52px;
  height: 52px;
  background: var(--primary-dark);
  color: #ffffff;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: var(--shadow-md);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  cursor: pointer;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

/* Loader */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader span {
  width: 48px;
  height: 48px;
  border: 3.5px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer & Socials */
footer {
  background: var(--primary-dark);
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer h6 {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

footer a {
  color: #94a3b8;
}

footer a:hover {
  color: #ffffff !important;
}

.social-icon {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  font-size: 1rem;
  transition: var(--transition);
}

.social-icon:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

/* Responsive Overrides */
@media (max-width: 991px) {
  .navbar-collapse {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-top: 1rem;
    border: 1px solid var(--border-color);
  }
  .nav-link {
    padding: 0.75rem 1rem !important;
  }
  .section-pad {
    padding: 70px 0;
  }
  .booking-form-wrap {
    padding: 2rem;
  }
}

/* Compatibility Aliases for older classes */
.soft-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  padding: 1.5rem;
}
.soft-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.btn-heal {
  background: var(--primary);
  color: #ffffff !important;
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 10px rgba(14, 116, 144, 0.25);
}
.btn-heal:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(14, 116, 144, 0.35);
}
.btn-outline-heal {
  background: transparent;
  color: var(--primary) !important;
  border: 2px solid var(--primary);
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}
.btn-outline-heal:hover {
  background: var(--primary);
  color: #ffffff !important;
  transform: translateY(-2px);
}
.icon-box {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
}

/* Folder Gallery CSS */
.folder-card {
  transition: var(--transition);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
}
.folder-card:hover, .folder-card.active {
  transform: translateY(-5px);
  border-color: var(--primary);
  background: var(--primary-light);
}
.folder-card.active .folder-icon {
  color: var(--primary) !important;
}
.folder-icon {
  transition: var(--transition);
}

/* Service Card Swiper CSS */
.service-card-swiper .swiper-pagination-bullet {
  background: #ffffff;
  opacity: 0.6;
}
.service-card-swiper .swiper-pagination-bullet-active {
  background: var(--primary) !important;
  opacity: 1;
}

/* Gallery Lightbox Modal Styles */
#galleryLightboxModal {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox-swiper {
  width: 100%;
  height: 85vh;
  padding: 2rem 0;
}

.lightbox-swiper .swiper-slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 4rem;
  height: 100%;
  box-sizing: border-box;
}

.lightbox-swiper .swiper-slide img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
}

.lightbox-swiper .swiper-slide img:hover {
  transform: scale(1.02);
}

.lightbox-caption {
  margin-top: 1.5rem;
  color: #ffffff;
  z-index: 10;
}

.lightbox-caption h5 {
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.lightbox-caption .badge {
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}

.lightbox-swiper .swiper-button-next,
.lightbox-swiper .swiper-button-prev {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: var(--transition);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.lightbox-swiper .swiper-button-next:after,
.lightbox-swiper .swiper-button-prev:after {
  font-size: 1.25rem;
  font-weight: bold;
}

.lightbox-swiper .swiper-button-next:hover,
.lightbox-swiper .swiper-button-prev:hover {
  background: var(--primary);
  color: #ffffff !important;
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
  .lightbox-swiper {
    height: 75vh;
  }
  .lightbox-swiper .swiper-slide {
    padding: 0 2rem;
  }
  .lightbox-swiper .swiper-button-next,
  .lightbox-swiper .swiper-button-prev {
    display: none; /* Rely on swipe gestures on mobile */
  }
  .lightbox-swiper .swiper-slide img {
    max-height: 55vh;
  }
}

/* Responsive adjustments for mobile layout containment */
@media (max-width: 991px) {
  .hero-image-container::before {
    inset: 0;
  }
}

@media (max-width: 576px) {
  /* Prevent buttons from overflowing narrow screens */
  .btn-theme, .btn-outline-theme {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    white-space: normal !important;
    text-align: center;
    justify-content: center;
  }
  
  /* Prevent grid overflow in About Section */
  .about-features {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  
  /* Booking form padding on extra small screens */
  .booking-form-wrap {
    padding: 1.25rem !important;
  }
}