/* Tema oscuro (por defecto) */
:root {
    --bg-color: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #333;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999;
    --border-color: #333;
    --accent-color: #6bb6ff;
    --accent-color-dark: #555555;
    --button-bg: #333;
    --button-bg-hover: #555;
}

/* Tema claro */
[data-theme="light"] {
    --bg-color: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --text-color: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --accent-color: #0066cc;
    --button-bg: #e9ecef;
    --button-bg-hover: #ced4da;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header h1 .emoji {
    font-size: 50px;
}

.info-icon {
    width: 20px;
    height: 20px;
    background: white;
    color: black;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    font-style: italic;
    margin-left: 10px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.info-icon:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.theme-toggle {
    width: 20px;
    height: 20px;
    background: var(--text-color);
    color: var(--bg-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

.theme-toggle-text {
    color: var(--text-muted);
    font-size: 0.8em;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    user-select: none;
    text-align: center;
    margin-top: 5px;
}

.theme-toggle-text:hover {
    opacity: 1;
}

.info-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    margin-top: 15px;
}

.info-panel.active {
    max-height: 400px;
    opacity: 1;
}

.info-content {
    background: #000;
    border: 2px solid #333;
    border-radius: 10px;
    padding: 20px;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.info-text {
    color: #fff;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: left;
    font-size: 0.95em;
}

.paypal-form {
    text-align: center;
    margin-top: 15px;
}

.paypal-btn {
    background: #0070ba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 112, 186, 0.3);
}

.paypal-btn:hover {
    background: #005ea6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 112, 186, 0.4);
}

.contact-link {
    text-align: center;
    margin-top: 15px;
}

.contact-link a {
    color: #999;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.contact-link a:hover {
    color: #fff;
    border-bottom: 1px solid #666;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.update-info {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    margin-top: 10px;
}

.sleep-info {
    text-align: center;
    color: #87ceeb;
    font-size: 0.95em;
    margin-top: 8px;
    background: rgba(135, 206, 235, 0.1);
    border: 1px solid rgba(135, 206, 235, 0.3);
    border-radius: 15px;
    padding: 8px 16px;
    margin: 10px auto;
    max-width: 400px;
    display: inline-block;
    font-weight: 500;
    animation: sleepPulse 3s ease-in-out infinite;
    white-space: nowrap;
}

@keyframes sleepPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}


.news-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-card {
    background: var(--bg-secondary);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid var(--border-color);
    width: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.news-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.news-content {
    padding: 25px;
}

.news-title {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.4;
}

.news-summary {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: justify;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 10px;
}

.news-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.news-source {
    background: var(--button-bg);
    color: var(--text-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.news-category {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.categoria-nacional {
    background: #2d1b1b;
    color: #ff6b6b;
}

.categoria-internacional {
    background: #1b1b2d;
    color: #6bb6ff;
}

.categoria-prensa-extranjera {
    background: #240336;
    color: #825f96;
}

.categoria-cultura {
    background: #2d1b2d;
    color: #b66bff;
}

.categoria-deportes {
    background: #2d2d1b;
    color: #ffb66b;
}

.categoria-tecnologia {
    background: #1b2d1b;
    color: #6bff6b;
}

.categoria-entretenimiento {
    background: #2d1b2d;
    color: #ff6bb6;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.9em;
    white-space: nowrap;
}

.news-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.news-link {
    display: inline-block;
    background: var(--button-bg);
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.news-link:hover {
    background: var(--button-bg-hover);
    transform: scale(1.05);
}

.share-btn {
    background: #4a5568;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.share-btn:hover {
    background: #2d3748;
    transform: scale(1.05);
}

.stats {
    text-align: center;
    color: white;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.view-toggle {
    text-align: center;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.view-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.view-btn.active {
    background: var(--accent-color-dark);
    color: white;
    border-color: var(--accent-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 85, 85, 0.3);
}

/* Tema claro - mantener azul para botones de vista */
[data-theme="light"] .view-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.category-filter {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: inherit;
}

.filter-active-text {
    color: var(--text-secondary);
    font-size: 0.9em;
    font-style: italic;
    opacity: 0.8;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-color-dark);
    color: white;
    transform: scale(1.05);
}

/* Tema claro - mantener azul para botones de categoría */
[data-theme="light"] .filter-btn:hover,
[data-theme="light"] .filter-btn.active {
    background: var(--accent-color);
}

.filter-icon-standalone {
    width: 22px;
    height: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
    margin-left: 15px;
}

.filter-icon-standalone:hover {
    opacity: 1;
    transform: scale(1.1);
}

.filter-icon-standalone.active {
    opacity: 1;
    background: #6bb6ff;
    border-radius: 50%;
    padding: 3px;
    width: 24px;
    height: 24px;
    box-shadow: 0 0 10px rgba(107, 182, 255, 0.5);
}

/* Resaltado de búsqueda */
.search-highlight {
    background: #6bb6ff;
    color: #000;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: bold;
}

.no-image {
    height: 200px;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 2em;
    opacity: 0.7;
}

/* Estilos para móviles */
@media (max-width: 768px) {
    .view-toggle {
        margin-bottom: 12px;
        gap: 8px;
    }

    .view-btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }

    .category-filter {
        gap: 6px;
        margin-bottom: 25px;
    }

    .filter-btn {
        padding: 10px 16px;
        font-size: 0.85em;
        flex: 0 0 auto;
    }

    .info-panel.active {
        max-height: 500px;
    }

    .info-content {
        margin: 0 10px;
        padding: 15px;
        max-width: none;
    }

    .info-text {
        font-size: 0.9em;
        line-height: 1.5;
        margin-bottom: 15px;
    }

    .paypal-form {
        margin-top: 20px;
    }

    .paypal-btn {
        padding: 14px 28px;
        font-size: 1.1em;
        width: 100%;
        max-width: 250px;
    }

    .news-image {
        height: 300px;
        object-fit: contain;
        background-color: #222;
    }
}

@media (max-width: 480px) {
    .view-toggle {
        margin-bottom: 10px;
        gap: 6px;
    }

    .view-btn {
        padding: 7px 14px;
        font-size: 0.85em;
    }

    .category-filter {
        gap: 5px;
        margin-bottom: 20px;
        max-width: 100%;
    }

    .filter-btn {
        padding: 8px 12px;
        font-size: 0.8em;
        min-width: auto;
        flex: 0 0 auto;
    }

    .info-panel.active {
        max-height: 600px;
    }

    .info-content {
        margin: 0 5px;
        padding: 12px;
        border-radius: 8px;
    }

    .info-text {
        font-size: 0.85em;
        text-align: justify;
    }

    .header h1 {
        flex-wrap: wrap;
        gap: 10px;
    }

    .info-icon {
        width: 18px;
        height: 18px;
        font-size: 11px;
    }

    .sleep-info {
        font-size: 0.9em;
        padding: 6px 12px;
        margin: 8px auto;
        max-width: 350px;
        white-space: nowrap;
    }

    .contact-link {
        margin-top: 12px;
    }

    .contact-link a {
        font-size: 0.85em;
    }

    .news-image {
        height: 250px;
        object-fit: contain;
        background-color: #222;
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 2px solid #333;
    padding: 15px;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.cookie-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    gap: 20px;
}

.cookie-content p {
    margin: 0;
    flex: 1;
}

.cookie-content a {
    color: #6bb6ff;
    text-decoration: none;
    white-space: nowrap;
}

.cookie-content a:hover {
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cookie-btn.accept {
    background: #6bb6ff;
    color: white;
}

.cookie-btn.accept:hover {
    background: #5aa5ff;
    transform: scale(1.05);
}

.cookie-btn.reject {
    background: #666;
    color: white;
}

.cookie-btn.reject:hover {
    background: #777;
    transform: scale(1.05);
}

/* Cookie Policy Modal */
.cookie-policy {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
}

.policy-content {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
    margin: 20px;
}

.policy-content h3 {
    margin-top: 0;
    color: #6bb6ff;
    text-align: center;
}

.policy-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.policy-content li {
    margin: 8px 0;
    line-height: 1.4;
}

.close-btn {
    background: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    display: block;
    margin: 20px auto 0;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #555;
    transform: scale(1.05);
}

/* Advanced Filters */
.advanced-filters {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    margin-bottom: 20px;
}

.advanced-filters.active {
    max-height: 500px;
    opacity: 1;
}

.filters-content {
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 15px;
    padding: 20px;
    margin: 0 auto;
    max-width: 800px;
}

.search-section {
    margin-bottom: 20px;
}

.search-section input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #333;
    border-radius: 25px;
    background: #000;
    color: white;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.search-section input:focus {
    outline: none;
    border-color: #6bb6ff;
}

.search-section input::placeholder {
    color: #666;
}

.sources-section h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.source-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.source-checkbox:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #6bb6ff;
}

.source-checkbox.selected {
    background: rgba(107, 182, 255, 0.2);
    border-color: #6bb6ff;
}

.source-checkbox input {
    margin-right: 8px;
    accent-color: #6bb6ff;
}

.source-checkbox label {
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    flex: 1;
}

.source-count {
    color: #999;
    font-size: 0.8em;
    margin-left: 5px;
}

.filter-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.clear-filters-btn, .close-filters-btn {
    background: #333;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover, .close-filters-btn:hover {
    background: #555;
    transform: scale(1.05);
}

.close-filters-btn {
    background: #666;
}

.close-filters-btn:hover {
    background: #777;
}

/* Mobile styles for cookie banner */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .cookie-buttons {
        justify-content: center;
    }

    .policy-content {
        margin: 10px;
        padding: 20px;
    }

    .sources-grid {
        grid-template-columns: 1fr;
    }

    .filters-content {
        margin: 0 10px;
        padding: 15px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .advanced-filters.active {
        max-height: 80vh;
    }

    .filter-actions {
        flex-direction: column;
        gap: 10px;
    }

    .clear-filters-btn, .close-filters-btn {
        width: 100%;
        padding: 12px;
    }
}