:root {
    --bg-dark: #020617;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --emerald-400: #34d399;
    --rose-400: #fb7185;
    --slate-800: #1e293b;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--slate-800); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* Background elements */
.bg-elements { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.glow { position: absolute; border-radius: 50%; filter: blur(120px); }
.glow-1 { top: -10%; left: -10%; width: 40%; height: 40%; background: rgba(99, 102, 241, 0.1); }
.glow-2 { top: 20%; right: -10%; width: 30%; height: 50%; background: rgba(52, 211, 153, 0.05); }
.glow-3 { bottom: -10%; left: 20%; width: 50%; height: 30%; background: rgba(251, 113, 133, 0.05); }

.container { max-width: 1280px; margin: 0 auto; padding: 6rem 2rem; transition: opacity 0.5s ease; min-height: 100vh; display: flex; flex-direction: column; }
.view-hidden { display: none !important; opacity: 0; }
.view-active { display: flex; opacity: 1; animation: fadeIn 0.5s forwards; }

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

/* Header */
.header { margin-bottom: 5rem; position: relative; z-index: 10; }
.live-update { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 1rem; border-radius: 999px; background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.2); color: var(--indigo-400); font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.4em; margin-bottom: 2.5rem; }
.dot, .ping { width: 8px; height: 8px; border-radius: 50%; background: var(--indigo-500); }
.ping { position: absolute; animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite; opacity: 0.75; }
@keyframes ping { 75%, 100% { transform: scale(2.5); opacity: 0; } }

.title { font-size: clamp(4rem, 10vw, 9rem); font-weight: 900; line-height: 0.8; margin-bottom: 2.5rem; letter-spacing: -0.05em; mix-blend-mode: difference; }
.gradient-text { background: linear-gradient(to right, var(--indigo-400), var(--emerald-400), var(--rose-400)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { font-size: 1.25rem; color: var(--text-muted); font-weight: 300; max-width: 600px; line-height: 1.8; }
.italic { font-style: italic; color: white; font-weight: 500; }
/* Stats */
.stats { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 6rem; align-items: flex-end; }
.stat-item { display: flex; flex-direction: column; transition: all 0.3s ease; padding: 0.5rem 1rem; border-radius: 1rem; margin: -0.5rem -1rem; position: relative; border: 1px solid transparent; }
.stat-item:hover { background: rgba(255, 255, 255, 0.05); }
.stat-active { background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.2); }
.stat-label { font-size: 0.625rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0.25rem; }
.stat-value { font-size: 2.5rem; font-weight: 900; line-height: 1; display: flex; align-items: center; gap: 0.75rem; }
.filter-dot { width: 6px; height: 6px; background: var(--indigo-400); border-radius: 50%; box-shadow: 0 0 10px var(--indigo-400); }
.stat-divider { width: 1px; height: 40px; background: rgba(255, 255, 255, 0.1); }
.text-emerald { color: var(--emerald-400); }
.text-rose { color: var(--rose-400); }

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

/* Components: Card */
.glass { background: rgba(255, 255, 255, 0.02); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.05); }
.card { display: block; text-decoration: none; color: inherit; border-radius: 2.5rem; overflow: hidden; transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer; }
.card:hover { background: rgba(255, 255, 255, 0.06); transform: translateY(-10px); box-shadow: 0 40px 80px -20px rgba(0,0,0,0.6); }
.card-img-wrap { position: relative; height: 260px; overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; transition: transform 1s ease, opacity 0.5s ease; }
.card:hover .card-img { transform: scale(1.08); opacity: 1; }
.img-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-dark), transparent); opacity: 0.8; transition: opacity 0.5s; }
.card:hover .img-overlay { opacity: 0.5; }
.card-source-badge { position: absolute; top: 1.5rem; left: 1.5rem; display: flex; align-items: center; gap: 0.5rem; z-index: 2; }
.sentiment-dot { width: 8px; height: 8px; border-radius: 50%; opacity: 0.9; box-shadow: 0 0 10px currentColor; }
.dot-positiva { background: var(--emerald-400); color: var(--emerald-400); }
.dot-negativa { background: var(--rose-400); color: var(--rose-400); }
.dot-neutral { background: var(--text-muted); color: var(--text-muted); }
.source-text { font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.25em; color: rgba(255, 255, 255, 0.9); text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.card-content { padding: 2.5rem 2rem; position: relative; }
.card-date { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 1rem; }
.card-title { font-size: 1.6rem; font-weight: 700; line-height: 1.35; color: var(--text-main); margin-bottom: 2rem; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.3s; }
.card:hover .card-title { color: white; }
.card-footer { display: flex; justify-content: space-between; align-items: center; opacity: 0.3; transition: opacity 0.4s ease, transform 0.4s ease; transform: translateY(10px); }
.card:hover .card-footer { opacity: 1; transform: translateY(0); }
.read-more { font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.2em; color: var(--indigo-400); }
.line { width: 40px; height: 1px; background: rgba(99, 102, 241, 0.5); transition: width 0.4s; }
.card:hover .line { width: 60px; }

/* Detail View */
.nav-back { margin-bottom: 4rem; z-index: 10; position: relative; }
.back-link { background: none; border: none; font-family: inherit; color: var(--text-muted); display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: color 0.3s; font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.25em; padding: 0; }
.back-link:hover { color: white; }
.icon-circle { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.1); display: flex; align-items: center; justify-content: center; transition: all 0.3s; background: rgba(0,0,0,0.2); backdrop-filter: blur(4px); }
.back-link:hover .icon-circle { border-color: rgba(255, 255, 255, 0.4); transform: translateX(-4px); background: rgba(255,255,255,0.05); }

/* Fixed Detail Nav */
#nav-back { 
    position: fixed; 
    top: 2rem; 
    left: 2rem;
    z-index: 2000; 
    margin-bottom: 0;
}
.back-link {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.75rem 1.5rem 0.75rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Card Read Status */
.card-read { opacity: 0.6; filter: saturate(0.8); }
.card-read:hover { opacity: 0.9; filter: saturate(1); }
.read-tag { color: var(--indigo-400); font-weight: 900; margin-left: 0.5rem; opacity: 0.8; }

.hero-wrap { position: relative; height: 500px; border-radius: 3.5rem; overflow: hidden; margin-bottom: 4rem; display: flex; align-items: flex-end; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(40%); opacity: 0.7; transition: filter 1s; }
.hero-wrap:hover .hero-img { filter: grayscale(0%); opacity: 0.9; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%); }
.hero-content { position: relative; z-index: 1; padding: 4rem; width: 100%; }
.hero-badges { display: flex; gap: 1rem; margin-bottom: 2rem; align-items: center; }
.badge-source { font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.25em; background: white; color: black; padding: 0.35rem 1rem; border-radius: 4px; }
.badge-sentiment { font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.25em; }
.hero-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900; color: white; line-height: 1.1; letter-spacing: -0.02em; }

.article-body { max-width: 760px; margin: 0 auto; }
.meta-info { display: flex; align-items: center; gap: 1rem; color: var(--text-muted); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 2.5rem; margin-bottom: 4rem; }
.paragraph { font-size: 1.35rem; line-height: 1.85; color: #cbd5e1; margin-bottom: 2.5rem; font-weight: 300; }
.paragraph::selection { background: rgba(99, 102, 241, 0.4); color: white; }
.paragraph:first-of-type::first-letter { float: left; font-size: 6rem; line-height: 0.8; font-weight: 900; padding-right: 1rem; color: white; margin-top: 0.3rem; }

.article-footer { border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 3rem; display: flex; justify-content: space-between; align-items: center; margin-top: 6rem; flex-wrap: wrap; gap: 2rem; }
.footer-note { font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; font-style: italic; }
.source-link { color: var(--indigo-400); text-decoration: none; font-size: 0.65rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.25em; display: flex; align-items: center; gap: 0.75rem; transition: color 0.3s; }
.source-link:hover { color: var(--indigo-500); }
.source-link svg { transition: transform 0.3s; }
.source-link:hover svg { transform: translateX(4px); }

/* Main Footer */
.footer { border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 4rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.65rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.15em; margin-top: 8rem; }
.footer-right { display: flex; gap: 2rem; }
.footer-right span { opacity: 0.5; transition: opacity 0.3s; cursor: pointer; }
.footer-right span:hover { opacity: 1; color: white; }

@media (max-width: 1024px) {
    .hero-wrap { height: 400px; border-radius: 2.5rem; }
    .hero-content { padding: 3rem 2rem; }
}

@media (max-width: 768px) {
    .container { padding: 4rem 1.5rem; }
    .stats { flex-direction: column; align-items: flex-start; gap: 1.5rem; margin-bottom: 4rem; }
    .stat-divider { display: none; }
    .footer { flex-direction: column; gap: 2rem; text-align: center; }
    .hero-wrap { height: auto; min-height: 400px; }
    .paragraph { font-size: 1.15rem; }
}
