@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&display=swap');

:root {
    --color-bg: #f5f6fa;
    --color-bg-card: #fff;
    --color-bg-header: linear-gradient(90deg, #162b4e 0%, #162b4e 100%);
    --color-bg-footer: linear-gradient(90deg, #162b4e 0%, #162b4e 100%);
    --color-text: #232526;
    --color-primary: #4e54c8;
    --color-secondary: #8f94fb;
    --color-btn-text: #fff;
    --color-btn-bg: linear-gradient(90deg, #4e54c8 0%, #8f94fb 100%);
    --color-btn-bg-hover: linear-gradient(90deg, #8f94fb 0%, #4e54c8 100%);
    --color-shadow: rgba(44,62,80,0.10);
    --color-card-shadow: rgba(67,198,172,0.05);
    --color-loader: #4e54c8;
}

.dark {
    --color-bg: #181a1b;
    --color-bg-card: #232526;
    --color-bg-header: linear-gradient(90deg, #162b4e 0%, #162b4e 100%);
    --color-bg-footer: linear-gradient(90deg, #162b4e 0%, #162b4e 100%);
    --color-text: #f5f6fa;
    --color-primary: #8f94fb;
    --color-secondary: #4e54c8;
    --color-btn-text: #23739b;
    --color-btn-bg: linear-gradient(90deg, #232526 0%, #414345 100%);
    --color-btn-bg-hover: linear-gradient(90deg, #414345 0%, #232526 100%);
    --color-shadow: rgba(44,62,80,0.30);
    --color-card-shadow: rgba(67,198,172,0.10);
    --color-loader: #8f94fb;
}

body {
    font-family: 'Libre Baskerville', serif;
    line-height: 1.6;
    background: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
}

main:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

header {
    background: var(--color-bg-header);
    color: #fff;
    text-align: center;
    padding: 2.5rem 0 1.5rem 0;
    box-shadow: 0 4px 16px rgba(44,62,80,0.10);
    letter-spacing: 1px;
}

header h1 {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(90deg, #fff 0%, #babfff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

main {
    max-width: 950px;
    margin: 2.5rem auto 1.5rem auto;
    padding: 0 1.5rem;
    flex: 1 0 auto;
}

footer {
    background: var(--color-bg-footer);
    color: #fff;
    text-align: center;
    padding: 1.2rem 0 1.2rem 0;
    font-size: 1rem;
    letter-spacing: 1px;
    flex-shrink: 0;
    width: 100%;
    margin-top: auto;
    box-shadow: 0 -2px 12px rgba(44,62,80,0.10);
}

.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(255,255,255,0.92);
    padding: 0.7rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(44,62,80,0.08);
    backdrop-filter: blur(2px);
    gap: 1.5rem;
}
.dark .navigation {
    background: rgba(35,37,38,0.92);
}

.navigation button {
    background: var(--color-btn-bg);
    color: var(--color-btn-text);
    border: 1.5px solid var(--color-secondary);
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(78,84,200,0.10);
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    outline: none;
}
.dark .navigation button {
    background: var(--color-btn-bg);
    color: var(--color-btn-text);
    border: 1.5px solid var(--color-primary);
    box-shadow: 0 2px 8px rgba(143,148,251,0.18);
}
.navigation button:hover {
    background: var(--color-btn-bg-hover);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px rgba(78,84,200,0.15);
}

.navigation button:disabled {
    background-color: #bdc3c7;
    color: #888;
    border: 1.5px solid #888;
    cursor: not-allowed;
    opacity: 0.7;
}

#current-date-display {
    color: var(--color-text);
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 1px;
    text-shadow: 0 1px 8px #8f94fb33;
    margin: 0 1.5rem;
}

#news-container {
    background: var(--color-bg-card);
    padding: 2.2rem 0.7rem;
    border-radius: 18px;
    box-shadow: 0 6px 32px var(--color-shadow);
    min-height: 300px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(2px);
}
@media (min-width: 600px) {
    #news-container {
        padding: 2.2rem 2.2rem;
    }
    .news-article {
        padding: 1.5rem 2.2rem 1.5rem 2.2rem;
    }
}

.news-article {
    border-bottom: 1px solid #e0e0e0;
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--color-card-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}
.dark .news-article {
    background: linear-gradient(90deg, #232526 0%, #414345 100%);
    box-shadow: 0 2px 12px var(--color-card-shadow);
    border-bottom: 1px solid #333;
}

.news-article h3 {
    margin-top: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: 0.5px;
}

.news-article a {
    color: #4e54c8;
    text-decoration: none;
    font-weight: bold;
    background: none;
    transition: text-shadow 0.2s, color 0.2s;
    outline: none;
}
.news-article a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.news-article a:hover {
    color: var(--color-text);
    text-shadow: 0 2px 8px #8f94fb44;
}

.news-article p {
    margin: 0.5rem 0;
    font-size: 1.08rem;
    color: var(--color-text);
}

.news-article .source {
    font-size: 0.98rem;
    color: var(--color-text);
    opacity: 0.7;
    margin-top: 0.7rem;
}

.loader, .error-message {
    text-align: center;
    font-size: 1.25rem;
    padding: 2.5rem 0;
    color: var(--color-loader);
    letter-spacing: 1px;
    font-weight: 700;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.7s ease;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.7s ease;
}

/* Animaciones sutiles */
.news-article, .navigation button, #news-container {
    transition: background 0.4s, color 0.4s, box-shadow 0.3s, transform 0.2s, opacity 0.7s;
}

.search-filter {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

#search-input, #source-filter {
    flex: 1;
    min-width: 180px;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1.5px solid var(--color-secondary);
    font-size: 1rem;
    background: var(--color-bg-card);
    color: var(--color-text);
    box-shadow: 0 1px 4px var(--color-shadow);
    transition: background 0.3s, color 0.3s, border 0.3s;
}
#search-input:focus, #source-filter:focus {
    outline: 2px solid var(--color-primary);
    border-color: var(--color-primary);
}
.dark #search-input, .dark #source-filter {
    background: #232526;
    color: #f5f6fa;
    border: 1.5px solid var(--color-primary);
}