/* Estilos personalizados para Bajo la Mira Actopan - Diseño Rediseñado */

@layer base {
    body {
        font-family: 'Inter', sans-serif;
        letter-spacing: 0.01em;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-family: 'Bebas Neue', cursive;
        letter-spacing: 0.05em;
    }
}

/* Efecto de barra superior parpadeante */
@keyframes alertFlash {
    0%, 100% { 
        opacity: 1;
        background-color: #B71C1C;
    }
    50% { 
        opacity: 0.8;
        background-color: #C62828;
    }
}

.alert-bar {
    animation: alertFlash 3s infinite;
}

/* Header fijo - sin cambios al hacer scroll */
.header-scrolled {
    /* No aplicar cambios visuales que puedan afectar la posición */
}

/* Asegurar que la barra superior esté completamente fija */
#topAlertBar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 60 !important;
    width: 100% !important;
}

/* Asegurar que el header siempre esté visible y fijo - NO SE MUEVE NUNCA */
#mainHeader {
    position: fixed !important;
    top: 24px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 50 !important;
    transform: none !important;
    -webkit-transform: none !important;
    will-change: auto !important;
    transition: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Bloquear cualquier intento de mover el header */
#mainHeader * {
    position: relative !important;
}

/* Prevenir cualquier movimiento del navbar */
body {
    overflow-x: hidden;
}

/* Asegurar que el buscador esté completamente fijo - NO SE MUEVE */
#searchBar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 40 !important;
    transform: none !important;
    -webkit-transform: none !important;
}

/* Calcular posición del buscador dinámicamente pero mantenerlo fijo */
#searchBar {
    top: calc(24px + var(--header-height, 150px)) !important;
}

/* Asegurar que el contenido principal tenga espacio suficiente y no se mueva */
#mainContent {
    position: relative !important;
    z-index: 1 !important;
    width: 100% !important;
}

/* Tarjetas de noticias con efecto de elevación */
.news-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 214, 0, 0.1), transparent);
    transition: left 0.6s;
    z-index: 1;
}

.news-card:hover::before {
    left: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(183, 28, 28, 0.5);
    border-color: #FFD600;
}

/* Imagen con efecto de zoom y overlay */
.news-image {
    position: relative;
    overflow: hidden;
    background: #1A1A1A;
}

.news-image img {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

.news-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0) 0%,
        rgba(10, 10, 10, 0.4) 50%,
        rgba(10, 10, 10, 0.9) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Noticia destacada principal */
.featured-news {
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.featured-news::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0.3) 0%,
        rgba(10, 10, 10, 0.6) 50%,
        rgba(10, 10, 10, 0.95) 100%
    );
    z-index: 1;
}

.featured-news-content {
    position: relative;
    z-index: 2;
}

/* Botones de compartir con efecto de brillo */
.share-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.share-button:hover::after {
    width: 300px;
    height: 300px;
}

.share-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Animación de entrada para noticias */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Efecto de texto con sombra intensa mejorado */
.text-shadow-intense {
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(183, 28, 28, 0.6),
        0 0 40px rgba(183, 28, 28, 0.3);
}

/* Badge urgente con pulso mejorado */
@keyframes urgentPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 214, 0, 0.7);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 214, 0, 0);
    }
}

.urgent-badge {
    animation: urgentPulse 2s infinite;
    font-weight: 800;
    letter-spacing: 0.1em;
}

/* Navegación con efecto de subrayado */
.nav-item {
    position: relative;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: #FFD600;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 80%;
}

.nav-item.active {
    background: #B71C1C;
    color: #FFD600;
}

/* Scrollbar personalizado mejorado */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #0A0A0A;
    border-left: 1px solid #1A1A1A;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #B71C1C, #8B0000);
    border-radius: 0;
    border: 2px solid #0A0A0A;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #FFD600, #B71C1C);
}

/* Efecto de zoom en imagen de artículo */
.article-image {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.9) contrast(1.1);
}

.article-image:hover {
    transform: scale(1.03);
    filter: brightness(1) contrast(1.2);
}

/* Efecto de hover en reportes ciudadanos */
.citizen-report {
    transition: all 0.3s ease;
    cursor: pointer;
}

.citizen-report:hover {
    border-color: #FFD600;
    transform: translateX(8px);
    box-shadow: -4px 0 15px rgba(255, 214, 0, 0.3);
}

/* Iconos sociales con efecto de rotación */
.social-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 15px rgba(255, 214, 0, 0.4);
}

/* Contador de vistas con efecto */
.view-count {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    color: #FFD600;
    text-shadow: 0 0 10px rgba(255, 214, 0, 0.5);
}

/* Efecto de línea divisoria animada */
.divider-line {
    position: relative;
    overflow: hidden;
}

.divider-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #FFD600, transparent);
    animation: slideLine 3s infinite;
}

@keyframes slideLine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .news-card:hover {
        transform: none;
    }
    
    .news-card:hover .news-image img {
        transform: none;
    }
    
    .featured-news {
        min-height: 400px;
    }
}

/* Efecto de carga para imágenes */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* Mejora de contraste y legibilidad */
.news-excerpt {
    line-height: 1.7;
    color: #E0E0E0;
}

/* Efecto de resaltado en búsqueda */
.highlight {
    background-color: #FFD600;
    color: #0A0A0A;
    padding: 2px 4px;
    font-weight: 700;
}
