:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --secondary: #10b981;
  --accent: #f59e0b;
  --dark: #0f172a;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-600: #64748b;
  --gray-800: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--dark);
  scroll-behavior: smooth;
}

/* ─── Navbar ─── */
.navbar {
  background: rgba(255,255,255,.92) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 0;
}
.navbar-brand {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--primary) !important;
  letter-spacing: -.5px;
  padding: 14px 0;
}
.navbar-brand i { font-size: 1.6rem; margin-right: 8px; }
.navbar-brand span { color: var(--secondary); }

.nav-link {
  font-weight: 500;
  color: var(--gray-800) !important;
  padding: 18px 16px !important;
  transition: color .2s;
}
.nav-link:hover { color: var(--primary) !important; }
.nav-link i { margin-right: 6px; font-size: .85rem; }

.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 8px;
  margin-top: 4px !important;
}
.dropdown-item {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: .9rem;
  font-weight: 500;
  transition: all .15s;
}
.dropdown-item:hover { background: var(--gray-100); color: var(--primary); }

.search-btn {
  background: var(--gray-100);
  border: none;
  border-radius: 50px;
  padding: 8px 20px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: all .25s;
}
.search-btn:hover { background: var(--primary); color: #fff; }

/* ─── Hero ─── */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0d6efd 100%);
  padding: 100px 0 70px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 10% 20%, rgba(13,110,253,.15) 0%, transparent 70%),
    radial-gradient(ellipse 500px 300px at 90% 80%, rgba(16,185,129,.1) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .5;
}

.hero * { position: relative; z-index: 1; }
.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1.15;
}
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,.7);
  max-width: 600px;
  line-height: 1.6;
}

.hero-search {
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 60px;
  padding: 6px;
  max-width: 520px;
  display: flex;
}
.hero-search input {
  border: none;
  background: transparent;
  padding: 12px 20px;
  font-size: 1rem;
  outline: none;
  flex: 1;
  color: #fff;
}
.hero-search input::placeholder { color: rgba(255,255,255,.4); }
.hero-search button {
  border-radius: 40px;
  padding: 10px 28px;
  font-weight: 600;
  background: var(--primary);
  border: none;
  white-space: nowrap;
  color: #fff;
}
.hero-search button:hover { background: var(--primary-dark); transform: scale(1.02); }

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
}
.hero-stats div { text-align: center; }
.hero-stats strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}
.hero-stats small {
  color: rgba(255,255,255,.55);
  font-size: .85rem;
}

/* ─── Sections ─── */
section { padding: 70px 0; }
section:nth-child(even) { background: #fff; }
.section-title {
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}
.section-sub {
  color: var(--gray-600);
  font-size: .95rem;
  margin-bottom: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Toggle Tabs ─── */
.toggle-tabs {
  display: inline-flex;
  background: var(--gray-100);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.06);
}
.toggle-tabs .toggle-btn {
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-weight: 600;
  font-size: .9rem;
  padding: 10px 24px;
  border-radius: 11px;
  cursor: pointer;
  transition: all .25s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toggle-tabs .toggle-btn i { font-size: 1rem; }
.toggle-tabs .toggle-btn:hover { color: var(--gray-800); }
.toggle-tabs .toggle-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px,1fr));
  gap: 10px;
  animation: fadeUp .3s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.city-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  color: var(--gray-800);
  font-weight: 500;
  font-size: .9rem;
  text-decoration: none;
  transition: all .2s;
}
.city-grid a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13,110,253,.25);
}
.city-grid a.active-city {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(13,110,253,.25);
}

.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* ─── Doctor Cards ─── */
.doctor-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  height: 100%;
  border: 1px solid var(--gray-200);
  position: relative;
}
.doctor-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity .35s;
}
.doctor-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,.1);
  transform: translateY(-5px);
  border-color: transparent;
}
.doctor-card:hover::after { opacity: 1; }
.doctor-card .card-img-wrap {
  position: relative;
  overflow: hidden;
  height: 220px;
  background: var(--gray-100);
}
.doctor-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.doctor-card:hover .card-img-wrap img { transform: scale(1.05); }
.doctor-card .verified-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(255,255,255,.92);
  border-radius: 30px;
  padding: 3px 10px 3px 6px;
  font-size: .75rem;
  font-weight: 600;
  color: #1877f2;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 4px;
}
.doctor-card .verified-badge i { font-size: .9rem; }

.doctor-card .card-body {
  padding: 18px;
}
.doctor-card .card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.doctor-card .card-title a {
  color: var(--dark);
  text-decoration: none;
}
.doctor-card .card-title a:hover { color: var(--primary); }

.doctor-card .card-text {
  font-size: .82rem;
  color: var(--gray-600);
  margin-bottom: 6px;
  line-height: 1.5;
}
.doctor-card .badge-exp {
  background: #dcfce7;
  color: #16a34a;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 30px;
}
.doctor-card .badge-spec {
  background: #eff6ff;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 30px;
}
.doctor-card .chamber-info {
  border-top: 1px solid var(--gray-200);
  margin-top: 12px;
  padding-top: 12px;
  font-size: .8rem;
}
.doctor-card .chamber-info strong { color: var(--dark); }
.doctor-card .chamber-info small {
  display: block;
  color: var(--gray-600);
  margin-top: 2px;
}
.doctor-card .btn-profile {
  width: 100%;
  margin-top: 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .85rem;
  padding: 8px;
}

/* ─── Hierarchy Browser ─── */
.hierarchy-container {
  animation: fadeUp .35s ease;
}
.hierarchy-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.hierarchy-header .h-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: #fff;
  color: var(--gray-600);
  text-decoration: none;
  transition: all .2s;
  flex-shrink: 0;
}
.hierarchy-header .h-back:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.hierarchy-header .h-label {
  font-size: .95rem;
  font-weight: 600;
  color: var(--gray-600);
}
.hierarchy-header .h-label strong { color: var(--dark); }

/* ─── District Grid (level 0) ─── */
.dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
  gap: 12px;
}
.dist-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 600;
  font-size: .9rem;
  transition: all .3s;
  cursor: pointer;
}
.dist-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(13,110,253,.18);
}
.dist-item i {
  font-size: 1.6rem;
  margin-bottom: 8px;
  color: var(--primary);
}
.dist-item .dist-count {
  font-size: .75rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-top: 4px;
}
.dist-item:hover .dist-count { color: var(--primary); }

/* ─── Specialty/Hospital List (level 1) ─── */
.spec-intro {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  line-height: 1.7;
  font-size: .9rem;
  color: var(--gray-600);
}
.spec-intro strong { color: var(--dark); }

.spec-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spec-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 500;
  font-size: .9rem;
  transition: all .25s;
  cursor: pointer;
}
.spec-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(13,110,253,.12);
}
.spec-item i {
  font-size: 1.3rem;
  color: var(--primary);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.spec-item .spec-name { flex: 1; }
.spec-item .spec-count {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 3px 12px;
  border-radius: 30px;
  flex-shrink: 0;
}
.spec-item:hover .spec-count { background: #eff6ff; color: var(--primary); }

/* Hierarchy doctor cards (level 2) */
.hierarchy-doctors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: 16px;
}
.hierarchy-doctors .doctor-card { margin: 0; }



/* ─── Footer ─── */
footer {
  background: var(--dark);
  color: rgba(255,255,255,.6);
  padding: 40px 0 20px;
}
footer h6 {
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}
footer a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: .88rem;
  display: block;
  margin-bottom: 6px;
}
footer a:hover { color: #fff; }
footer .social a {
  display: inline-block;
  margin-right: 12px;
  font-size: 1.2rem;
}
footer hr { border-color: rgba(255,255,255,.1); }

/* ─── Profile Page ─── */
#profile-page { display: none; }
#profile-page.show { display: block; }
#home-page.hidden { display: none; }

.breadcrumb-custom {
  font-size: .82rem;
  padding: 12px 0;
  background: transparent;
}
.breadcrumb-custom a {
  color: var(--primary);
  text-decoration: none;
}
.breadcrumb-custom a:hover { text-decoration: underline; }

.profile-header {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 24px;
}
.profile-header .row { margin: 0; }
.profile-header .photo-col {
  padding: 0;
  max-width: 320px;
  flex: 0 0 320px;
  background: var(--gray-100);
}
.profile-header .photo-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-header .info-col {
  padding: 30px;
  flex: 1;
  position: relative;
}
.profile-header .info-col h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 12px;
}
.profile-header .info-col .degree {
  font-size: .88rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 8px;
}
.profile-header .info-col .degree strong { color: var(--dark); }
.profile-header .info-col .extra-training {
  font-size: .85rem;
  color: var(--gray-600);
  margin-bottom: 10px;
  padding-left: 14px;
  border-left: 3px solid var(--primary);
}
.profile-header .info-col .meta-item {
  font-size: .88rem;
  margin-bottom: 6px;
}
.profile-header .info-col .meta-item i {
  width: 20px;
  color: var(--primary);
  margin-right: 6px;
}
.profile-header .info-col .experience-badge {
  display: inline-block;
  background: #dcfce7;
  color: #16a34a;
  font-weight: 700;
  font-size: .85rem;
  padding: 4px 14px;
  border-radius: 30px;
  margin-bottom: 10px;
}
.profile-header .info-col .specialty-tag {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
  font-size: .85rem;
  padding: 4px 14px;
  border-radius: 30px;
  margin-bottom: 10px;
}
.profile-header .verified-corner {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: var(--gray-100);
  padding: 6px 12px 4px;
  border-radius: 8px 0 0;
  font-size: .78rem;
  font-weight: 600;
  color: #1877f2;
  display: flex;
  align-items: center;
  gap: 4px;
}
.profile-header .verified-corner i { font-size: 1rem; }

.profile-header .rating-stars {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.profile-header .rating-stars .star {
  color: #f59e0b;
  font-size: 1.1rem;
}
.profile-header .rating-stars .count {
  color: var(--gray-600);
  font-size: .82rem;
  margin-left: 4px;
}

.verified-note {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: .82rem;
  color: var(--gray-600);
  margin-bottom: 24px;
  line-height: 1.6;
}
.verified-note strong { color: var(--dark); }

.chamber-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 28px;
  margin-bottom: 24px;
}
.chamber-card h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.chamber-card h2 i { color: var(--primary); margin-right: 8px; }
.chamber-card .chamber-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.chamber-card .chamber-name a { color: var(--primary); text-decoration: none; }
.chamber-card .chamber-name a:hover { text-decoration: underline; }
.chamber-card .chamber-detail {
  font-size: .88rem;
  color: var(--gray-600);
  margin-bottom: 4px;
}
.chamber-card .chamber-detail i {
  width: 20px;
  color: var(--primary);
  margin-right: 6px;
}
.chamber-card .chamber-detail strong { color: var(--dark); }
.chamber-card .call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--secondary);
  color: #fff;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 30px;
  text-decoration: none;
  margin-top: 12px;
  transition: all .25s;
}
.chamber-card .call-btn:hover { background: #059669; transform: translateY(-2px); }

.about-section {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  padding: 28px;
  margin-bottom: 24px;
}
.about-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.about-section h2 i { color: var(--primary); margin-right: 8px; }
.about-section p {
  font-size: .9rem;
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 12px;
}
.about-section p strong { color: var(--dark); }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--gray-600);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color .2s;
}
.back-btn:hover { color: var(--primary); }

/* ─── View All / Hidden Doctors ─── */
.doctor-hidden { display: none; }
#view-all-btn.showing-less .bi-arrow-right { transform: rotate(180deg); display: inline-block; }

.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s;
  z-index: 999;
  cursor: pointer;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ─── Tab animation ─── */
.tab-pane {
  transition: opacity .25s ease-in-out;
}
.tab-pane.fade {
  opacity: 0;
}
.tab-pane.fade.show {
  opacity: 1;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hero { padding: 60px 0 40px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 20px; }
  .hero-stats strong { font-size: 1.4rem; }
  section { padding: 40px 0; }
  .city-grid { grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); }
  .dist-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); }
  .hierarchy-doctors { grid-template-columns: 1fr; }
  .spec-item { padding: 12px 16px; font-size: .85rem; flex-wrap: wrap; gap: 8px; }
  .spec-intro { padding: 16px; font-size: .85rem; }
  .profile-header .photo-col { max-width: 100%; flex: 0 0 100%; height: 300px; }
  .profile-header .info-col { padding: 20px; }
  .profile-header .info-col h1 { font-size: 1.3rem; }
  .chamber-card, .about-section { padding: 20px; }
}
