/* --- VARIABLES Y ESTILOS GLOBALES --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&family=Orbitron:wght@500;700;900&display=swap');

:root {
    --accent-color: #00BFFF;
    --glow-color: rgba(0, 191, 255, 0.5);
    --text-color: #F0F0F0;
    --dark-bg: #050816;
    --section-bg: #0a192f;
    --card-bg: rgba(10, 25, 47, 0.6);
    --font-body: 'Roboto', sans-serif;
    --font-heading: 'Orbitron', sans-serif;
}

body {
    background-color: var(--section-bg);
    color: var(--text-color);
    font-family: var(--font-body);
    margin: 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* --- ENCABEZADO DE LA PÁGINA DE NOTICIAS --- */
.news-header {
    background: linear-gradient(145deg, var(--dark-bg), var(--section-bg));
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid rgba(0, 191, 255, 0.2);
}

.news-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--glow-color);
    margin: 0;
}

.news-header p {
    font-size: 1.2rem;
    color: #ccc;
    margin-top: 10px;
}

/* --- CONTROLES: BUSCADOR Y FILTROS --- */
.news-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 40px 0;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--dark-bg);
    border: 1px solid rgba(0, 191, 255, 0.3);
    border-radius: 50px;
    padding: 5px;
    flex-grow: 1;
    max-width: 500px;
}

.search-icon {
    color: var(--accent-color);
    margin: 0 10px 0 15px;
}

.search-form input {
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    padding: 10px;
    width: 100%;
}

.search-form input:focus {
    outline: none;
}

.search-form button {
    background: var(--accent-color);
    border: none;
    border-radius: 50px;
    color: var(--dark-bg);
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.search-form button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px var(--glow-color);
}

.filter-form select {
    background: var(--dark-bg);
    border: 1px solid rgba(0, 191, 255, 0.3);
    color: white;
    padding: 12px 18px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
}

/* --- GRID DE NOTICIAS --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

.news-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.news-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 0 25px var(--glow-color);
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.news-card:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-category {
    background-color: var(--accent-color);
    color: var(--dark-bg);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    align-self: flex-start;
    margin-bottom: 15px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin: 0 0 10px 0;
    line-height: 1.3;
    color: #fff;
}

.card-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ccc;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 191, 255, 0.1);
    font-size: 0.9rem;
    color: #aaa;
}
.card-read-more {
    color: var(--accent-color);
    font-weight: bold;
    transition: transform 0.3s;
}
.news-card:hover .card-read-more {
    transform: translateX(5px);
}
.no-results {
    font-size: 1.2rem;
    text-align: center;
    grid-column: 1 / -1;
    padding: 50px;
}


/* --- ESTILOS PÁGINA DE DETALLE --- */
.article-hero {
    height: 60vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding-bottom: 4rem;
}

.article-hero .container {
    padding: 0;
}

.article-meta-top {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 1rem;
}
.article-date {
    font-size: 0.9rem; color: #ddd;
}

.article-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
    margin: 0;
}

.article-content {
     /* display: grid; */
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 4rem 0;
}
@media (min-width: 992px) {
    .article-content {
        grid-template-columns: 3fr 1fr;
    }
}

.content-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #ddd;
}

.content-body h2, .content-body h3 {
    font-family: var(--font-heading);
    color: var(--accent-color);
}
.article-sidebar .share-box {
    background: var(--dark-bg);
    padding: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 191, 255, 0.2);
    position: sticky;
    top: 100px;
}
.share-box h3 {
    margin-top: 0;
    font-family: var(--font-heading);
}

.share-buttons {
    display: flex;
    gap: 10px;
}
.share-btn {
    color: #fff;
    font-size: 1.2rem;
    width: 40px; height: 40px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
}
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #1DA1F2; }
.share-btn.linkedin { background: #0A66C2; }
.share-btn.whatsapp { background: #25D366; }
.share-btn:hover {
    transform: scale(1.1);
}

.back-link {
    display: inline-block;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 4rem;
}

/* ============================================= */
/* === ESTILOS PARA EL NUEVO SWITCH DE FUENTE === */
/* ============================================= */
.news-source-switch {
    display: flex;
    background-color: var(--dark-bg);
    border-radius: 50px;
    padding: 5px;
    border: 1px solid rgba(0, 191, 255, 0.3);
}

.news-source-switch a {
    padding: 10px 30px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 50px;
    transition: all 0.4s ease;
    text-align: center;
}

.news-source-switch a:hover {
    background-color: rgba(0, 191, 255, 0.1);
}

.news-source-switch a.active {
    background-color: var(--accent-color);
    color: var(--dark-bg);
    box-shadow: 0 0 15px var(--glow-color);
}


/* ======================================= */
/* === ESTILOS PARA LA NUEVA PAGINACIÓN === */
/* ======================================= */

.pagination {
    display: flex;
    justify-content: center;
    padding: 40px 0 60px 0;
}

.pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
}

.pagination a {
    display: block;
    padding: 12px 18px;
    min-width: 45px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    background-color: var(--card-bg);
    border: 1px solid rgba(0, 191, 255, 0.2);
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.pagination a:not(.active):hover {
    background-color: var(--accent-color);
    color: var(--dark-bg);
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

.pagination a.active {
    background-color: var(--accent-color);
    color: var(--dark-bg);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--glow-color);
    cursor: default; /* Ya no es necesario hacer clic */
    transform: translateY(-3px); /* Mantenemos el efecto para que se vea destacado */
}