/**
 * ════════════════════════════════════════════════════════════
 * ESTILOS POPUP MENSAJES - VISTA USUARIO
 * Diseño moderno, limpio y profesional
 * ════════════════════════════════════════════════════════════
 */

/* ════════════════════════════════════════════════════════════
   OVERLAY (Fondo oscuro)
   ════════════════════════════════════════════════════════════ */
#popupOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

/* ════════════════════════════════════════════════════════════
   MODAL (Contenedor principal)
   ════════════════════════════════════════════════════════════ */
#popupOverlay .popup-modal {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
}

/* ════════════════════════════════════════════════════════════
   HEADER (Encabezado)
   ════════════════════════════════════════════════════════════ */
#popupOverlay .popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    position: relative;
    border-radius: 20px 20px 0 0;
}

#popupOverlay .popup-header h3 {
    margin: 0;
    color: white;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Botón cerrar (X) */
#popupOverlay .popup-header .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

#popupOverlay .popup-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
}

/* ════════════════════════════════════════════════════════════
   BODY (Contenido del mensaje)
   ════════════════════════════════════════════════════════════ */
#popupOverlay .popup-body {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
    background: white;
}

/* Scrollbar personalizado */
#popupOverlay .popup-body::-webkit-scrollbar {
    width: 8px;
}

#popupOverlay .popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#popupOverlay .popup-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

#popupOverlay .popup-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Estilos del contenido HTML */
#popupOverlay .popup-body h1,
#popupOverlay .popup-body h2,
#popupOverlay .popup-body h3 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.3;
}

#popupOverlay .popup-body p {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

#popupOverlay .popup-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

#popupOverlay .popup-body strong,
#popupOverlay .popup-body b {
    color: #2d3748;
    font-weight: 600;
}

#popupOverlay .popup-body a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

#popupOverlay .popup-body a:hover {
    color: #764ba2;
    text-decoration: underline;
}

#popupOverlay .popup-body ul,
#popupOverlay .popup-body ol {
    margin: 15px 0;
    padding-left: 25px;
    color: #4a5568;
}

#popupOverlay .popup-body li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ════════════════════════════════════════════════════════════
   FOOTER (Botones de acción)
   ════════════════════════════════════════════════════════════ */
#popupOverlay .popup-footer {
    padding: 25px 40px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Botón contactar sede */
#popupOverlay .popup-footer .btn-contacto {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

#popupOverlay .popup-footer .btn-contacto:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

#popupOverlay .popup-footer .btn-contacto:active {
    transform: translateY(0);
}

/* Botón cerrar */
#popupOverlay .popup-footer .btn-cerrar {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#popupOverlay .popup-footer .btn-cerrar:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

/* ════════════════════════════════════════════════════════════
   ANIMACIONES
   ════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* Animación de salida */
#popupOverlay.closing {
    animation: fadeOut 0.3s ease;
}

#popupOverlay.closing .popup-modal {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE (Mobile)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #popupOverlay {
        padding: 10px;
    }
    
    #popupOverlay .popup-modal {
        max-height: 90vh;
        border-radius: 15px;
    }
    
    #popupOverlay .popup-header {
        padding: 25px 20px;
    }
    
    #popupOverlay .popup-header h3 {
        font-size: 22px;
        padding-right: 40px;
    }
    
    #popupOverlay .popup-body {
        padding: 25px 20px;
    }
    
    #popupOverlay .popup-body p {
        font-size: 15px;
    }
    
    #popupOverlay .popup-footer {
        padding: 20px;
        flex-direction: column;
    }
    
    #popupOverlay .popup-footer .btn-contacto,
    #popupOverlay .popup-footer .btn-cerrar {
        width: 100%;
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════
   ESTILOS ESPECIALES PARA CONTENIDO
   ════════════════════════════════════════════════════════════ */

/* Destacados/Alertas */
#popupOverlay .popup-body .alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid;
}

#popupOverlay .popup-body .alert-info {
    background: #e6f7ff;
    border-color: #1890ff;
    color: #0050b3;
}

#popupOverlay .popup-body .alert-success {
    background: #f6ffed;
    border-color: #52c41a;
    color: #237804;
}

#popupOverlay .popup-body .alert-warning {
    background: #fffbe6;
    border-color: #faad14;
    color: #ad6800;
}

/* Tablas */
#popupOverlay .popup-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#popupOverlay .popup-body table th,
#popupOverlay .popup-body table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

#popupOverlay .popup-body table th {
    background: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

/* Código */
#popupOverlay .popup-body code {
    background: #f7fafc;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #e53e3e;
    font-size: 14px;
}

#popupOverlay .popup-body pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
}

#popupOverlay .popup-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ════════════════════════════════════════════════════════════
   FIN DE ESTILOS
   ════════════════════════════════════════════════════════════ */
