/* ============================================
   Cabinet Pédiatrie Dr. Malak Boukhzar
   Styles — Responsive, Trilingue (FR/AR/EN)
   ============================================ */

:root {
  --primary: #2E86AB;
  --primary-dark: #1a6a8a;
  --primary-light: #d0eaf5;
  --secondary: #A8DADC;
  --accent: #FF6B6B;
  --accent-soft: #ffe0e0;
  --green: #52b788;
  --yellow: #f4c542;
  --bg: #f8fafc;
  --white: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(46, 134, 171, 0.10);
  --shadow-hover: 0 8px 32px rgba(46, 134, 171, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Poppins', 'Cairo', sans-serif;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Arabic RTL support */
html[dir="rtl"] body { font-family: 'Cairo', 'Poppins', sans-serif; }
html[dir="rtl"] .nav-links { flex-direction: row-reverse; }
html[dir="rtl"] .hero-content { flex-direction: row-reverse; }
html[dir="rtl"] .about-grid { flex-direction: row-reverse; }
html[dir="rtl"] .info-grid { flex-direction: row-reverse; }
html[dir="rtl"] .diploma-item { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .info-card { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .footer-inner { flex-direction: row-reverse; }
html[dir="rtl"] .hero-cta { flex-direction: row-reverse; }
html[dir="rtl"] .section-header { text-align: right; }
html[dir="rtl"] .section-header::before { right: 0; left: auto; }
html[dir="rtl"] .stat { text-align: right; }

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

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.navbar.scrolled { box-shadow: var(--shadow); }

.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px; gap: 24px;
}

.logo { display: flex; align-items: center; }
.logo-img { height: 52px; width: auto; object-fit: contain; }

.nav-links { display: flex; gap: 8px; }
.nav-links a {
  padding: 8px 14px; border-radius: 8px;
  font-size: 0.875rem; font-weight: 500; color: var(--text-light);
  transition: all 0.2s;
}
.nav-links a:hover { background: var(--primary-light); color: var(--primary); }

.lang-switcher { display: flex; gap: 4px; align-items: center; }
.lang-btn {
  padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 7px;
  background: none; cursor: pointer; font-size: 0.8rem; font-weight: 600;
  color: var(--text-light); transition: all 0.2s; font-family: var(--font);
}
.lang-btn.active, .lang-btn:hover {
  background: var(--primary); color: white; border-color: var(--primary);
}

.hamburger {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px; background: var(--text);
  border-radius: 2px; transition: all 0.3s;
}

.mobile-menu {
  display: none; flex-direction: column; padding: 16px 24px 20px;
  border-top: 1px solid var(--border); gap: 4px; background: white;
}
.mobile-menu a {
  padding: 10px 12px; border-radius: 8px; color: var(--text-light);
  font-weight: 500; font-size: 0.9rem; transition: all 0.2s;
}
.mobile-menu a:hover { background: var(--primary-light); color: var(--primary); }
.mobile-lang { flex-direction: row; padding: 12px 12px 0; }

/* ===== HERO ===== */
.hero {
  min-height: 100vh; position: relative;
  background: linear-gradient(135deg, #e8f4fc 0%, #d0eaf5 40%, #e8f8f0 100%);
  display: flex; align-items: center; padding-top: 70px; overflow: hidden;
}

.hero-bg {
  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='%232E86AB' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  display: flex; align-items: center; justify-content: space-between;
  gap: 48px; padding: 60px 0 80px; width: 100%;
}

.hero-text { flex: 1; max-width: 560px; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); color: var(--primary); font-size: 0.82rem;
  font-weight: 600; padding: 7px 16px; border-radius: 50px;
  border: 1.5px solid var(--secondary); box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700;
  line-height: 1.15; color: var(--text); margin-bottom: 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.hero-specialty {
  font-size: clamp(1rem, 2.2vw, 1.25rem); font-weight: 600;
  color: var(--primary); text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--primary-light); padding: 4px 14px; border-radius: 50px;
  display: inline-block; width: fit-content;
}
.hero-name { line-height: 1.1; }
.hero-title .accent { color: var(--primary); }

.hero-subtitle {
  font-size: 1.05rem; color: var(--text-light); max-width: 440px;
  margin-bottom: 32px; line-height: 1.8;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 50px; font-weight: 600;
  font-size: 0.95rem; transition: all 0.25s; cursor: pointer; border: none;
  font-family: var(--font);
}
.btn-primary {
  background: var(--primary); color: white;
  box-shadow: 0 4px 16px rgba(46,134,171,0.35);
}
.btn-primary:hover {
  background: var(--primary-dark); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46,134,171,0.4);
}
.btn-whatsapp {
  background: #25D366; color: white;
  box-shadow: 0 4px 16px rgba(37,211,102,0.3);
}
.btn-whatsapp:hover {
  background: #1da851; transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,0.4);
}

.hero-stats { display: flex; align-items: center; gap: 24px; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 1.6rem; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-light); margin-top: 3px; }
.stat-divider { width: 1px; height: 40px; background: var(--border); }

/* Doctor Card */
.hero-image { flex-shrink: 0; position: relative; }

.doctor-card {
  background: white; border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow-hover); width: 300px;
  animation: floatCard 6s ease-in-out infinite;
}
@keyframes floatCard { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }

.doctor-photo {
  height: 280px; background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.doctor-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.doctor-photo-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--primary); font-weight: 600;
}

.doctor-info { padding: 20px; }
.doctor-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.doctor-info p { font-size: 0.8rem; color: var(--text-light); margin-bottom: 12px; }
.doctor-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.doctor-tags span {
  background: var(--primary-light); color: var(--primary);
  font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 20px;
}

.floating-badge {
  position: absolute; background: white; border-radius: 50px;
  padding: 8px 16px; font-size: 0.78rem; font-weight: 600; color: var(--text);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 6px;
}
.fb1 { top: -16px; right: -20px; background: var(--accent-soft); color: var(--accent); }
.fb2 { bottom: 24px; left: -32px; }

.hero-wave {
  position: absolute; bottom: 0; left: 0; right: 0;
}
.hero-wave svg { display: block; width: 100%; height: 60px; }

/* ===== SECTIONS ===== */
.section { padding: 90px 0; }

.section-header { text-align: center; margin-bottom: 56px; }
.section-tag {
  display: inline-block; background: var(--primary-light); color: var(--primary);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 50px; margin-bottom: 14px;
}
.section-header h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 700;
  color: var(--text); margin-bottom: 12px;
}
.section-header p { color: var(--text-light); font-size: 1rem; max-width: 520px; margin: 0 auto; }

/* ===== ABOUT ===== */
.about-grid {
  display: flex; gap: 56px; align-items: flex-start;
}

.about-text { flex: 1.2; }
.about-text p { color: var(--text-light); margin-bottom: 18px; font-size: 0.97rem; line-height: 1.85; }

.diplomas { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; }
.diploma-item {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--bg); padding: 14px 18px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}
html[dir="rtl"] .diploma-item { border-left: none; border-right: 3px solid var(--primary); }
.diploma-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.diploma-item strong { display: block; font-size: 0.9rem; color: var(--text); margin-bottom: 2px; }
.diploma-item span { font-size: 0.8rem; color: var(--text-light); }

.about-values { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.value-card {
  background: white; padding: 22px 18px; border-radius: var(--radius);
  box-shadow: var(--shadow); transition: all 0.25s;
}
.value-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.value-icon { font-size: 1.8rem; margin-bottom: 10px; }
.value-card h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.value-card p { font-size: 0.8rem; color: var(--text-light); line-height: 1.6; }

/* ===== SERVICES ===== */
.services { position: relative; }
.services-bg {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, #e8f4fc 50%, var(--bg) 100%);
  z-index: 0;
}
.services .container { position: relative; z-index: 1; }

.services-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}

.service-card {
  background: white; padding: 28px 22px; border-radius: var(--radius);
  box-shadow: var(--shadow); transition: all 0.25s; cursor: default;
  border-top: 3px solid transparent;
}
.service-card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-hover);
  border-top-color: var(--primary);
}
.service-icon { font-size: 2.2rem; margin-bottom: 14px; }
.service-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.service-card p { font-size: 0.8rem; color: var(--text-light); line-height: 1.65; }

/* ===== INFO ===== */
.info-grid { display: flex; gap: 40px; align-items: flex-start; }
.info-cards { flex: 1; display: flex; flex-direction: column; gap: 16px; }

.info-card {
  display: flex; gap: 16px; background: white; padding: 18px 20px;
  border-radius: var(--radius); box-shadow: var(--shadow); align-items: flex-start;
}
.info-card-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 2px; }
.info-card h4 { font-weight: 700; font-size: 0.9rem; margin-bottom: 5px; color: var(--text); }
.info-card p, .info-card a { font-size: 0.85rem; color: var(--text-light); line-height: 1.7; }
.info-link { color: var(--primary); font-weight: 600; transition: opacity 0.2s; }
.info-link:hover { opacity: 0.75; }
.whatsapp-link { color: #25D366 !important; }

.hours-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 0.83rem; color: var(--text-light); }
.hours-grid span:nth-child(odd) { font-weight: 600; color: var(--text); }

.social-links { display: flex; gap: 10px; }
.social-btn {
  display: flex; align-items: center; gap: 8px; padding: 10px 18px;
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600;
  transition: all 0.2s;
}
.social-btn.instagram { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: white; }
.social-btn.facebook { background: #1877F2; color: white; }
.social-btn:hover { transform: translateY(-2px); opacity: 0.9; }

.map-container {
  flex: 1.2; position: relative; height: 440px; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.map-container iframe { height: 100%; border-radius: var(--radius); }
.map-btn {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: white; color: var(--primary); padding: 10px 20px; border-radius: 50px;
  font-size: 0.82rem; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap;
  transition: all 0.2s;
}
.map-btn:hover { background: var(--primary); color: white; }

/* ===== CONTACT ===== */
.contact { position: relative; padding: 90px 0; }
.contact-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1a6a8a 0%, #2E86AB 60%, #3a9bc0 100%);
  z-index: 0;
}
.contact .container { position: relative; z-index: 1; }
.section-header.light .section-tag { background: rgba(255,255,255,0.2); color: white; }
.section-header.light h2 { color: white; }
.section-header.light p { color: rgba(255,255,255,0.8); }

.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.contact-card {
  background: rgba(255,255,255,0.12); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius);
  padding: 32px 24px; text-align: center; color: white; transition: all 0.25s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.contact-card:hover { background: rgba(255,255,255,0.2); transform: translateY(-4px); }
.contact-card.info-only { cursor: default; }
.contact-card.whatsapp:hover { background: rgba(37,211,102,0.25); }
.cc-icon { font-size: 2.4rem; margin-bottom: 6px; }
.contact-card h3 { font-size: 1.1rem; font-weight: 700; }
.contact-card p { font-size: 0.88rem; opacity: 0.85; line-height: 1.6; }
.cc-btn {
  margin-top: 10px; background: white; padding: 9px 22px; border-radius: 50px;
  font-size: 0.82rem; font-weight: 700; color: var(--primary); transition: all 0.2s;
}
.contact-card.whatsapp .cc-btn { color: #25D366; }
.cc-btn:hover { transform: scale(1.04); }
.cc-label { margin-top: 10px; font-size: 0.78rem; opacity: 0.75; font-style: italic; }

/* ===== FOOTER ===== */
.footer { background: var(--text); color: rgba(255,255,255,0.7); padding: 36px 0 0; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 24px; padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-logo { display: flex; flex-direction: column; }
.footer-logo span { color: white; font-weight: 700; font-size: 1rem; }
.footer-logo small { font-size: 0.75rem; margin-top: 3px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 0.85rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--secondary); }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; color: white;
}
.footer-social a:hover { background: var(--primary); transform: translateY(-2px); }
.footer-bottom { padding: 16px 24px; text-align: center; font-size: 0.78rem; }

/* ===== FLOATING WHATSAPP ===== */
.float-whatsapp {
  position: fixed; bottom: 28px; right: 28px; z-index: 999;
  width: 58px; height: 58px; background: #25D366; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: white;
  box-shadow: 0 4px 20px rgba(37,211,102,0.45); transition: all 0.25s;
  animation: pulse 2.5s ease-in-out infinite;
}
html[dir="rtl"] .float-whatsapp { right: auto; left: 28px; }
.float-whatsapp:hover { transform: scale(1.1); box-shadow: 0 8px 32px rgba(37,211,102,0.55); }
@keyframes pulse {
  0%,100%{box-shadow:0 4px 20px rgba(37,211,102,0.45)}
  50%{box-shadow:0 4px 32px rgba(37,211,102,0.7), 0 0 0 8px rgba(37,211,102,0.1)}
}

/* ===== FAQ ===== */
.faq-grid { display: flex; flex-direction: column; gap: 12px; max-width: 860px; margin: 0 auto 40px; }

.faq-item {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; border: 1.5px solid transparent; transition: border-color 0.2s;
}
.faq-item.open { border-color: var(--primary); }

.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 24px; background: none; border: none; cursor: pointer;
  text-align: left; font-family: var(--font); font-size: 0.97rem; font-weight: 600;
  color: var(--text); transition: color 0.2s;
}
html[dir="rtl"] .faq-question { text-align: right; flex-direction: row-reverse; }
.faq-item.open .faq-question { color: var(--primary); }

.faq-arrow { flex-shrink: 0; color: var(--text-light); transition: transform 0.3s; }
.faq-item.open .faq-arrow { transform: rotate(180deg); color: var(--primary); }

.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.3s;
  padding: 0 24px;
}
.faq-item.open .faq-answer { max-height: 300px; padding: 0 24px 20px; }
.faq-answer p { font-size: 0.88rem; color: var(--text-light); line-height: 1.75; }
.faq-answer a { color: var(--primary); font-weight: 600; }

.area-served {
  background: var(--primary-light); border-radius: var(--radius);
  padding: 18px 24px; text-align: center;
  border-left: 4px solid var(--primary);
}
html[dir="rtl"] .area-served { border-left: none; border-right: 4px solid var(--primary); }
.area-served p { font-size: 0.88rem; color: var(--text-light); line-height: 1.8; }
.area-served strong { color: var(--text); }

/* ===== ANIMATIONS ===== */
.fade-in { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { flex-direction: column; gap: 40px; }
  .about-values { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-menu.open { display: flex; }

  .hero-content { flex-direction: column; text-align: center; padding: 40px 0 60px; }
  html[dir="rtl"] .hero-content { flex-direction: column; }
  .hero-text { max-width: 100%; }
  .hero-subtitle { max-width: 100%; margin: 0 auto 32px; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-image { width: 100%; display: flex; justify-content: center; }
  .doctor-card { width: 280px; }
  .fb2 { display: none; }

  .info-grid { flex-direction: column; }
  .map-container { width: 100%; height: 320px; }

  .contact-cards { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .footer-social { justify-content: center; }

  .services-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .services-grid { grid-template-columns: 1fr; }
  .about-values { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .stat-divider { width: 40px; height: 1px; }
}
