/* CSS de estilo Opera Minimalista con Fondo de Biblioteca */
:root {
    --bg-color: rgba(247, 249, 250, 0.9);
    --text-color: #333;
    --accent-color: #0066ee; /* Deep Blue instead of Red */
    --search-bg: rgba(255, 255, 255, 0.95);
    --card-bg: rgba(255, 255, 255, 0.98);
    --shadow: 0 4px 12px rgba(0,0,0,0.15);
    --border-radius: 24px;
    --overlay-color: rgba(0,0,0,0.2);
    --title-color: #0066ee;
    --label-color: #b8860b; /* Dorado Normal */
    --search-icon-color: #001a33; /* Muy oscuro para luz */
    --ticker-bg: rgba(0,0,0,0.6);
}








[data-theme="dark"] {
    --bg-color: rgba(26, 26, 26, 0.85);
    --text-color: #ffffff;
    --search-bg: rgba(45, 45, 45, 0.9);
    --card-bg: rgba(45, 45, 45, 0.95);
    --shadow: 0 4px 12px rgba(0,0,0,0.5);
    --overlay-color: rgba(0,0,0,0.6);
    --title-color: #5ec0ff; /* Azul neón para dark mode */
    --label-color: #d4af37; /* Dorado Estándar para dark mode */
    --search-icon-color: #ffffff; /* Blanco puro para dark mode */
    --ticker-bg: rgba(0,0,0,0.4);
}








* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px !important; /* Más cerca de la cintilla */
    background: url('bg.png') no-repeat center center fixed;


    background-size: cover;
    overflow-x: hidden;
}

/* Capa de superposición para mejorar legibilidad */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-color);
    z-index: -1;
    transition: background-color 0.3s;
}

.container {
    width: 98%;
    max-width: 1800px;
    text-align: center;
    position: relative;
    z-index: 10;
}


.logo {
    margin-bottom: 0.5rem; /* Muy poco espacio */
    color: #fff;
    text-shadow: 0 4px 8px rgba(0,0,0,0.6);
}


.logo h1 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -1px;
}


.logo span {
    color: var(--accent-color);
}

@media (max-width: 600px) {
    .logo h1 {
        font-size: 0.5rem;
        padding-top: 10px;
    }
}

.search-box {
    position: relative;
    margin: 0 auto 0.5rem; /* Casi nada de margen abajo */
    width: 100%;
    max-width: 600px;
}


.search-input {
    width: 100%;
    padding: 20px 24px 20px 60px;
    font-size: 1.15rem;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--search-bg);
    box-shadow: var(--shadow);
    color: var(--text-color);
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(12px); /* Más desenfoque */
    border: 1px solid rgba(255,255,255,0.1);
}


.search-input:focus {
    box-shadow: 0 0 0 3px var(--accent-color), 0 8px 20px rgba(0,0,0,0.3);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--search-icon-color); /* Color de alto contraste */
    font-size: 1.6rem;
    pointer-events: none;
    z-index: 100; /* Aseguramos que esté por encima de todo */
    opacity: 2 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}



.results-container {
    text-align: left;
    margin-top: 0.5rem; /* Pegado al buscador */
    width: 100%;
    max-width: 100% !important; /* Edge to edge */
    display: grid;

    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-left: auto;
    margin-right: auto;
}




@media (max-width: 900px) {
    .results-container {
        grid-template-columns: 1fr;
    }
}

.result-item {
    background: var(--card-bg);
    padding: 12px 20px; /* Más compacto */
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, background 0.2s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.05);
    min-height: 80px; /* Altura mínima consistente */
}




.result-item:hover {
    transform: translateX(5px);
    background-color: var(--accent-color);
}

.result-item:hover * {
    color: white !important;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--title-color); /* Color de alto contraste */
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}


.result-description {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.85;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* Propiedad estándar */
    overflow: hidden;

}

.result-link {
    font-size: 0.75rem;
    color: var(--label-color); /* Usamos dorado para distinguir */
    opacity: 0.9;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: auto;
}


.theme-toggle {
    position: fixed;
    top: 5px; /* Bajamos el botón para evitar que la cintilla lo cubra */
    right: 20px;
    background: var(--card-bg);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

@media (max-width: 600px) {
    .theme-toggle {
        top: 10px; /* Lo bajamos más en móviles para no tapar el título */
        right: 5px;
        width: 40px;
        height: 40px;
    }
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

.loading {
    display: none;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estilos para Cintillas (Tickers) */
.ticker-wrap {
    position: fixed;
    left: 0;
    width: 100%;
    overflow: hidden;
    background-color: var(--ticker-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    white-space: nowrap;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ticker-top {
    top: 0;
}

.ticker-bottom {
    bottom: 0;
}

.ticker-content {
    display: flex;
    white-space: nowrap;
    width: fit-content;
}

.ticker-items {
    display: flex;
    animation: scroll-left-stepped 270s linear infinite; /* 4.5 minutos total */
}






.ticker-items-reverse {
    display: flex;
    animation: scroll-right-stepped 270s linear infinite;
}






.ticker-item {
    margin: 0;
    padding: 0 40px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
    display: flex;
    align-items: center;
    text-decoration: none; /* Quitamos subrayado */
    transition: color 0.3s;
}

.ticker-item:hover {
    color: var(--title-color); /* Resalte al pasar el mouse */
}


.ticker-item i {
    color: var(--title-color);
    margin-right: 12px;
}

@keyframes scroll-left-stepped {
    0%, 11.1% { transform: translateX(0); } /* Parada 30s */
    16.7%, 27.8% { transform: translateX(-8.33%); } /* Movimiento 15s y parada 30s */
    33.3%, 44.4% { transform: translateX(-16.66%); }
    50%, 61.1% { transform: translateX(-25%); }
    66.7%, 77.8% { transform: translateX(-33.33%); }
    83.3%, 94.4% { transform: translateX(-41.66%); }
    100% { transform: translateX(-50%); } /* Último paso */
}

@keyframes scroll-right-stepped {
    0%, 11.1% { transform: translateX(-50%); }
    16.7%, 27.8% { transform: translateX(-41.66%); }
    33.3%, 44.4% { transform: translateX(-33.33%); }
    50%, 61.1% { transform: translateX(-25%); }
    66.7%, 77.8% { transform: translateX(-16.66%); }
    83.3%, 94.4% { transform: translateX(-8.33%); }
    100% { transform: translateX(0); }
}






/* Ajuste general para el cuerpo */
body {
    padding-top: 45px !important; /* Casi toca la cintilla superior */
    padding-bottom: 60px !important;
}


