/**
 * Banner de Noticias Lateral - Estilos
 * Similar al banner de wallet.payvalida.com
 */

/* Overlay de fondo oscuro */
.news-banner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.news-banner-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Contenedor principal del banner */
.news-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    max-width: 95vw;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.news-banner.active {
    transform: translateX(0);
}

/* Header del banner */
.news-banner-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    margin-top: 40px; /* Evitar solapamiento con menú principal */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.news-banner-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-banner-title i {
    font-size: 24px;
    color: #ffd700;
}

/* Botón de cerrar */
.news-banner-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Contenido del banner */
.news-banner-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Items de noticias */
.news-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 4px solid #ffd700;
}

.news-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.news-item:last-child {
    margin-bottom: 0;
}

/* Badge de fecha */
.news-date {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Título de la noticia */
.news-item-title {
    color: #1a237e;
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

/* Descripción de la noticia */
.news-item-desc {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

/* Enlace de la noticia */
.news-item-link {
    display: inline-flex;
    align-items: center;
    color: #1976d2;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    gap: 5px;
    transition: color 0.2s ease;
}

.news-item-link:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* Badge de importancia */
.news-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    text-transform: uppercase;
}

.news-badge.important {
    background: #ffebee;
    color: #c62828;
}

.news-badge.new {
    background: #e8f5e9;
    color: #2e7d32;
}

.news-badge.update {
    background: #fff3e0;
    color: #ef6c00;
}

/* Footer del banner */
.news-banner-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.news-banner-footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    margin: 0;
}

/* Indicador de noticias (cuando el banner está cerrado) */
.news-indicator {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    padding: 15px 10px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 9997;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.news-indicator:hover {
    padding-left: 15px;
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

.news-indicator.hidden {
    transform: translateY(-50%) translateX(-100%);
}

.news-indicator-text {
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
}

.news-indicator-icon {
    font-size: 18px;
}

.news-indicator-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    font-size: 11px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Scrollbar personalizada (solo WebKit/Blink) */
@supports selector(::-webkit-scrollbar) {
    .news-banner-content::-webkit-scrollbar {
        width: 6px;
    }

    .news-banner-content::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }

    .news-banner-content::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 3px;
    }

    .news-banner-content::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.5);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .news-banner {
        width: 100%;
        max-width: 100%;
    }
    
    .news-banner-header {
        margin-top: 50px; /* Más espacio en móvil */
        padding: 12px 15px;
    }
    
    .news-indicator {
        padding: 12px 8px;
    }
    
    .news-indicator-text {
        font-size: 12px;
    }
}

/* Animación de entrada para noticias */
@keyframes slideInNews {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.news-item {
    animation: slideInNews 0.4s ease forwards;
}

.news-item:nth-child(1) { animation-delay: 0.1s; }
.news-item:nth-child(2) { animation-delay: 0.2s; }
.news-item:nth-child(3) { animation-delay: 0.3s; }
.news-item:nth-child(4) { animation-delay: 0.4s; }
.news-item:nth-child(5) { animation-delay: 0.5s; }

/* ============================================
   CARRUSEL DE IMÁGENES DINÁMICO
   ============================================ */

.news-carousel-section {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.news-carousel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.news-carousel-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-carousel-counter {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Contenedor del carrusel */
.news-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.news-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer !important;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
}

/* Imágenes del carrusel - Ajustadas al panel */
.news-carousel-slide img {
    width: 100%;
    height: 260px;
    object-fit: contain;
    object-position: center;
    display: block;
    border-radius: 8px;
    cursor: zoom-in;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
}

.news-carousel-slide img:hover {
    transform: scale(1.03);
    background: rgba(255, 255, 255, 0.1);
}

/* Indicador de zoom en imágenes */
.news-carousel-slide {
    position: relative;
}

.news-carousel-zoom-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none !important;
    white-space: nowrap;
    z-index: 5;
}

.news-carousel-slide:hover .news-carousel-zoom-hint {
    opacity: 1;
}

/* Asegurar que la imagen capture el click */
.news-carousel-slide img {
    position: relative;
    z-index: 1;
}

/* Controles del carrusel */
.news-carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 12px;
}

.news-carousel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.news-carousel-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.news-carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Indicadores (dots) */
.news-carousel-dots {
    display: flex;
    gap: 8px;
}

.news-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-carousel-dot.active {
    background: #ffd700;
    transform: scale(1.3);
}

.news-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Autoplay indicator */
.news-carousel-autoplay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-carousel-autoplay.playing::before {
    content: "▶";
    font-size: 8px;
}

.news-carousel-autoplay.paused::before {
    content: "⏸";
    font-size: 8px;
}

/* Separador de secciones */
.news-section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    margin: 20px 0;
}

.news-section-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-section-title::before {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.news-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   LIGHTBOX / POPUP PARA IMÁGENES
   ============================================ */

.news-lightbox {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important; /* Máximo z-index posible */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    animation: lightboxFadeIn 0.3s ease;
    background: rgba(0, 0, 0, 0.95) !important;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.news-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
}

.news-lightbox-content {
    position: relative;
    z-index: 1;
    width: 95vw;
    height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: lightboxContentIn 0.3s ease 0.1s both;
    padding: 80px 40px 40px;
    box-sizing: border-box;
}

@keyframes lightboxContentIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.news-lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.news-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100;
}

.news-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: rotate(90deg) scale(1.1);
}

.news-lightbox-caption {
    color: #ffffff;
    text-align: center;
    margin-top: 25px;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    max-width: 80%;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 25px;
    border-radius: 8px;
}

/* Contador de imágenes en lightbox */
.news-lightbox-counter {
    position: absolute;
    top: 25px;
    left: 25px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 500;
}

/* Navegación en lightbox */
.news-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 100;
}

.news-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.news-lightbox-nav.prev {
    left: 20px;
}

.news-lightbox-nav.next {
    right: 20px;
}

@media (max-width: 768px) {
    .news-lightbox-nav.prev,
    .news-lightbox-nav.next {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .news-lightbox-nav.prev {
        left: 10px;
    }
    
    .news-lightbox-nav.next {
        right: 10px;
    }
    
    .news-lightbox-content {
        padding: 70px 20px 20px;
    }
    
    .news-lightbox-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 26px;
    }
    
    .news-lightbox-counter {
        top: 20px;
        left: 15px;
        font-size: 12px;
        padding: 8px 14px;
    }
}

/* Asegurar que el lightbox esté siempre visible */
.news-lightbox {
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

/* Asegurar que las imágenes del carrusel sean clickeables */
.news-carousel-slide img {
    pointer-events: auto;
}
