/*
 * main.css — TraumaWeb v2.0
 * Diseño profesional médico: Bootstrap 5 + efectos avanzados
 * Paleta: Blanco/Gris claro con azul médico y verde esmeralda
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Rajdhani:wght@500;600;700&display=swap');

/* ══════════════════════════════════════════════
   VARIABLES GLOBALES
══════════════════════════════════════════════ */
:root {
  /* Colores principales */
  --primary:       #1E40AF;   /* Azul médico profundo */
  --primary-light: #3B82F6;   /* Azul brillante */
  --secondary:     #0EA5E9;   /* Azul cielo */
  --accent:        #10B981;   /* Verde esmeralda médico */
  --accent-warm:   #F59E0B;   /* Ámbar para badges */

  /* Fondos */
  --bg-body:       #F8FAFC;   /* Gris muy claro */
  --bg-white:      #FFFFFF;
  --bg-section:    #EFF6FF;   /* Azul muy pálido */
  --bg-dark:       #0F172A;   /* Solo para hero overlay */

  /* Texto */
  --text-primary:  #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;

  /* Bordes y sombras */
  --border:        #E2E8F0;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.10);
  --shadow-blue:   0 8px 32px rgba(30,64,175,0.2);

  /* Gradientes */
  --grad-primary:  linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  --grad-hero:     linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #1E40AF 100%);
  --grad-card:     linear-gradient(135deg, rgba(59,130,246,0.05) 0%, rgba(16,185,129,0.05) 100%);

  /* Tipografía */
  --font-body:    'Inter', -apple-system, sans-serif;
  --font-display: 'Rajdhani', sans-serif;
}

/* ══════════════════════════════════════════════
   RESET Y BASE
══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

img { max-width: 100%; height: auto; }
a   { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }

/* ══════════════════════════════════════════════
   LOADER
══════════════════════════════════════════════ */
#pageLoader {
  position: fixed;
  inset: 0;
  background: var(--bg-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s;
}
#pageLoader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-bone {
  animation: spinBone 1.2s linear infinite;
}
@keyframes spinBone {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.loader-text {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}
.loader-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
  margin: 0 3px;
  animation: loaderDot 1.4s ease-in-out infinite both;
}
.loader-dots span:nth-child(2) { animation-delay: 0.16s; }
.loader-dots span:nth-child(3) { animation-delay: 0.32s; }
@keyframes loaderDot {
  0%, 80%, 100% { transform: scale(0); }
  40%           { transform: scale(1); }
}

/* ══════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════ */
.navbar-traumaweb {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}
.navbar-traumaweb.scrolled {
  box-shadow: var(--shadow-md);
  padding: 8px 0;
}
.navbar-brand-tw {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary) !important;
  text-decoration: none;
}
.navbar-brand-tw .brand-dot {
  color: var(--secondary);
}
.nav-link-tw {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary) !important;
  padding: 6px 14px !important;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}
.nav-link-tw::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--primary-light);
  transform: scaleX(0);
  transition: transform 0.25s ease;
  border-radius: 2px;
}
.nav-link-tw:hover { color: var(--primary) !important; }
.nav-link-tw:hover::after { transform: scaleX(1); }
.nav-link-tw.active { color: var(--primary) !important; }

.btn-cita {
  background: var(--grad-primary);
  color: white !important;
  border: none;
  border-radius: 10px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.btn-cita:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.4);
  color: white !important;
}

/* ══════════════════════════════════════════════
   HERO SECTION
══════════════════════════════════════════════ */
.hero-section {
  min-height: 100vh;
  background: var(--grad-hero);
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 80px;
}

/* Patrón de fondo */
.hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(59,130,246,0.15) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(16,185,129,0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Grid médico de fondo */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.5); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 24px;
}
.hero-title .highlight {
  background: linear-gradient(135deg, #60A5FA, #34D399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  opacity: 0.85;
  font-weight: 400;
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.btn-hero-primary {
  background: white;
  color: var(--primary) !important;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.btn-hero-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.25);
}

.btn-hero-outline {
  background: rgba(255,255,255,0.1);
  color: white !important;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  backdrop-filter: blur(8px);
}
.btn-hero-outline:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-2px);
}

/* Hero stats */
.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.15);
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .number {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: white;
  display: block;
  line-height: 1;
}
.hero-stat .label {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════
   SECCIÓN GENERAL — Títulos y helpers
══════════════════════════════════════════════ */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-section);
  color: var(--primary-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ══════════════════════════════════════════════
   SECCIÓN ESTADÍSTICAS
══════════════════════════════════════════════ */
.stats-section {
  background: white;
  border-bottom: 1px solid var(--border);
}
.stat-card-new {
  text-align: center;
  padding: 40px 24px;
  position: relative;
  transition: transform 0.3s ease;
}
.stat-card-new:hover { transform: translateY(-4px); }
.stat-card-new::after {
  content: '';
  position: absolute;
  right: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: var(--border);
}
.stat-card-new:last-child::after { display: none; }
.stat-icon-circle {
  width: 64px; height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  display: block;
}
.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════
   CUERPO HUMANO INTERACTIVO
══════════════════════════════════════════════ */
.body-section {
  background: var(--bg-body);
  padding: 100px 0;
}
.body-svg-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.body-zone {
  cursor: pointer;
  transition: all 0.2s ease;
}
.body-zone:hover { opacity: 0.7; filter: drop-shadow(0 0 8px rgba(37,99,235,0.6)); }
.body-zone.active { opacity: 0.85; filter: drop-shadow(0 0 12px rgba(16,185,129,0.8)); }

.body-info-panel {
  background: white;
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}
.body-info-panel.has-content {
  border-left: 4px solid var(--primary-light);
}
.body-info-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}
.body-region-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.injury-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-section);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin: 3px;
  font-weight: 500;
}
.recovery-time {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #059669;
  font-weight: 500;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════
   VIDEOS
══════════════════════════════════════════════ */
.videos-section { background: white; padding: 100px 0; }

.video-card {
  background: var(--bg-body);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
}
.video-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-dark);
  overflow: hidden;
}
.video-thumb iframe {
  width: 100%; height: 100%;
  border: none;
  pointer-events: none;
}
.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,0.4);
  transition: all 0.3s ease;
}
.video-card:hover .video-overlay { background: rgba(15,23,42,0.2); }
.play-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.video-card:hover .play-btn {
  transform: scale(1.15);
  background: var(--primary-light);
}
.video-card:hover .play-btn svg { color: white; }
.video-card-body { padding: 16px; }
.video-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary-light);
  margin-bottom: 6px;
}
.video-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}
.video-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal de video */
.video-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.video-modal-overlay.active { display: flex; }
.video-modal-box {
  width: 90%;
  max-width: 860px;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}
.video-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}
.video-modal-close:hover { background: rgba(255,255,255,0.2); }
.video-modal-box iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}

/* ══════════════════════════════════════════════
   ARTÍCULOS
══════════════════════════════════════════════ */
.articles-section { background: var(--bg-body); padding: 100px 0; }

.article-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(59,130,246,0.3);
}
.article-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-section);
  position: relative;
}
.article-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-card:hover .article-img img { transform: scale(1.05); }
.article-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-section), var(--border));
  font-size: 48px;
}
.article-cat-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--primary-light);
  color: white;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.article-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.article-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.btn-read {
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: gap 0.2s;
}
.btn-read:hover { gap: 8px; }

/* Filtros de categoría */
.category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
  justify-content: center;
}
.cat-btn {
  padding: 8px 18px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: white;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}
.cat-btn:hover, .cat-btn.active {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: white;
}

/* Search de artículos */
.articles-search {
  position: relative;
  max-width: 440px;
  margin: 0 auto 36px;
}
.articles-search input {
  width: 100%;
  padding: 13px 20px 13px 48px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 15px;
  outline: none;
  font-family: var(--font-body);
  background: white;
  transition: all 0.2s;
  color: var(--text-primary);
}
.articles-search input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.articles-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-loading {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

/* ══════════════════════════════════════════════
   ESPECIALISTAS
══════════════════════════════════════════════ */
.specialists-section {
  background: white;
  padding: 100px 0;
}
.specialist-card {
  perspective: 1000px;
  height: 380px;
  cursor: pointer;
}
.specialist-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
  border-radius: 20px;
}
.specialist-card:hover .specialist-inner {
  transform: rotateY(180deg);
}
.specialist-front, .specialist-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.specialist-front {
  background: var(--bg-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}
.specialist-back {
  background: var(--grad-primary);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: white;
}
.specialist-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-light);
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.specialist-avatar-placeholder {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  color: white;
  border: 4px solid var(--bg-section);
}
.specialist-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.specialist-specialty {
  font-size: 13px;
  color: var(--primary-light);
  font-weight: 600;
  background: var(--bg-section);
  padding: 4px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.specialist-years {
  font-size: 13px;
  color: var(--text-secondary);
}
.specialist-flip-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}
/* Back */
.specialist-back .specialist-name { color: white; }
.specialist-back .specialist-bio {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}
.btn-whatsapp {
  background: white;
  color: #25D366 !important;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* ══════════════════════════════════════════════
   FORMULARIO DE CITAS
══════════════════════════════════════════════ */
.appointments-section {
  background: var(--bg-section);
  padding: 100px 0;
}
.appt-card {
  background: white;
  border-radius: 24px;
  padding: 48px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.appt-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-body);
  transition: all 0.25s ease;
  outline: none;
}
.appt-input:focus {
  border-color: var(--primary-light);
  background: white;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.appt-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: block;
}
.appt-group { margin-bottom: 20px; }

.btn-appt-submit {
  background: var(--grad-primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(37,99,235,0.3);
}
.btn-appt-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(37,99,235,0.4);
}

/* ══════════════════════════════════════════════
   CONTACTO
══════════════════════════════════════════════ */
.contact-section { background: white; padding: 80px 0; }
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.contact-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--bg-section);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.contact-text span {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════
   CHAT WIDGET
══════════════════════════════════════════════ */
.chat-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37,99,235,0.4);
  z-index: 1000;
  transition: all 0.3s ease;
  animation: chatPulse 3s ease-in-out infinite;
}
.chat-bubble:hover { transform: scale(1.12); }
@keyframes chatPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(37,99,235,0.4), 0 0 0 0 rgba(37,99,235,0.3); }
  50%       { box-shadow: 0 8px 24px rgba(37,99,235,0.4), 0 0 0 12px rgba(37,99,235,0); }
}
.chat-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 18px; height: 18px;
  background: #EF4444;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  max-height: 500px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  overflow: hidden;
}
.chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.chat-header {
  background: var(--grad-primary);
  padding: 16px 20px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.chat-title { font-size: 15px; font-weight: 600; }
.chat-status { font-size: 11px; opacity: 0.8; display: flex; align-items: center; gap: 4px; }
.chat-status::before { content:''; width:6px; height:6px; border-radius:50%; background:#4ADE80; display:inline-block; }
.chat-close { background:none; border:none; color:white; cursor:pointer; opacity:0.8; padding:4px; transition:opacity 0.2s; }
.chat-close:hover { opacity: 1; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.message {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity:0; transform: translateY(8px); }
  to   { opacity:1; transform: translateY(0); }
}
.message.bot {
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.message.user {
  background: var(--grad-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}
.typing-dot {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}
.specialist-escalate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: white;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 8px;
  transition: all 0.2s;
  width: fit-content;
}
.specialist-escalate-btn:hover {
  background: #22C55E;
  color: white;
  transform: translateY(-1px);
}
.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s;
  color: var(--text-primary);
  background: var(--bg-body);
}
.chat-input:focus { border-color: var(--primary-light); background: white; }
.chat-send-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s;
  flex-shrink: 0;
}
.chat-send-btn:hover { transform: scale(1.1); }

/* ══════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════ */
.footer-new {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 32px;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}
.footer-desc {
  font-size: 14px;
  line-height: 1.7;
  max-width: 260px;
}
.footer-title {
  font-size: 14px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: white; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}
.social-links { display: flex; gap: 10px; }
.social-link {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  transition: all 0.2s;
  text-decoration: none;
  font-size: 16px;
}
.social-link:hover {
  background: var(--primary-light);
  color: white;
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════
   ANIMACIONES (AOS-like con Intersection Observer)
══════════════════════════════════════════════ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-100 { transition-delay: 0.1s !important; }
.delay-200 { transition-delay: 0.2s !important; }
.delay-300 { transition-delay: 0.3s !important; }
.delay-400 { transition-delay: 0.4s !important; }
.delay-500 { transition-delay: 0.5s !important; }

/* ══════════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 6px; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 991px) {
  .hero-stat .number { font-size: 28px; }
  .hero-stats { gap: 20px; }
  .body-info-panel { margin-top: 24px; }
}
@media (max-width: 768px) {
  .chat-window { width: calc(100vw - 48px); right: 24px; }
  .hero-title { font-size: 36px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .stat-card-new::after { display: none; }
  .appt-card { padding: 28px 20px; }
}

/* ══════════════════════════════════════════════
   ESTILOS: MODELO HUMANO REALISTA & AUDIO VOZ
══════════════════════════════════════════════ */
.body-interactive-wrapper {
  position: relative;
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Selector de vistas Frontal / Posterior */
.body-view-controls {
  display: flex;
  gap: 6px;
  background: var(--bg-section);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.body-view-btn {
  padding: 7px 16px;
  border-radius: 9px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}
.body-view-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Contenedor del modelo con Pins interactivos */
.human-model-stage {
  position: relative;
  width: 320px;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.human-silhouette-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 12px 24px rgba(30,64,175,0.08));
}

/* Hotspot Pins Interactivos */
.body-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
  z-index: 10;
}
.body-pin::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary-light);
  opacity: 0.35;
  animation: pinPulse 2s ease-out infinite;
  pointer-events: none;
}
.body-pin .pin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-light);
  transition: all 0.2s;
}
.body-pin:hover {
  transform: scale(1.3);
  border-color: var(--accent);
  background: var(--primary-light);
  z-index: 20;
}
.body-pin:hover .pin-dot { background: white; }
.body-pin.active {
  transform: scale(1.35);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(16,185,129,0.25), 0 8px 20px rgba(16,185,129,0.4);
}
.body-pin.active .pin-dot { background: white; }

@keyframes pinPulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Tooltip en hover sobre el pin */
.body-pin .pin-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text-dark);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.body-pin:hover .pin-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Ondas de Audio de Voz Latino */
.voice-wave-container {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  vertical-align: middle;
}
.voice-wave-bar {
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
  animation: voiceWave 1s ease-in-out infinite alternate;
}
.voice-wave-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.voice-wave-bar:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.voice-wave-bar:nth-child(3) { height: 18px; animation-delay: 0.2s; }
.voice-wave-bar:nth-child(4) { height: 10px; animation-delay: 0.4s; }
.voice-wave-bar:nth-child(5) { height: 16px; animation-delay: 0.15s; }

@keyframes voiceWave {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

/* ══════════════════════════════════════════════
   SECCIÓN PREMIUM: TELECONSULTA EN VIVO
══════════════════════════════════════════════ */
.premium-section {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 60%, #1E40AF 100%);
  color: white;
  padding: 90px 0;
  position: relative;
  overflow: hidden;
}
.premium-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 24px;
  padding: 40px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 50px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px rgba(245,158,11,0.4);
}

/* ══════════════════════════════════════════════
   MODAL OVERLAY GLOBAL & TELECONSULTA EN VIVO
══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalOverlayFade 0.25s ease forwards;
}

@keyframes modalOverlayFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal Box Teleconsulta */
.teleconsult-modal-box {
  background: #FFFFFF;
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  height: 82vh;
  max-height: 740px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  animation: modalBoxPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalBoxPop {
  from { transform: scale(0.92) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* Header Teleconsulta */
.teleconsult-header {
  background: linear-gradient(135deg, #1E3A8A 0%, #1E40AF 50%, #2563EB 100%);
  color: #FFFFFF;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(30, 64, 175, 0.2);
}

.doctor-live-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.live-pulse-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulseDot 1.5s ease-in-out infinite;
}

/* Cuerpo de Mensajes */
.teleconsult-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: #F8FAFC;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.live-msg {
  max-width: 78%;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  word-wrap: break-word;
  animation: msgSlideIn 0.2s ease forwards;
}

@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* En la vista del Paciente: */
.live-msg.patient-own, .live-msg.patient {
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 100%) !important;
  color: #FFFFFF !important;
  align-self: flex-end !important;
  margin-left: auto !important;
  border-bottom-right-radius: 4px !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25) !important;
}

.live-msg.doctor-received, .live-msg.doctor {
  background: #FFFFFF !important;
  color: #0F172A !important;
  align-self: flex-start !important;
  margin-right: auto !important;
  border-bottom-left-radius: 4px !important;
  border: 1.5px solid #CBD5E1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.live-msg .msg-sender {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.live-msg.doctor-received .msg-sender, .live-msg.doctor .msg-sender { color: #2563EB; }
.live-msg.patient-own .msg-sender, .live-msg.patient .msg-sender { color: #BFDBFE; }

.live-msg .msg-time {
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.8;
  display: block;
}
.live-msg.doctor-received .msg-time, .live-msg.doctor .msg-time { text-align: left; color: #64748B; }
.live-msg.patient-own .msg-time, .live-msg.patient .msg-time  { text-align: right; color: rgba(255, 255, 255, 0.85); }

/* Footer & Input */
.teleconsult-footer {
  background: #FFFFFF;
  padding: 16px 20px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.teleconsult-input {
  flex: 1;
  background: #F1F5F9;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  color: #0F172A !important;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}
.teleconsult-input:focus {
  background: #FFFFFF;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.teleconsult-input::placeholder {
  color: #94A3B8;
}

/* ══════════════════════════════════════════════
   INPUT DE CÓDIGO DE ACCESO (ALTO CONTRASTE)
══════════════════════════════════════════════ */
.premium-code-box {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.premium-code-box:focus-within {
  border-color: #3B82F6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25), 0 8px 24px rgba(0, 0, 0, 0.1);
}

.premium-code-input {
  font-family: 'Rajdhani', monospace, sans-serif !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  letter-spacing: 4px !important;
  text-transform: uppercase !important;
  text-align: center !important;
  background: transparent !important;
  border: none !important;
  color: #0F172A !important; /* TEXTO OSCURO NÍTIDO */
  outline: none !important;
  width: 100% !important;
  padding: 10px 4px !important;
}

.premium-code-input::placeholder {
  color: #CBD5E1 !important;
  font-weight: 500 !important;
  letter-spacing: 2px !important;
}

@media (max-width: 768px) {
  .teleconsult-modal-box {
    width: 100%;
    height: 92vh;
    border-radius: 20px;
  }
  .live-msg { max-width: 88%; font-size: 13px; }
  .premium-code-input { font-size: 20px !important; letter-spacing: 2px !important; }
}
