/* digital-news-popup.css - VERSION PARA CONTENIDO INFORMATIVO */

/* Overlay del popup */
.digital-news-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(26, 58, 90, 0.7));
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: fadeInNewsOverlay 0.3s ease-out;
}

@keyframes fadeInNewsOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.digital-news-popup-overlay.active {
    display: flex;
}

/* Container principal del popup - Más grande para contenido informativo */
.digital-news-popup-container {
    background: linear-gradient(145deg, #ffffff, #f8f9ff);
    border-radius: 24px;
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0) translateZ(0);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.digital-news-popup-overlay.active .digital-news-popup-container {
    transform: scale(1) translateZ(0);
    opacity: 1;
}

/* Header del popup con título dinámico */
.digital-news-popup-header {
    position: relative;
    padding: 30px 30px 20px;
    background: linear-gradient(135deg, #319795, #2c7a7b);
    color: white;
    text-align: center;
}

.digital-news-popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="newsgrain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23newsgrain)"/></svg>');
    opacity: 0.3;
}

.digital-news-popup-title {
    font-size: 30px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
    color: #ffffff !important;
}

.digital-news-popup-subtitle {
    font-size: 15px;
    opacity: 0.9;
    margin: 10px 0 0 0;
    font-weight: 400;
    position: relative;
    z-index: 2;
    line-height: 1.4;
}

/* Botón de cerrar mejorado */
.digital-news-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    font-weight: 300;
    backdrop-filter: blur(10px);
}

.digital-news-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.digital-news-popup-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Contenido del popup - Optimizado para multimedia */
.digital-news-popup-content {
    padding: 35px 40px 40px;
    overflow-y: auto;
    max-height: 70vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
    transform: translateZ(0);
    will-change: opacity, transform;
    backface-visibility: hidden;
    line-height: 1.6;
    font-size: 16px;
    color: #2d3748;
}

/* Estilos para contenido HTML/texto */
.digital-news-popup-content h1,
.digital-news-popup-content h2,
.digital-news-popup-content h3 {
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

.digital-news-popup-content p {
    margin-bottom: 15px;
    color: #4a5568;
}

.digital-news-popup-content a {
    color: #319795;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.digital-news-popup-content a:hover {
    color: #2c7a7b;
    text-decoration: underline;
}

/* Estilos para videos responsivos */
.video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Estilos para iframe responsivo */
.iframe-responsive {
    position: relative;
    width: 100%;
    height: 500px;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.iframe-responsive iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Galería de imágenes */
.popup-galeria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.popup-galeria-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.popup-galeria-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.popup-galeria-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.popup-galeria-item img:hover {
    transform: scale(1.05);
}

.popup-galeria-item img.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 9999999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    object-fit: contain;
}

.popup-galeria-item img.expanded::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: -1;
}

/* Loading animation mejorada */
.digital-news-popup-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 40px;
    text-align: center;
}

.digital-news-popup-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #319795;
    border-radius: 50%;
    animation: newsSpinLoader 1s linear infinite;
    margin-bottom: 25px;
}

.digital-news-popup-loading p {
    color: #4a5568;
    font-weight: 500;
    font-size: 16px;
    margin: 0;
}

@keyframes newsSpinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Efecto ripple/huella digital para news */
.digital-news-popup-ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(49, 151, 149, 0.4) 0%, rgba(49, 151, 149, 0.1) 70%, transparent 100%);
    transform: scale(0);
    animation: newsRippleEffect 0.8s ease-out;
    pointer-events: none;
}

@keyframes newsRippleEffect {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(25);
        opacity: 0;
    }
}

/* Animación de entrada tipo fingerprint para news */
.digital-news-popup-overlay.fingerprint-enter .digital-news-popup-container {
    animation: newsEnterScan 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes newsEnterScan {
    0% {
        transform: scale(0) rotate(-10deg);
        opacity: 0;
        filter: blur(10px);
    }
    30% {
        transform: scale(0.3) rotate(-5deg);
        opacity: 0.3;
        filter: blur(5px);
    }
    60% {
        transform: scale(0.8) rotate(2deg);
        opacity: 0.8;
        filter: blur(2px);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: blur(0px);
    }
}

/* Efectos de partículas para news popup */
.digital-news-popup-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.digital-news-popup-particle {
    position: absolute;
    font-size: 20px;
    animation: floatNewsParticle 4s infinite ease-in-out;
    text-shadow: 0 0 10px rgba(49, 151, 149, 0.3);
}

@keyframes floatNewsParticle {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: translateY(-120px) scale(1.2) rotate(180deg);
        opacity: 1;
    }
}

/* Botón trigger para news popup */
.digital-news-popup-trigger {
    background: linear-gradient(135deg, #319795, #2c7a7b);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(49, 151, 149, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.digital-news-popup-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(49, 151, 149, 0.4);
}

.digital-news-popup-trigger:active {
    transform: translateY(0);
}

.digital-news-popup-trigger.clicked {
    animation: newsButtonClick 0.6s ease;
}

@keyframes newsButtonClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Animaciones de cierre */
.digital-news-popup-overlay.closing .digital-news-popup-container {
    animation: newsPopupClose 0.4s ease-in forwards;
}

@keyframes newsPopupClose {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

/* Overlay de escaneo específico para news */
#news-huella-scan-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        hsla(180, 63%, 16%, 0.85), 
        hsla(0, 0%, 0%, 0.95)
    );
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999998;
    animation: fadeOutNewsOverlay 1.8s ease forwards;
    animation-delay: 1.5s;
}

.news-huella-abstracta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeInNewsHuella 0.4s ease-in;
}

.news-data-icon {
    font-size: 48px;
    animation: rotateIcon 2s infinite linear;
    margin-bottom: 10px;
}

.news-scan-text {
    color: #00ffcc;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 20px;
    animation: blink 1s infinite;
}

.news-huella-abstracta .news-linea {
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #319795, #2c7a7b);
    animation: newsPulse 1.4s infinite ease-in-out;
}

.news-scan-line {
    position: absolute;
    width: 140px;
    height: 4px;
    background: linear-gradient(to right, #00f2ff, #00ffcc);
    animation: newsScanDown 1.5s ease-in-out forwards;
    box-shadow: 0 0 20px #00f2ff, 0 0 40px #00ffcc;
    filter: blur(1px);
}

/* Animaciones para el escaneo de news */
@keyframes rotateIcon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes newsScanDown {
    0% { top: 25%; opacity: 1; }
    100% { top: 75%; opacity: 0; }
}

@keyframes newsPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; transform: scaleX(1.1); }
}

@keyframes fadeOutNewsOverlay {
    to { opacity: 0; visibility: hidden; }
}

@keyframes fadeInNewsHuella {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Delays para las líneas del escaneo */
.news-huella-abstracta .news-linea:nth-child(3) { animation-delay: 0s; }
.news-huella-abstracta .news-linea:nth-child(4) { animation-delay: 0.2s; }
.news-huella-abstracta .news-linea:nth-child(5) { animation-delay: 0.4s; }
.news-huella-abstracta .news-linea:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 768px) {
    .digital-news-popup-container {
        width: 98%;
        max-width: none;
        margin: 15px;
        border-radius: 20px;
    }
    
    .digital-news-popup-header {
        padding: 25px 25px 15px;
    }
    
    .digital-news-popup-title {
        font-size: 26px;
    }
    
    .digital-news-popup-content {
        padding: 25px 30px 30px;
        max-height: 65vh;
    }
    
    .digital-news-popup-close {
        width: 40px;
        height: 40px;
        top: 15px;
        right: 15px;
        font-size: 22px;
    }
    
    .popup-galeria {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .popup-galeria-item img {
        height: 150px;
    }
    
    .video-responsive {
        padding-bottom: 60%; /* Ajuste para móviles */
    }
    
    .iframe-responsive {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .digital-news-popup-container {
        width: 98%;
        margin: 10px;
        max-height: 95vh;
    }
    
    .digital-news-popup-header {
        padding: 20px 20px 10px;
    }
    
    .digital-news-popup-title {
        font-size: 22px;
    }
    
    .digital-news-popup-subtitle {
        font-size: 14px;
    }
    
    .digital-news-popup-content {
        padding: 20px 25px 25px;
        max-height: 70vh;
        font-size: 15px;
    }
    
    .digital-news-popup-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
        top: 12px;
        right: 12px;
    }
    
    .popup-galeria {
        grid-template-columns: 1fr;
    }
    
    .iframe-responsive {
        height: 250px;
    }
}

/* FORZAR RENDERIZADO CORRECTO */
.digital-news-popup-container {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.digital-news-popup-content {
    transform: translateZ(0);
    will-change: opacity, transform;
    backface-visibility: hidden;
    min-height: 1px;
}

/* Fix para problemas de rendering */
.digital-news-popup-overlay.active {
    display: flex !important;
}

.digital-news-popup-overlay.active .digital-news-popup-container {
    display: block !important;
    visibility: visible !important;
}

/* Estilos adicionales para shortcodes */
.digital-news-popup-content .wp-block-quote {
    border-left: 4px solid #319795;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    background: rgba(49, 151, 149, 0.05);
    padding: 20px;
    border-radius: 8px;
}

.digital-news-popup-content .wp-block-button .wp-block-button__link {
    background: linear-gradient(135deg, #319795, #2c7a7b);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.digital-news-popup-content .wp-block-button .wp-block-button__link:hover {
    background: linear-gradient(135deg, #2c7a7b, #285e61);
    transform: translateY(-2px);
}

/* Estilos para listas */
.digital-news-popup-content ul,
.digital-news-popup-content ol {
    padding-left: 20px;
    margin-bottom: 20px;
}

.digital-news-popup-content li {
    margin-bottom: 8px;
}

/* Estilos para código */
.digital-news-popup-content code {
    background: #f7f7f7;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #e53e3e;
}

.digital-news-popup-content pre {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
}

/* Estilos para tablas */
.digital-news-popup-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.digital-news-popup-content th,
.digital-news-popup-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.digital-news-popup-content th {
    background: #319795;
    color: white;
    font-weight: 600;
}

.digital-news-popup-content tr:nth-child(even) {
    background: #f8f9fa;
}

/* Animación para elementos que aparecen */
.digital-news-popup-content * {
    animation: fadeInContent 0.5s ease-out;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AGREGAR estos estilos al final del archivo digital-news-popup.css */

/* Estilos para administración mejorada */
.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Estilos para galería en admin */
.gallery-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gallery-item .remove-image {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .remove-image {
    opacity: 1;
}

/* Estilos para preview containers */
.preview-container {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border: 2px solid #0073aa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para visor de PDF */
.pdf-viewer {
    border: 2px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

.pdf-viewer iframe {
    background: white;
}

/* Estilos para página preview */
.page-preview {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background: white;
}

/* Mejorar botones de admin */
.button-enhanced {
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.button-enhanced:hover {
    background: linear-gradient(135deg, #005a87, #004a73);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.4);
    color: white;
}

/* Indicadores de tipo de contenido */
.content-type-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-type-html { background: #e3f2fd; color: #1976d2; }
.content-type-video { background: #ffebee; color: #d32f2f; }
.content-type-gallery { background: #f3e5f5; color: #7b1fa2; }
.content-type-pdf { background: #fff3e0; color: #f57c00; }
.content-type-page { background: #e8f5e8; color: #388e3c; }

/* Mejorar tabla de lista de popups */
.wp-list-table .column-tipo {
    width: 120px;
}

.wp-list-table .popup-id-cell {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* Animaciones suaves para cambios de panel */
.content-panel {
    animation: fadeInPanel 0.3s ease-out;
}

@keyframes fadeInPanel {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Estilos para mensajes de estado */
.status-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive para admin */
@media (max-width: 768px) {
    .content-panels {
        padding: 10px;
    }
    
    .video-preview-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}