/* base.css */
:root{
    --gris_fora: #20232C;
    --fondo_tabla: #ffffff;
    --cruz-roja-red: #E4002B;
    --cruz-roja-red-hover: #B8001F;
    --cruz-roja-red-light: #FF6B8A;
    --cruz-roja-gray: #6C757D;
    --cruz-roja-gray-light: #F8F9FA;
}

@font-face {
    font-family: 'Poppins';
    src: url('fonts/Poppins-Regular.ttf');
}

/* Reset básico */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

::-webkit-scrollbar {
    width: 8px;
    background-color: #888;
}
::-webkit-scrollbar-thumb {
    background-color:var(--gris_fora); 
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover {
    background-color: var(--gris_fora);
}


body {
    color: var(--gris_fora);
    font-family: 'Poppins', sans-serif;
    background-image: url('../../static/img/fondo_green_metrics.jpg');
    background-size: cover; 
    background-position: center;
    background-repeat: no-repeat;
    
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Botón de envío */
.btn-submit {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-submit:hover {
    background-color: #45a049;
}

/* Mensajes de alerta */
.flash-messages {
    margin-top: 15px;
}

.flash {
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 5px;
    text-align: center;
}

.flash.success {
    background-color: #d4edda;
    color: #155724;
}

.flash.danger {
    background-color: #f8d7da;
    color: #721c24;
}

.flash.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.superior {
    width: 100%;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid rgba(245, 51, 63, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.superior a{
    text-decoration: none;
}

.superior a:hover{
    text-decoration: none;
}

.tituloSuperior{
    color: whitesmoke;
    font-weight: bold;
    font-size: 38px;
    margin-left: 40px;
}

.subtituloSuperior{
    color: whitesmoke;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: -25px;
}

.logotipoSuperior{
    width: 150px;
}

#enlaceSuperior{
    display: flex;
    align-items: center;
}

/* Nav links in visor header */
.nav-links-visor {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link-visor {
    text-decoration: none;
    color: #718096;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-link-visor::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #f5333f;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-visor:hover {
    color: #f5333f;
    text-decoration: none;
}

.nav-link-visor:hover::after {
    width: 100%;
}

.nav-link-visor.active {
    color: #011e41;
    font-weight: 700;
}

.nav-link-visor.active::after {
    width: 100%;
    background: #011e41;
}

/* Overlay para el botón de opciones del visor (superpuesto sobre la navbar) */
.visor-info-overlay {
    position: fixed;
    top: 0;
    right: 1.5rem;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10001;
}

/* Botón de mensaje mejorado */
#messageButton {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    cursor: pointer;
    border: 2px solid #fff;
    background-color: var(--cruz-roja-red);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

#messageButton svg {
    width: 24px;
    height: 24px;
}

#messageButton:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.3);
    background-color: var(--cruz-roja-red-hover);
}

/* ====== MODAL COMENTARIOS - CLASES ÚNICAS ====== */

.modal-overlay-comentarios {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay-comentarios.show {
    opacity: 1;
    visibility: visible;
}

.modal-content-comentarios {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay-comentarios.show .modal-content-comentarios {
    transform: scale(1);
}

.modal-header-comentarios {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background-color: var(--cruz-roja-gray-light);
}

.modal-header-comentarios h3 {
    margin: 0;
    color: var(--cruz-roja-red);
    font-size: 1.4rem;
    font-weight: 600;
}

.close-button-comentarios {
    background: none;
    border: none;
    color: var(--cruz-roja-gray);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button-comentarios:hover {
    background-color: var(--cruz-roja-red);
    color: white;
}

.close-button-comentarios svg {
    width: 20px;
    height: 20px;
}

.modal-body-comentarios {
    padding: 25px;
}

.form-group-comentarios {
    margin-bottom: 20px;
}

.form-group-comentarios label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gris_fora);
    font-size: 0.95rem;
}

.form-group-comentarios textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group-comentarios textarea:focus {
    outline: none;
    border-color: var(--cruz-roja-red);
    box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.1);
}

.form-group-comentarios textarea::placeholder {
    color: var(--cruz-roja-gray);
}

.character-counter-comentarios {
    text-align: right;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--cruz-roja-gray);
}

.form-actions-comentarios {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-primary-comentarios,
.btn-secondary-comentarios {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-comentarios {
    background-color: var(--cruz-roja-red);
    color: white;
}

.btn-primary-comentarios:hover {
    background-color: var(--cruz-roja-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.3);
}

.btn-primary-comentarios:disabled {
    background-color: var(--cruz-roja-gray);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary-comentarios {
    background-color: transparent;
    color: var(--cruz-roja-gray);
    border: 2px solid var(--cruz-roja-gray);
}

.btn-secondary-comentarios:hover {
    background-color: var(--cruz-roja-gray);
    color: white;
}

.btn-primary-comentarios svg,
.btn-secondary-comentarios svg {
    width: 16px;
    height: 16px;
}

/* Notificaciones comentarios */
.notification-comentarios {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification-comentarios.show {
    transform: translateX(0);
}

.notification-comentarios.success {
    background-color: #28a745;
}

.notification-comentarios.error {
    background-color: var(--cruz-roja-red);
}

.notification-comentarios.info {
    background-color: #17a2b8;
}

/* Responsive comentarios */
@media (max-width: 768px) {
    .modal-content-comentarios {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header-comentarios,
    .modal-body-comentarios {
        padding: 15px;
    }
    
    .form-actions-comentarios {
        flex-direction: column;
    }
    
    .btn-primary-comentarios,
    .btn-secondary-comentarios {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .superior {
        padding: 0 15px;
    }
    
    .superior a {
        margin-left: 0;
    }
    
    .logotipoSuperior {
        width: 150px;
    }
    
    #messageButton {
        width: 45px;
        height: 45px;
    }
    
    #messageButton svg {
        width: 20px;
        height: 20px;
    }
}
/* Estilos específicos para el modal de descripción con colores de Cruz Roja - MEJORADO */
.modal-descripcion {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: modalBackgroundFadeIn 0.4s ease;
}

.modal-descripcion-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    margin: 3% auto;
    padding: 0;
    border: none;
    width: 92%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Efectos de partículas decorativas */
.modal-descripcion-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--cruz-roja-red) 0%, 
        var(--cruz-roja-red-hover) 50%, 
        var(--cruz-roja-red) 100%);
    border-radius: 20px 20px 0 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9) rotateX(15deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
    }
}

.modal-descripcion-header {
    background: linear-gradient(135deg, var(--cruz-roja-red) 0%, var(--cruz-roja-red-hover) 100%);
    color: white;
    padding: 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 
        0 4px 20px rgba(228, 0, 43, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo animado en el header */
.modal-descripcion-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.modal-descripcion-title-container {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1;
}

.modal-descripcion-title-container img {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.modal-descripcion-title-container img:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(5deg);
}

.modal-descripcion-title-container h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.close-modal-descripcion {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 1;
}

.close-modal-descripcion:hover,
.close-modal-descripcion:focus {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.modal-descripcion-body {
    padding: 40px;
    line-height: 1.7;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    overflow-y: auto;
    flex: 1;
    position: relative;
}

/* Estilos personalizados para el scroll del body - MEJORADO */
.modal-descripcion-body::-webkit-scrollbar {
    width: 12px;
}

.modal-descripcion-body::-webkit-scrollbar-track {
    background: linear-gradient(135deg, #f1f1f1 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-descripcion-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--cruz-roja-red) 0%, var(--cruz-roja-red-hover) 100%);
    border-radius: 10px;
    border: 2px solid #f1f1f1;
    box-shadow: 0 2px 10px rgba(228, 0, 43, 0.3);
}

.modal-descripcion-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--cruz-roja-red-hover) 0%, #9a0015 100%);
    transform: scale(1.1);
}

.descripcion-texto {
    font-size: 17px;
    color: var(--gris_fora);
    margin-bottom: 30px;
    position: relative;
}

.descripcion-texto p {
    margin: 0 0 20px 0;
    text-align: justify;
    line-height: 1.7;
    position: relative;
    padding-left: 20px;
}

.descripcion-texto p::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    background: var(--cruz-roja-red);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(228, 0, 43, 0.5);
}

.descripcion-objetivos {
    background: linear-gradient(135deg, #ffffff 0%, var(--cruz-roja-gray-light) 100%);
    border: none;
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(228, 0, 43, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.descripcion-objetivos::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--cruz-roja-red) 0%, 
        var(--cruz-roja-red-hover) 50%, 
        var(--cruz-roja-red) 100%);
    border-radius: 16px 16px 0 0;
}

.descripcion-objetivos h4 {
    color: var(--cruz-roja-red);
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.descripcion-objetivos h4::before {
    content: "🎯";
    font-size: 24px;
    padding: 8px;
    background: linear-gradient(135deg, var(--cruz-roja-red) 0%, var(--cruz-roja-red-hover) 100%);
    border-radius: 12px;
    filter: drop-shadow(0 4px 8px rgba(228, 0, 43, 0.3));
}

.descripcion-objetivos ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.descripcion-objetivos li {
    margin-bottom: 16px;
    color: var(--gris_fora);
    position: relative;
    padding: 12px 0 12px 50px;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, transparent 0%, rgba(228, 0, 43, 0.02) 100%);
}

.descripcion-objetivos li:hover {
    background: linear-gradient(135deg, rgba(228, 0, 43, 0.05) 0%, rgba(228, 0, 43, 0.1) 100%);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(228, 0, 43, 0.1);
}

.descripcion-objetivos li::before {
    content: "✓";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    background: linear-gradient(135deg, var(--cruz-roja-red) 0%, var(--cruz-roja-red-hover) 100%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(228, 0, 43, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
}

/* Efecto adicional al abrir el modal */
.modal-descripcion.show {
    animation: modalBackgroundFadeIn 0.4s ease;
}

@keyframes modalBackgroundFadeIn {
    from {
        background-color: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
    to {
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(5px);
    }
}

/* Responsive para modal de descripción - MEJORADO */
@media (max-width: 768px) {
    .modal-descripcion-content {
        width: 95%;
        max-height: 90vh;
        margin: 5% auto;
        border-radius: 16px;
    }
    
    .modal-descripcion-header {
        padding: 25px;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-descripcion-title-container h2 {
        font-size: 22px;
    }
    
    .modal-descripcion-title-container img {
        width: 40px;
        height: 40px;
    }
    
    .modal-descripcion-body {
        padding: 30px;
    }
    
    .descripcion-objetivos {
        padding: 25px;
        margin: 25px 0;
        border-radius: 12px;
    }
    
    .descripcion-objetivos h4 {
        font-size: 18px;
    }
    
    .descripcion-objetivos li {
        padding: 10px 0 10px 40px;
    }
}

@media (max-width: 480px) {
    .modal-descripcion-content {
        width: 96%;
        max-height: 85vh;
        margin: 7.5% auto;
        border-radius: 12px;
    }
    
    .modal-descripcion-header {
        padding: 20px;
        border-radius: 12px 12px 0 0;
    }
    
    .modal-descripcion-title-container {
        gap: 15px;
    }
    
    .modal-descripcion-title-container img {
        width: 35px;
        height: 35px;
    }
    
    .modal-descripcion-title-container h2 {
        font-size: 20px;
    }
    
    .modal-descripcion-body {
        padding: 25px;
    }
    
    .descripcion-objetivos {
        padding: 20px;
        margin: 20px 0;
        border-radius: 10px;
    }
    
    .descripcion-objetivos h4 {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .descripcion-objetivos li {
        padding: 8px 0 8px 35px;
        font-size: 14px;
    }
    
    .descripcion-objetivos li::before {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .descripcion-texto {
        font-size: 15px;
    }
    
    .close-modal-descripcion {
        padding: 10px;
        font-size: 20px;
    }
}

/* Mejoras adicionales para muy poco espacio vertical */
@media (max-height: 600px) {
    .modal-descripcion-content {
        max-height: 95vh;
        margin: 2.5% auto;
    }
    
    .modal-descripcion-header {
        padding: 20px 30px;
    }
    
    .modal-descripcion-title-container h2 {
        font-size: 22px;
    }
    
    .modal-descripcion-body {
        padding: 25px 30px;
    }
    
    .descripcion-objetivos {
        padding: 20px;
        margin: 20px 0;
    }
}

/* Animaciones adicionales para mejor UX */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.descripcion-texto p {
    animation: fadeInUp 0.6s ease forwards;
}

.descripcion-objetivos {
    animation: fadeInUp 0.8s ease forwards;
}

.descripcion-objetivos li {
    animation: fadeInUp 0.4s ease forwards;
}

.descripcion-objetivos li:nth-child(1) { animation-delay: 0.1s; }
.descripcion-objetivos li:nth-child(2) { animation-delay: 0.2s; }
.descripcion-objetivos li:nth-child(3) { animation-delay: 0.3s; }
.descripcion-objetivos li:nth-child(4) { animation-delay: 0.4s; }
.descripcion-objetivos li:nth-child(5) { animation-delay: 0.5s; }
.descripcion-objetivos li:nth-child(6) { animation-delay: 0.6s; }

/* Micro-interacciones adicionales */
.modal-descripcion-content:hover {
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal-descripcion-title-container h2 {
    transition: all 0.3s ease;
}

.modal-descripcion-title-container:hover h2 {
    transform: translateY(-2px);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

/* Título interactivo - Versión simplificada y sin conflictos */
.titulo-interactivo {
    position: relative;
    cursor: pointer;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    display: block;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    user-select: none;
    z-index: 1;
}

/* Línea decorativa inferior que aparece al hover */
.titulo-interactivo::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cruz-roja-red), var(--cruz-roja-red-hover));
    transition: width 0.4s ease;
}

.titulo-interactivo:hover::before {
    width: 100%;
}

/* Efecto de color al hover */
.titulo-interactivo:hover {
    color: var(--cruz-roja-red);
    text-shadow: 0 0 8px rgba(228, 0, 43, 0.3);
}

.titulo-interactivo:active {
    color: var(--cruz-roja-red-hover);
}

/* Tooltip rediseñado - más discreto */
.titulo-tooltip {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(1, 30, 65, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

.titulo-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(1, 30, 65, 0.95);
}

.titulo-interactivo:hover .titulo-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: -40px;
}

/* Pequeño punto indicador - muy discreto */
.titulo-interactivo::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -12px;
    width: 4px;
    height: 4px;
    background: var(--cruz-roja-red);
    border-radius: 50%;
    transform: translateY(-50%);
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.titulo-interactivo:hover::after {
    opacity: 0;
}

/* Responsive para el título interactivo */
@media (max-width: 768px) {
    .titulo-tooltip {
        font-size: 10px;
        padding: 5px 10px;
        bottom: -30px;
    }
    
    .titulo-interactivo:hover .titulo-tooltip {
        bottom: -35px;
    }
    
    .titulo-interactivo::after {
        right: -10px;
        width: 3px;
        height: 3px;
    }
}

@media (max-width: 480px) {
    .titulo-tooltip {
        font-size: 9px;
        padding: 4px 8px;
        bottom: -25px;
    }
    
    .titulo-interactivo:hover .titulo-tooltip {
        bottom: -30px;
    }
    
    .titulo-interactivo::after {
        right: -8px;
        width: 3px;
        height: 3px;
    }
}

/* Mejorar la accesibilidad */
.titulo-interactivo:focus {
    outline: 2px solid var(--cruz-roja-red);
    outline-offset: 2px;
    border-radius: 4px;
}

.titulo-interactivo:focus:not(:focus-visible) {
    outline: none;
}

/* Eliminar todos los estilos conflictivos que estaban causando problemas */
.titulo-interactivo {
    /* Resetear cualquier padding, margin o posicionamiento problemático */
    padding: 0 !important;
    margin: 0 !important;
    /* Asegurar que el título mantenga su comportamiento normal */
    position: relative !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    /* Eliminar cualquier transformación que pueda causar problemas */
    transform: none !important;
    /* Asegurar que el z-index no cause problemas */
    z-index: auto !important;
}

/* Eliminar cualquier efecto de fondo que pueda estar causando problemas */
.titulo-interactivo:hover {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}
/* Botón de opciones del visor — integrado visualmente en la navbar */
#infoButton {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: transparent;
    color: #718096;
    cursor: pointer;
    transition: all 0.25s ease;
}

#infoButton svg {
    width: 20px;
    height: 20px;
}

#infoButton:hover {
    background: #f5f5f5;
    color: #f5333f;
    border-color: rgba(245, 51, 63, 0.3);
}

/* Dropdown de ayuda */
.info-dropdown {
    position: fixed;
    top: 72px;
    right: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
    padding: 8px 0;
    min-width: 180px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-dropdown.oculto {
    display: none;
}

.info-dropdown-item {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    font-size: 1rem;
    color: #222;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.info-dropdown-item:hover {
    background: #ffe5ea;
    color: var(--cruz-roja-red);
}
.info-dropdown-item[data-action="comentario"] {
    border-top: 1px solid #eee;
    margin-top: 4px;
}


.modal-overlay-ayuda {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay-ayuda.show {
    opacity: 1;
    visibility: visible;
}

.modal-content-ayuda {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    height: auto;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-overlay-ayuda.show .modal-content-ayuda {
    transform: scale(1);
}

.modal-header-ayuda {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, var(--cruz-roja-red) 0%, var(--cruz-roja-red-hover) 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.modal-header-ayuda h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-button-ayuda {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.close-button-ayuda:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1) rotate(90deg);
}

.close-button-ayuda svg {
    width: 20px;
    height: 20px;
}

/* Pestañas de idioma */
.language-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.language-tab {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--cruz-roja-gray);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.language-tab:hover {
    background: rgba(228, 0, 43, 0.05);
    color: var(--cruz-roja-red);
}

.language-tab.active {
    background: var(--cruz-roja-red);
    color: white;
    font-weight: 600;
}

.language-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cruz-roja-red-hover);
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

/* Contenedor del cuerpo del modal - COMPLETAMENTE RESPONSIVE */
.modal-body-ayuda {
    padding: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    min-height: 0; /* Importante para flex */
}

/* Contenedor de video - TOTALMENTE RESPONSIVE */
.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Establecer aspect ratio para mantener proporciones */
    aspect-ratio: 16/9; /* Ratio típico de video */
    max-height: calc(100vh - 200px); /* Reservar espacio para header y tabs */
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mantiene proporciones sin recortar */
    border-radius: 0;
    outline: none;
    background: #000;
}

/* Contenedor PDF - RESPONSIVE */
.pdf-container {
    width: 100%;
    height: calc(100vh - 200px); /* Altura dinámica */
    min-height: 400px;
    max-height: 800px;
    background: #fff;
    border-radius: 0 0 16px 16px;
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0 0 16px 16px;
}

/* Indicador de carga */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.1rem;
    display: none;
    z-index: 2;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
}

.loading-indicator.show {
    display: block;
}

/* Animaciones para el cambio de video */
.video-container.changing {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* RESPONSIVE MEJORADO */

/* Pantallas grandes (escritorio) */
@media (min-width: 1200px) {
    .modal-content-ayuda {
        width: 80%;
        max-width: 1200px;
    }
    
    .video-container {
        max-height: calc(100vh - 180px);
    }
}

/* Pantallas medianas (laptop/tablet horizontal) */
@media (max-width: 1199px) and (min-width: 769px) {
    .modal-overlay-ayuda {
        padding: 15px;
    }
    
    .modal-content-ayuda {
        width: 90%;
        max-height: calc(100vh - 30px);
    }
    
    .modal-header-ayuda {
        padding: 15px 25px;
    }
    
    .modal-header-ayuda h3 {
        font-size: 1.3rem;
    }
    
    .language-tab {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .flag-icon {
        width: 18px;
        height: 14px;
    }
    
    .video-container {
        max-height: calc(100vh - 160px);
    }
    
    .pdf-container {
        height: calc(100vh - 160px);
        min-height: 350px;
    }
}

/* Tablets y móviles en horizontal */
@media (max-width: 768px) {
    .modal-overlay-ayuda {
        padding: 10px;
    }
    
    .modal-content-ayuda {
        width: 95%;
        max-height: calc(100vh - 20px);
        border-radius: 12px;
    }
    
    .modal-header-ayuda {
        padding: 15px 20px;
        border-radius: 12px 12px 0 0;
    }
    
    .modal-header-ayuda h3 {
        font-size: 1.2rem;
    }
    
    .close-button-ayuda {
        width: 35px;
        height: 35px;
    }
    
    .close-button-ayuda svg {
        width: 18px;
        height: 18px;
    }
    
    .language-tab {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .flag-icon {
        width: 16px;
        height: 12px;
    }
    
    .video-container {
        max-height: calc(100vh - 140px);
        aspect-ratio: 16/9;
    }
    
    .pdf-container {
        height: calc(100vh - 140px);
        min-height: 300px;
    }
}

/* Móviles en vertical */
@media (max-width: 480px) {
    .modal-overlay-ayuda {
        padding: 5px;
    }
    
    .modal-content-ayuda {
        width: 98%;
        max-height: calc(100vh - 10px);
        border-radius: 8px;
    }
    
    .modal-header-ayuda {
        padding: 12px 15px;
        border-radius: 8px 8px 0 0;
    }
    
    .modal-header-ayuda h3 {
        font-size: 1.1rem;
    }
    
    .close-button-ayuda {
        width: 30px;
        height: 30px;
    }
    
    .close-button-ayuda svg {
        width: 16px;
        height: 16px;
    }
    
    .language-tab {
        padding: 8px 10px;
        font-size: 0.8rem;
        flex-direction: column;
        gap: 4px;
    }
    
    .flag-icon {
        width: 14px;
        height: 10px;
    }
    
    .video-container {
        max-height: calc(100vh - 120px);
        aspect-ratio: 16/9;
    }
    
    .pdf-container {
        height: calc(100vh - 120px);
        min-height: 250px;
    }
}

/* Pantallas muy pequeñas */
@media (max-width: 360px) {
    .modal-overlay-ayuda {
        padding: 0;
    }
    
    .modal-content-ayuda {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header-ayuda {
        border-radius: 0;
        padding: 10px 15px;
    }
    
    .modal-header-ayuda h3 {
        font-size: 1rem;
    }
    
    .video-container {
        max-height: calc(100vh - 100px);
        aspect-ratio: 16/9;
    }
    
    .pdf-container {
        border-radius: 0;
        height: calc(100vh - 100px);
        min-height: 200px;
    }
    
    .pdf-container iframe {
        border-radius: 0;
    }
}

/* Ajustes especiales para pantallas con poca altura */
@media (max-height: 600px) {
    .modal-content-ayuda {
        max-height: 95vh;
    }
    
    .modal-header-ayuda {
        padding: 10px 20px;
    }
    
    .modal-header-ayuda h3 {
        font-size: 1.2rem;
    }
    
    .language-tab {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .video-container {
        max-height: calc(95vh - 120px);
        min-height: 200px;
    }
    
    .pdf-container {
        height: calc(95vh - 120px);
        min-height: 200px;
    }
}

/* Ajustes para orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-overlay-ayuda {
        padding: 5px;
    }
    
    .modal-content-ayuda {
        max-height: calc(100vh - 10px);
    }
    
    .modal-header-ayuda {
        padding: 8px 15px;
    }
    
    .modal-header-ayuda h3 {
        font-size: 1rem;
    }
    
    .language-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .video-container {
        max-height: calc(100vh - 80px);
        min-height: 150px;
    }
    
    .pdf-container {
        height: calc(100vh - 80px);
        min-height: 150px;
    }
}
/* Selector de idioma global */
.language-selector-nav {
    position: relative;
    margin-left: 20px;
    z-index: 12050;
}

.current-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border: 2px solid #E4002B;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    color: #E4002B;
    font-size: 1rem;
}

.current-lang:hover {
    background: #E4002B;
    color: white;
}

.lang-flag {
    font-size: 1.2em;
}

.lang-code {
    font-size: 0.9em;
    font-weight: 700;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 190px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 12060;
    padding: 0;
}

/* Evita recorte del dropdown en el header del visor */
.navbar,
.nav-container,
.nav-menu,
.user-menu {
    overflow: visible;
}

.language-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid #f0f0f0;
    background: none;
    font-size: 1rem;
}

.lang-option:first-child {
    border-radius: 12px 12px 0 0;
}

.lang-option:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.lang-option:hover {
    background: #ffe5ea;
    color: #E4002B;
    padding-left: 22px;
}

.lang-name {
    font-weight: 500;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .language-selector-nav {
        margin-left: 10px;
    }
    .current-lang {
        padding: 6px 12px;
        font-size: 0.95rem;
    }
    .lang-code {
        display: none;
    }
    .language-dropdown {
        min-width: 120px;
    }
}

/* Selector deshabilitado (modo producción) */
.language-selector-disabled .current-lang {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Badges de idioma en el dropdown */
.lang-option .li-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    font-size: 1.15em;
    line-height: 1;
    flex-shrink: 0;
}

.lang-option .li-abbr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    background: #E4002B;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
