/* ============================================
   UltraHealth — Modern Healthcare Design System
   Inspired by premium healthcare app UIs
   ============================================ */

/* --- 1. Color Palette --- */
:root {
  --primary: #0D9488;
  --primary-dark: #0F766E;
  --primary-light: #CCFBF1;
  --primary-50: #F0FDFA;
  --accent: #F59E0B;
  --accent-light: #FEF3C7;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --green: #10B981;
  --green-light: #D1FAE5;
  --blue: #3B82F6;
  --blue-light: #DBEAFE;
  --purple: #8B5CF6;
  --purple-light: #EDE9FE;
  --dark: #1E293B;
  --dark-light: #334155;
  --gray: #64748B;
  --gray-light: #94A3B8;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --white: #FFFFFF;
  --bg: #F8FAFB;
  --card: #FFFFFF;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);
  --shadow-teal: 0 8px 24px rgba(13,148,136,0.25);
  --radius: 20px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-full: 9999px;
  --font: 'Cairo', 'Inter', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1200px;
}

/* --- 2. Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; color: inherit; transition: all var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font-family: var(--font); font-size: 15px; }

/* --- 3. Typography --- */
h1, h2, h3, h4, h5, h6 { font-weight: 800; line-height: 1.3; color: var(--dark); }
h1 { font-size: clamp(28px, 4vw, 48px); letter-spacing: -0.5px; }
h2 { font-size: clamp(22px, 3vw, 36px); letter-spacing: -0.3px; }
h3 { font-size: clamp(18px, 2vw, 22px); }
p { line-height: 1.8; color: var(--gray); }

/* --- 4. Container --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; width: 100%; }

/* --- 5. Focus States --- */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; top: -100%; left: 0;
  background: var(--primary); color: #fff; padding: 12px 24px; z-index: 10000;
  font-weight: 700; border-radius: 0 0 var(--radius-xs) 0;
}
.skip-link:focus { top: 0; }

/* --- 6. Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 700;
  font-size: 14px; cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-teal); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(13,148,136,0.35); }
.btn-teal { background: var(--primary); color: #fff; }
.btn-teal:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius-md); }

/* --- 7. Tags / Badges --- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--radius-full); font-size: 12px; font-weight: 700; }
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-accent { background: var(--accent-light); color: #D97706; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-light); color: var(--primary-dark);
  padding: 6px 18px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 700; margin-bottom: 14px;
}

/* --- 8. Header --- */
header {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xs);
  position: sticky; top: 0; z-index: 100; transition: var(--transition);
  border-bottom: 1px solid var(--gray-200);
}
header.scrolled { box-shadow: var(--shadow-md); }
header > .container {
  display: flex; align-items: center; justify-content: space-between; padding-block: 12px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 900; flex-shrink: 0; }
.logo-ultra {
  background: var(--red); color: #fff; padding: 4px 12px; border-radius: var(--radius-xs);
  font-weight: 900; font-size: 16px; letter-spacing: 1px;
}
.logo-health {
  border: 2px solid var(--dark); padding: 4px 12px; border-radius: var(--radius-xs);
  font-weight: 900; font-size: 16px; letter-spacing: 1px;
}

/* Nav */
nav { display: flex; align-items: center; gap: 8px; }
nav a:not(.btn) {
  padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--gray);
  border-radius: var(--radius-xs); transition: var(--transition);
}
nav a:not(.btn):hover { color: var(--primary); background: var(--primary-light); }

/* Hamburger */
.hamburger { display: none; width: 40px; height: 40px; background: none; border: none; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 8px; border-radius: var(--radius-xs); }
.hamburger span { display: block; height: 2.5px; background: var(--dark); border-radius: 3px; transition: 0.3s; width: 22px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* Mobile Nav */
.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 98; opacity: 0; transition: 0.3s; backdrop-filter: blur(4px); }
.nav-overlay.open { display: block; opacity: 1; }
.mobile-nav {
  display: none; position: fixed; top: 0; left: -300px; width: 280px; height: 100%;
  background: var(--white); z-index: 99; padding: 80px 24px 24px; transition: 0.3s;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12); overflow-y: auto;
}
.mobile-nav.open { display: block; left: 0; }
.mobile-nav a { display: block; padding: 14px 0; font-size: 15px; font-weight: 600; color: var(--dark); border-bottom: 1px solid var(--gray-100); }
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav .btn { display: flex; margin-top: 12px; width: 100%; justify-content: center; }

/* Search */
.header-search {
  position: relative; display: flex; align-items: center;
}
.header-search input {
  padding: 8px 14px 8px 36px; border: 2px solid var(--gray-200);
  border-radius: var(--radius-full); font-size: 13px; background: var(--gray-100);
  transition: var(--transition); width: 160px;
}
.header-search input:focus { width: 220px; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(13,148,136,0.1); outline: none; }
.header-search .search-icon { position: absolute; left: 12px; color: var(--gray-light); }

/* --- 9. Hero Section --- */
.hero {
  padding: 60px 0 80px;
  background: linear-gradient(180deg, var(--primary-50) 0%, #fff 100%);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(13,148,136,0.08) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.hero > .container { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 1; }
.hero-content h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 900; line-height: 1.15; margin-bottom: 20px; letter-spacing: -1px; }
.hero-content h1 span { color: var(--primary); position: relative; display: inline-block; }
.hero-content h1 span::after {
  content: ''; position: absolute; bottom: 4px; left: 0; right: 0; height: 10px;
  background: var(--primary-light); border-radius: 5px; z-index: -1;
}
.hero-content p { font-size: 17px; color: var(--gray); line-height: 1.8; margin-bottom: 32px; max-width: 500px; }
.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats div { text-align: center; }
.hero-stats strong { display: block; font-size: 28px; font-weight: 900; color: var(--primary); }
.hero-stats span { font-size: 13px; color: var(--gray); font-weight: 600; }

/* --- 10. Section Titles --- */
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: clamp(24px, 3.5vw, 36px); font-weight: 900; margin-bottom: 12px; }
.section-title h2 span { color: var(--primary); }
.section-title p { font-size: 16px; color: var(--gray); max-width: 500px; margin: 0 auto; }

/* --- 11. Cards Grid --- */
.doc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.doc-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 28px;
  text-align: center; box-shadow: var(--shadow-sm); transition: all var(--transition);
  border: 1px solid var(--gray-200); position: relative; overflow: hidden;
}
.doc-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.doc-card img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; border: 3px solid var(--primary-light); }
.doc-card h4 { font-size: 16px; font-weight: 800; margin-bottom: 4px; color: var(--dark); }
.doc-spec { font-size: 13px; color: var(--gray); display: block; margin-bottom: 8px; }
.doc-card .btn { margin-top: 12px; }

/* --- 12. Specialization Cards --- */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.spec-card {
  background: var(--card); border-radius: var(--radius-md); padding: 28px 20px;
  text-align: center; box-shadow: var(--shadow-sm); transition: all var(--transition);
  border: 1px solid var(--gray-200);
}
.spec-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.spec-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.spec-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.spec-card p { font-size: 12px; color: var(--gray); }

/* --- 13. Steps --- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.step-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 32px 24px;
  text-align: center; box-shadow: var(--shadow-sm); transition: all var(--transition);
  border: 1px solid var(--gray-200); position: relative;
}
.step-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.step-card .step-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 16px; background: var(--primary-light); }
.step-card h3 { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.step-card p { font-size: 14px; color: var(--gray); line-height: 1.7; }

/* --- 14. Why Section --- */
.why { background: var(--primary); color: #fff; position: relative; overflow: hidden; border-radius: 0; }
.why::before {
  content: ''; position: absolute; inset: 0;
  background: 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.05'%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");
  pointer-events: none;
}
.why > .container { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; position: relative; z-index: 1; }
.why-content h2 { font-size: clamp(24px, 3.5vw, 34px); font-weight: 900; margin-bottom: 16px; color: #fff; }
.why-content p { font-size: 16px; color: rgba(255,255,255,0.9); margin-bottom: 28px; line-height: 1.8; }
.why-card {
  background: rgba(255,255,255,0.12); backdrop-filter: blur(10px);
  border-radius: var(--radius); padding: 28px; width: 100%; max-width: 340px;
  border: 1px solid rgba(255,255,255,0.15);
}
.why-card-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.15); transition: var(--transition);
  font-size: 15px; font-weight: 600;
}
.why-card-item:last-child { border-bottom: none; }
.why-card-item:hover { padding-right: 8px; }

/* --- 15. FAQ --- */
.faq { background: var(--gray-100); }
.faq-item {
  background: var(--card); border-radius: var(--radius-md); padding: 20px;
  margin-bottom: 12px; box-shadow: var(--shadow-xs); transition: var(--transition);
  border: 1px solid transparent;
}
.faq-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
.faq-item h4 { font-size: 15px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item h4 .faq-icon { font-size: 18px; color: var(--primary); flex-shrink: 0; transition: var(--transition); }
.faq-item p { font-size: 14px; color: var(--gray); line-height: 1.8; margin-top: 12px; display: none; }
.faq-item.active p { display: block; }
.faq-item.active .faq-icon { transform: rotate(45deg); }

/* --- 16. CTA --- */
.cta {
  text-align: center; padding: 80px 0;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-light) 100%);
}
.cta h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 900; margin-bottom: 10px; }
.cta p { font-size: 16px; color: var(--gray); margin-bottom: 28px; }

/* --- 17. BMI Section --- */
.bmi-section { background: var(--primary-50); }

/* --- 18. Forms --- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--dark); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 15px;
  transition: var(--transition); background: var(--white); color: var(--dark);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,148,136,0.1);
}

/* --- 19. Filters --- */
.filters { background: var(--white); padding: 16px 0; border-bottom: 1px solid var(--gray-200); position: sticky; top: 60px; z-index: 50; }
.filters .container { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filters label { font-weight: 700; font-size: 13px; color: var(--gray); }
.filters select, .filters input { padding: 8px 14px; border: 2px solid var(--gray-200); border-radius: var(--radius-xs); font-size: 13px; background: var(--white); }

/* --- 20. Page Header --- */
.page-header {
  background: linear-gradient(135deg, var(--primary-50) 0%, #F0FDFA 50%, #FFF8E1 100%);
  padding: 50px 0; text-align: center; position: relative; overflow: hidden;
}
.page-header::before {
  content: ''; position: absolute; top: -30%; left: -10%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(13,148,136,0.06) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.page-header h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 900; margin-bottom: 8px; }
.page-header p { font-size: 16px; color: var(--gray); }
.breadcrumbs { font-size: 13px; color: var(--gray-light); margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.breadcrumbs a { color: var(--primary); }
.breadcrumbs a:hover { text-decoration: underline; }

/* --- 21. Doctor Profile --- */
.doctor-profile-single { padding: 40px 0 60px; }
.profile-main { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; }
.profile-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 100px; }
.profile-info-card, .profile-contact-card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.profile-spec-badge { display: inline-block; background: var(--primary-light); color: var(--primary-dark); padding: 4px 16px; border-radius: 20px; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.profile-content { display: flex; flex-direction: column; gap: 24px; }
.profile-bio, .profile-certs { background: var(--card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.profile-bio h3, .profile-certs h3 { font-size: 17px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.bio-text { font-size: 15px; color: var(--dark-light); line-height: 2; }
.contact-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--gray-100); color: var(--dark); font-size: 14px; font-weight: 600; text-decoration: none; transition: all var(--transition); margin-bottom: 8px; border: 1px solid var(--gray-200); }
.contact-item:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.contact-item.whatsapp { background: #25D366; color: #fff; border-color: #25D366; }
.contact-item.whatsapp:hover { background: #1da851; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37,211,102,0.3); }
.whatsapp-btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 28px; background: #25D366; color: #fff; border-radius: var(--radius-md); font-size: 16px; font-weight: 700; text-decoration: none; transition: all var(--transition); }
.whatsapp-btn:hover { background: #1da851; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,211,102,0.35); }

/* --- 22. Booking Section --- */
.booking-section { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.booking-card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-btn { padding: 12px 8px; border: 2px solid var(--gray-200); border-radius: var(--radius-sm); text-align: center; cursor: pointer; transition: var(--transition); background: var(--white); }
.day-btn:hover { border-color: var(--primary); }
.day-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.time-btn { padding: 10px; border: 2px solid var(--gray-200); border-radius: var(--radius-xs); text-align: center; cursor: pointer; transition: var(--transition); background: var(--white); font-size: 14px; font-weight: 600; }
.time-btn:hover { border-color: var(--primary); }
.time-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- 23. Footer --- */
footer { background: #1a2332; color: #fff; padding-top: 60px; padding-bottom: 0; }
.footer { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer h4 { font-size: 16px; font-weight: 800; margin-bottom: 16px; color: #fff; }
.footer a { display: block; padding: 6px 0; font-size: 14px; color: rgba(255,255,255,0.65); transition: var(--transition); }
.footer a:hover { color: var(--primary); padding-right: 4px; }
.footer p { font-size: 14px; color: rgba(255,255,255,0.65); line-height: 1.8; }
.footer-bottom { padding: 20px 0; text-align: center; background: #1a2332; }
.footer-bottom p { font-size: 13px; color: rgba(255,255,255,0.5); margin: 0; }
.social-links { display: flex; gap: 12px; margin-top: 16px; }
.social-links a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; color: #fff; transition: var(--transition); }
.social-links a:hover { background: var(--primary); }

/* --- 24. Notifications --- */
.uh-notification {
  position: fixed; top: 80px; right: 20px; z-index: 200;
  background: var(--white); padding: 16px 24px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200);
  transition: opacity 0.3s; max-width: 400px;
}

/* --- 25. Animations --- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.fade-up { opacity: 0; transform: translateY(20px); }
.fade-up.visible { animation: fadeUp 0.6s ease forwards; }
.fade-in { opacity: 0; animation: fadeIn 0.6s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* --- 25.5. Pagination --- */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 32px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
  font-size: 14px; font-weight: 700; text-decoration: none;
  border: 2px solid var(--gray-200); color: var(--dark);
  background: var(--card); transition: all var(--transition);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination .active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.pagination .disabled {
  opacity: 0.4; pointer-events: none;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flex-row-mobile { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.stack-on-mobile { display: contents; }

/* Articles Pagination */
.pagination-btn {
  width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  font-weight: 700; text-decoration: none; background: var(--white); transition: var(--transition);
}
.pagination-btn-active {
  border-color: var(--primary); background: var(--primary); color: #fff;
  box-shadow: 0 4px 12px rgba(13,148,136,0.3);
}
.pagination-btn-outline {
  color: var(--primary); border-color: var(--primary);
}
.pagination-btn-outline:hover {
  background: var(--primary); color: #fff; transform: translateY(-2px);
}
.pagination-btn-disabled {
  color: var(--gray-light); cursor: not-allowed; opacity: 0.5;
}

[dir="rtl"] .header-search .search-icon { left: auto; right: 12px; }
[dir="rtl"] .header-search input { padding-left: 14px; padding-right: 36px; }

/* ============================================
   DARK MODE for inline styled elements
   ============================================ */
@media (prefers-color-scheme: dark) {
  .bmi-section .bmi-form-wrap,
  .why .why-card,
  .testimonials .testimonial-card { background: var(--white); border-color: var(--gray-200); }
  .stats-bar-inner { background: var(--white) !important; }
  .stats-bar-inner div { border-color: var(--gray-200) !important; }

  /* Filament dashboard dark mode overrides */
  [style*="background:white"],
  [style*="background:#fff"],
  [style*="background: white"],
  [style*="background: #fff"] {
    background: var(--white) !important;
  }
  [style*="border:1px solid #f0f0f0"] {
    border-color: var(--gray-200) !important;
  }
  [style*="color:#111827"] { color: var(--dark) !important; }
  [style*="color:#6B7280"] { color: var(--gray) !important; }
  [style*="color:#9CA3AF"] { color: var(--gray-light) !important; }

  /* Wallet dark gradients */
  [data-dark-bg] { background-image: attr(data-dark-bg) !important; }
}

/* --- 26. Responsive — Tablet --- */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .doc-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .spec-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .footer { grid-template-columns: 1fr 1fr; gap: 32px; }
  .featured-strip-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .hero > .container { gap: 40px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

/* --- 27. Responsive — Mobile --- */
@media (max-width: 768px) {
  /* Container */
  .container { padding: 0 16px; }

  /* Header */
  nav { display: none !important; }
  .hamburger { display: flex; }
  .header-search { display: none; }
  header > .container { padding-block: 8px; }
  .logo img { height: 36px !important; }
  .logo { gap: 4px; font-size: 16px; }
  header > .container > div:last-child a[href*="lang"] { display: none; }

  /* Hero */
  .hero { padding: 32px 0 48px; }
  .hero > .container { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .hero-content h1 { font-size: clamp(22px, 5vw, 32px); margin-bottom: 16px; }
  .hero-content p { margin: 0 auto 24px; font-size: 14px; line-height: 1.7; }
  .hero-stats { justify-content: center; gap: 16px; }
  .hero-stats strong { font-size: 22px; }
  .hero-stats span { font-size: 12px; }

  /* Featured Strip */
  .featured-strip-grid { grid-template-columns: 1fr !important; gap: 12px !important; }

  /* Sections — Consistent spacing */
  section { padding: 40px 0; }
  .section-title { margin-bottom: 28px; }
  .section-title h2 { font-size: clamp(20px, 4vw, 28px); margin-bottom: 8px; }
  .section-title p { font-size: 14px; }
  .section-title .badge { font-size: 12px; padding: 4px 14px; margin-bottom: 10px; }

  /* Grids — 1 column */
  .doc-grid { grid-template-columns: 1fr; gap: 16px; }
  .spec-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .steps { grid-template-columns: 1fr; gap: 16px; }
  .post-grid { grid-template-columns: 1fr; gap: 16px; }

  /* Cards — Tighter padding */
  .doc-card { padding: 20px; border-radius: var(--radius-md); }
  .doc-card img { width: 64px; height: 64px; margin-bottom: 10px; }
  .doc-card h4 { font-size: 14px; }
  .spec-card { padding: 20px 16px; border-radius: var(--radius-md); }
  .spec-icon { width: 48px; height: 48px; font-size: 22px; margin-bottom: 10px; }
  .spec-card h3 { font-size: 13px; }
  .step-card { padding: 24px 18px; border-radius: var(--radius-md); }
  .step-card .step-icon { width: 56px; height: 56px; font-size: 26px; margin-bottom: 12px; }
  .step-card h3 { font-size: 15px; margin-bottom: 6px; }
  .step-card p { font-size: 13px; }

  /* Page Header */
  .page-header { padding: 24px 0; }
  .page-header h1 { font-size: 20px; margin-bottom: 6px; }
  .page-header p { font-size: 14px; }
  .breadcrumbs { font-size: 12px; margin-bottom: 8px; }

  /* Filters */
  .filters { padding: 12px 0; top: 52px; }
  .filters .container { flex-direction: column; gap: 10px; }
  .filters select, .filters input { width: 100%; font-size: 13px; padding: 10px 12px; }
  .q-chip { font-size: 12px; padding: 6px 12px; }

  /* Profile Page */
  .doctor-profile-single { padding: 24px 0 40px; }
  .profile-main { grid-template-columns: 1fr; gap: 20px; }
  .profile-sidebar { position: static; }
  .profile-info-card, .profile-contact-card { padding: 16px; border-radius: var(--radius-md); }
  .profile-bio, .profile-certs { padding: 18px; border-radius: var(--radius-md); }
  .booking-section { grid-template-columns: 1fr; }
  .booking-card { padding: 18px; border-radius: var(--radius-md); }

  /* Footer */
  .footer { grid-template-columns: 1fr; text-align: center; gap: 28px; padding-bottom: 28px; }
  footer a { justify-content: center; }
  .social-links { justify-content: center; }
  footer { padding-top: 40px; }

  /* Pagination */
  .pagination { gap: 4px; margin-top: 24px; }
  .pagination a, .pagination span { min-width: 36px; height: 36px; font-size: 13px; padding: 0 10px; }
  .pagination-btn { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
  .articles-pagination { gap: 6px !important; }

  /* Utility grids — stack on mobile */
  .grid-2col { grid-template-columns: 1fr; gap: 14px; }
  .grid-3col { grid-template-columns: 1fr; gap: 14px; }
  .flex-row-mobile { flex-direction: column; align-items: stretch; gap: 12px; }
  .stack-on-mobile { display: flex; flex-direction: column; gap: 16px; }

  /* Specialist Dashboard responsive */
  [style*="grid-template-columns:repeat(2,1fr)"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  [style*="font-size:42px"] { font-size: 28px !important; }
  [style*="font-size:28px"] { font-size: 22px !important; }
  [style*="width:80px;height:80px"] { width: 64px !important; height: 64px !important; }
  [style*="padding:28px"] { padding: 18px !important; }
  [style*="padding:24px"] { padding: 16px !important; }

  /* Why section */
  .why > .container { grid-template-columns: 1fr; gap: 30px; text-align: center; }
  .why-card { max-width: 100%; margin: 0 auto; }
  .why-card-item:hover { padding-right: 0; padding-inline-end: 8px; }

  /* Stats bar */
  .stats-bar-inner { grid-template-columns: 1fr !important; gap: 0 !important; text-align: center; }
  .stats-bar-inner div { border-right: none !important; border-left: none !important; border-bottom: 1px solid rgba(255,255,255,0.15); padding: 12px 16px; }
  .stats-bar-inner div:last-child { border-bottom: none; }

  /* BMI section */
  .bmi-section .bmi-form-wrap { grid-template-columns: 1fr !important; }
  .bmi-visual svg { max-width: 160px; height: auto; }

  /* Profile prev/next nav */
  .prev-next-nav { flex-direction: column !important; gap: 12px !important; }
  .prev-next-nav a { max-width: 100% !important; }

  /* Mobile nav RTL */
  [dir="rtl"] .mobile-nav { left: auto; right: -300px; }
  [dir="rtl"] .mobile-nav.open { left: auto; right: 0; }

  /* Skip link RTL */
  [dir="rtl"] .skip-link { left: auto; right: 0; }
}

/* --- 28. Responsive — Small Mobile --- */
@media (max-width: 480px) {
  .container { padding: 0 14px; }

  /* Hero */
  .hero { padding: 24px 0 36px; }
  .hero-content h1 { font-size: 20px; }
  .hero-content p { font-size: 13px; margin-bottom: 20px; }
  .hero-stats { gap: 12px; }
  .hero-stats strong { font-size: 18px; }
  .hero-stats span { font-size: 11px; }

  /* Sections */
  section { padding: 32px 0; }
  .section-title h2 { font-size: 18px; }

  /* Spec grid 2 cols tight */
  .spec-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .spec-card { padding: 14px 10px; }
  .spec-icon { width: 40px; height: 40px; font-size: 18px; margin-bottom: 8px; }

  /* Buttons */
  .btn-lg { padding: 12px 24px; font-size: 14px; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }

  /* Profile */
  .booking-card input, .booking-card select { font-size: 14px; padding: 10px 12px; }
  .days-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .time-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .day-btn { padding: 8px 4px; font-size: 11px; }

  /* Pagination */
  .pagination { gap: 3px; }
  .pagination a, .pagination span { min-width: 32px; height: 32px; font-size: 12px; padding: 0 8px; }
}

/* --- 27. Print --- */
@media print {
  header, footer, .hamburger, .nav-overlay, .mobile-nav { display: none !important; }
  body { background: #fff; }
  .container { max-width: 100%; }
}

/* ============================================
   SPECIALIST DASHBOARD — RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .dash-chart-container { height: 160px !important; }
  .dash-chart-bars { height: 140px !important; }
  .dash-stats-grid-2 { grid-template-columns: 1fr !important; }
  .dash-finance-summary-5 { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-data-table thead { display: none; }
  .dash-data-table tbody tr { display: flex; flex-direction: column; padding: 12px; border-bottom: 1px solid var(--gray-200); gap: 4px; }
  .dash-data-table tbody td { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: none; text-align: left; }
  .dash-data-table tbody td::before { content: attr(data-label); font-weight: 700; font-size: 0.75rem; color: var(--gray); white-space: nowrap; }
  .dash-balance-primary { padding: 16px !important; }
  .dash-balance-primary .dash-balance-amount { font-size: 1.5rem !important; }
  .dash-modal-content { max-height: 90vh !important; padding: 16px !important; margin: 8px !important; }
}
@media (max-width: 480px) {
  .dash-chart-container { height: 130px !important; }
  .dash-chart-bars { height: 110px !important; }
  .dash-doctor-header { padding: 16px !important; gap: 12px; }
  .dash-doctor-avatar { width: 56px !important; height: 56px !important; }
  .dash-quick-actions { grid-template-columns: 1fr !important; }
  .dash-wallet-inner-grid { grid-template-columns: 1fr !important; }
  .dash-finance-summary-5 { grid-template-columns: 1fr !important; }
  .dash-filter-btn { padding: 6px 10px !important; font-size: 0.7rem !important; }
  .dash-tab-btn { padding: 8px 12px !important; font-size: 0.75rem !important; }
  .dash-chart-legend { flex-direction: column; align-items: flex-start; gap: 4px; }
  .dash-case-images { flex-direction: column !important; }
  .dash-case-images img { height: 160px !important; }
}

/* --- 29. Articles Grid --- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  background: var(--card); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: all var(--transition);
  border: 1px solid var(--gray-200); display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.post-card-img-wrap { width: 100%; height: 200px; overflow: hidden; background: var(--gray-100); }
.post-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.post-card:hover .post-card-img { transform: scale(1.05); }
.post-card-img-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 48px; background: linear-gradient(135deg, var(--primary-light), #fff);
}
.post-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.post-card-cat {
  display: inline-block; background: var(--primary-light); color: var(--primary-dark);
  padding: 3px 12px; border-radius: var(--radius-full); font-size: 12px; font-weight: 700;
  margin-bottom: 10px; width: fit-content;
}
.post-card-body h3 { font-size: 17px; font-weight: 800; margin-bottom: 8px; line-height: 1.4; }
.post-card-body h3 a { color: var(--dark); }
.post-card-body h3 a:hover { color: var(--primary); }
.post-card-body p { font-size: 14px; color: var(--gray); line-height: 1.7; margin-bottom: 12px; flex: 1; }
.post-card-meta { display: flex; gap: 16px; font-size: 12px; color: var(--gray-light); font-weight: 600; border-top: 1px solid var(--gray-200); padding-top: 12px; }

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

/* ============================================
   DARK MODE
   ============================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a; --white: #1e293b; --light: #1e293b; --dark: #f1f5f9;
    --dark-light: #cbd5e1; --gray: #94a3b8; --gray-light: #64748b; --gray-100: #1e293b; --gray-200: #334155;
    --primary-light: rgba(13,148,136,0.2); --card: #1e293b;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.2); --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4); --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  }
  body { background: var(--bg); color: var(--dark); }
  header { background: rgba(15,23,42,0.97); border-bottom-color: var(--gray-200); }
  .hamburger span { background: var(--dark); }
  .page-header { background: linear-gradient(135deg, var(--bg) 0%, var(--white) 100%); }
  .hero { background: linear-gradient(180deg, var(--bg) 0%, var(--white) 100%); }
  .why { background: linear-gradient(135deg, #0F766E 0%, #134E4A 100%); }
  .cta { background: linear-gradient(135deg, var(--white) 0%, #134E4A 100%); }
  .bmi-section { background: linear-gradient(135deg, var(--white) 0%, var(--bg) 100%); }
  .doc-card, .spec-card, .step-card, .faq-item, .profile-info-card,
  .profile-contact-card, .profile-bio, .profile-certs, .booking-card {
    background: var(--white); border-color: var(--gray-200);
  }
  .doc-card h4, .doc-card .doc-spec { color: var(--dark) !important; }
  .doc-card .doc-spec { color: var(--gray) !important; }
  .profile-info-card h1, .profile-info-card .tag,
  .profile-contact-card h4, .profile-contact-card .contact-item,
  .profile-bio h3, .profile-certs h3,
  .booking-card h3, .booking-card h4, .booking-card p {
    color: var(--dark);
  }
  .bio-text { color: var(--dark-light); }
  .day-btn { color: var(--dark); border-color: var(--gray-200); }
  .day-btn .day-name { color: var(--primary); }
  .filters { background: var(--white); border-bottom-color: var(--gray-200); }
  .footer { background: #1a2332; border-top-color: var(--gray-200); }
  .footer-bottom { background: #1a2332; }
  input[type="text"], input[type="email"], input[type="search"], input[type="url"],
  input[type="password"], input[type="number"], input[type="tel"],
  textarea, select { background: var(--gray-100); color: var(--dark); border-color: var(--gray-200); }
  .mobile-nav { background: var(--white); box-shadow: 4px 0 24px rgba(0,0,0,0.3); }
  .mobile-nav a { color: var(--dark); border-bottom-color: var(--gray-200); }
  table { color: var(--dark); }
  thead th { color: var(--gray); border-bottom-color: var(--gray-200); }
  tbody td { border-bottom-color: var(--gray-200); }
}
