:root {
    /* Color Palette - Dark Mode Default */
    --bg-main: #0f172a; /* Slate 900 */
    --bg-secondary: #1e293b; /* Slate 800 */
    --bg-card: rgba(30, 41, 59, 0.7);
    
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --text-muted: #64748b;
    
    /* Vibrant Accents */
    --accent-primary: #3b82f6; /* Blue 500 */
    --accent-glow: rgba(59, 130, 246, 0.5);
    --accent-secondary: #8b5cf6; /* Violet 500 */
    
    /* Categories Colors */
    --cat-politica: #ef4444; /* Red */
    --cat-economia: #10b981; /* Emerald */
    --cat-deportes: #f59e0b; /* Amber */
    --cat-tecnologia: #06b6d4; /* Cyan */
    
    /* Layout */
    --container-width: 1200px;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

/* Header */
.main-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.8rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-glow);
}

.logo .dot {
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-shadow: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
}

.main-nav a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    padding: 5px 0;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--text-primary);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-primary);
    transition: width var(--transition-normal);
    box-shadow: 0 0 8px var(--accent-glow);
}

.main-nav a.active::after, .main-nav a:hover::after {
    width: 100%;
}

/* AI Badge */
.ai-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Views Setup */
.view {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.view.active-view {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

main {
    padding: 40px 20px;
    min-height: calc(100vh - 200px);
}

/* Tags / Categories */
.category-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.tag-politica { background: rgba(239, 68, 68, 0.15); color: var(--cat-politica); border: 1px solid rgba(239, 68, 68, 0.3); }
.tag-economia { background: rgba(16, 185, 129, 0.15); color: var(--cat-economia); border: 1px solid rgba(16, 185, 129, 0.3); }
.tag-deportes { background: rgba(245, 158, 11, 0.15); color: var(--cat-deportes); border: 1px solid rgba(245, 158, 11, 0.3); }
.tag-tecnologia { background: rgba(6, 182, 212, 0.15); color: var(--cat-tecnologia); border: 1px solid rgba(6, 182, 212, 0.3); }

/* Hero Section */
.hero-article {
    position: relative;
    height: 500px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 60px;
    cursor: pointer;
    group: hero;
}

.hero-img-wrap {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
}

.hero-article img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.hero-article:hover img {
    transform: scale(1.05);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    z-index: 10;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    max-width: 800px;
}

.meta-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.meta-source {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    font-weight: 600;
}

.meta-source svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.section-title h2 {
    font-size: 1.8rem;
    white-space: nowrap;
}

.section-title .line {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    flex-grow: 1;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.card-img {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .card-img img {
    transform: scale(1.08);
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.news-card:hover h3 {
    color: var(--accent-primary);
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Single Article View */
.article-header {
    max-width: 800px;
    margin: 0 auto 40px auto;
    text-align: center;
}

.article-header h1 {
    font-size: 3rem;
    margin: 20px 0;
}

.article-meta-large {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: var(--text-secondary);
}

.article-hero-img {
    width: 100%;
    max-width: 1000px;
    height: 500px;
    margin: 0 auto 50px auto;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.article-hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.15rem;
    color: rgba(248, 250, 252, 0.9);
}

.article-body p {
    margin-bottom: 24px;
}

/* AI Source Citation Callout */
.source-citation {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    position: relative;
}

.source-citation::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 6rem;
    font-family: serif;
    color: rgba(255, 255, 255, 0.05);
    line-height: 1;
}

.citation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.citation-header svg {
    fill: var(--accent-primary);
}

.citation-header span {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 1px;
}

.source-citation p {
    position: relative;
    z-index: 2;
    font-style: italic;
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-primary);
}

.source-name {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    font-style: normal;
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Footer */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 60px 0 20px 0;
    margin-top: 60px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.footer-brand span {
    color: var(--accent-primary);
}

.footer-brand .dot {
    color: var(--text-secondary);
}

.footer-brand p {
    color: var(--text-secondary);
    max-width: 350px;
}

.footer-links {
    display: flex;
    gap: 30px;
}

.footer-links a {
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .article-header h1 {
        font-size: 2.2rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 30px;
    }
}
