/* ============================================
   DOCUMENTAL INTERACTIVO CICTAEC - FINAL
   ============================================ */

.docu-section {
    padding: 60px 20px;
    background: #f4f6f9;
    display: flex;
    justify-content: center;
}

.docu-container {
    width: 100%;
    max-width: 1400px;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Video 2 partes, Sidebar 1 parte */
    gap: 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 20px;
}

/* --- VIDEO AREA --- */
.docu-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9; 
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.docu-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(1.1) contrast(1.05);
}

/* Hotspots */
.hotspot-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; 
    z-index: 10;
}

.docu-hotspot {
    position: absolute;
    width: 14px; 
    height: 14px;
    background: #FFD700;
    border: 1.5px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(0); /* Empieza invisible (escala 0) */
    animation: none; /* Sin animación hasta que aparezca */
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Efecto rebote */
    opacity: 0;
}

/* Cuando el hotspot está visible */
.docu-hotspot.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: pulse-gold 2s infinite;
}

.docu-hotspot:hover { 
    transform: translate(-50%, -50%) scale(1.4); 
}

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* Controles video */
.video-controls-overlay {
    position: absolute;
    bottom: 20px; left: 20px;
    display: flex; gap: 10px;
    opacity: 0; transition: opacity 0.3s;
}
.docu-video-wrapper:hover .video-controls-overlay { opacity: 1; }
.control-btn {
    background: rgba(0,0,0,0.6); color: #fff; border: none;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    font-size: 1.2rem; backdrop-filter: blur(5px);
}

/* --- SIDEBAR & MAPA ABSTRACTO --- */
.docu-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
}

.map-container {
    background: #0f2b4d;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: #fff;
    position: relative;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.region-title {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ✅ CSS CRÍTICO PARA EL MAPA ABSTRACTO */
/* === MAPA ABSTRACTO CON FORMAS SEPARADAS === */
.ecuador-map {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.map-region {
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1px;
    transition: all 0.5s ease;
}

.map-region.active {
    fill: #FFD700 !important;
    stroke: #FFFFFF !important;
    stroke-width: 2px !important;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.7));
}

.group-islands.active circle {
    fill: #FFD700 !important;
    stroke: #fff !important;
}

.region-info {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    padding: 0 10px;
}

.progress-bar-docu {
    height: 4px; background: #eee; border-radius: 2px; margin-top: 15px; overflow: hidden;
}
.progress-fill {
    height: 100%; background: #FFD700; width: 0%; transition: width 0.3s;
}

.nav-buttons {
    display: grid; 
    grid-template-columns: repeat(4, 1fr); /* 4 botones alineados */
    gap: 8px;
    width: 100%;
}

.nav-btn {
    background: #fff; border: 1px solid #ddd; padding: 10px;
    border-radius: 8px; font-size: 0.75rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s; color: #333;
}
.nav-btn:hover, .nav-btn.active-region {
    background: #0f2b4d; color: #FFD700; border-color: #0f2b4d;
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.3s;
    backdrop-filter: blur(5px);
}
.modal-overlay.visible { opacity: 1; visibility: visible; }

.modal-content {
    background: #fff; width: 90%; max-width: 600px;
    border-radius: 16px; overflow: hidden;
    transform: translateY(20px); transition: transform 0.3s;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    position: relative;
}
.modal-overlay.visible .modal-content { transform: translateY(0); }

.modal-image-container {
    background: #f0f0f0;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-image { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    display: block;
}
.modal-text { padding: 30px; display: flex; flex-direction: column; justify-content: center; }
.modal-text h3 { margin: 0 0 10px 0; color: #0f2b4d; font-size: 1.5rem; }
.modal-text p { margin: 0; color: #666; line-height: 1.6; font-size: 0.95rem; }

.modal-close {
    position: absolute;
    top: 15px; right: 15px;
    z-index: 2050;
    background: #fff;
    color: #0f2b4d;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    pointer-events: auto;
}
.modal-close:hover { 
    background: #FFD700; 
    color: #0f2b4d; 
    transform: rotate(90deg); 
}

/* Audio Toggle */
.audio-toggle-btn {
    position: absolute;
    bottom: 20px; right: 20px;
    z-index: 15;
    background: rgba(15, 43, 77, 0.9);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: #fff;
    padding: 10px 18px;
    border-radius: 50px;
    cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}
.audio-toggle-btn svg { width: 18px; height: 18px; fill: currentColor; }
.audio-toggle-btn .icon-sound-on { display: none; }
.audio-toggle-btn.playing .icon-sound-off { display: none; }
.audio-toggle-btn.playing .icon-sound-on { display: block; }
.audio-toggle-btn.playing {
    background: #FFD700; color: #0f2b4d;
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}
.audio-toggle-btn:hover { transform: translateY(-2px); }

@media (max-width: 900px) {
    .docu-container { grid-template-columns: 1fr; }
    .modal-image-container { height: 200px; }
    .audio-toggle-btn { bottom: auto; top: 15px; right: 15px; padding: 8px 14px; font-size: 0.65rem; }
}
/* === TÍTULOS FLASH === */
/* === TÍTULOS FLASH (COMPACTOS) === */
.flash-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.flash-title {
    position: absolute;
    background: rgba(15, 43, 77, 0.95);
    color: #FFD700;
    padding: 8px 14px; /* Mucho más pequeño */
    border-radius: 6px;
    border: 1.5px solid #FFD700;
    text-align: left;
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 180px; /* Ancho máximo reducido */
    pointer-events: auto; /* Permite clics si hace falta */
    cursor: pointer;
  
    box-sizing: border-box; /* Añade esto para que el padding no rompa el ancho */
    white-space: normal;    /* Permite que el texto baje de línea si es muy largo */
}


.flash-title.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.flash-title h3 {
    margin: 0 0 3px 0;
    font-size: 0.85rem; /* Texto pequeño */
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
}

.flash-title p {
    margin: 0;
    font-size: 0.7rem; /* Descripción aún más pequeña */
    color: #fff;
    line-height: 1.3;
}