:root {
    /* JET BLACK PROFESSIONAL THEME */
    --bg-body: #000000;
    --bg-card: #0a0a0a;
    --bg-hover: #141414;
    --text-main: #ffffff;
    --text-muted: #a3a3a3;
    --border-color: #262626;
    --accent: #00dc82;
    --accent-glow: rgba(0, 220, 130, 0.15);
    --badge-bg: #262626;
    --btn-bg: #262626;
}

/* Light Mode Overrides */
.light-mode {
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --bg-hover: #f8fafc;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --border-color: #e5e7eb;
    --accent: #059669;
    --badge-bg: #e5e7eb;
    --btn-bg: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- PROGRESS BAR --- */
.progress-container {
    position: fixed; top: 0; left: 0; z-index: 2000;
    width: 100%; height: 4px; background: transparent;
}
.progress-bar {
    height: 4px; background: var(--accent); width: 0%;
    box-shadow: 0 0 10px var(--accent);
}

/* --- SIDE BUTTONS --- */
.side-controls {
    position: absolute; top: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 10px; z-index: 100;
}
.icon-btn {
    background: var(--bg-card); border: 1px solid var(--border-color);
    color: var(--text-main); width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; font-size: 1.2rem;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* --- HEADER --- */
header {
    text-align: center; padding: 40px 20px 20px;
    background: linear-gradient(to bottom, var(--bg-body), transparent);
    border-bottom: 1px solid var(--border-color); position: relative;
}
.header-content {
    display: flex; flex-direction: column; align-items: center; gap: 15px;
    max-width: 1200px; margin: 0 auto;
}
h1 { font-size: 2.5rem; letter-spacing: -1px; margin-bottom: 5px; }

/* --- SEARCH BAR --- */
.search-wrapper {
    width: 100%; max-width: 500px; height: 0; overflow: hidden;
    transition: height 0.3s ease; margin-bottom: 10px;
}
.search-wrapper.open { height: 60px; }
.search-input {
    width: 100%; padding: 12px 20px; border-radius: 30px;
    border: 2px solid var(--border-color); background-color: var(--bg-card);
    color: var(--text-main); font-size: 1rem; outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* --- NAV & TABS --- */
.top-nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }
.top-nav a {
    color: var(--text-muted); text-decoration: none; font-weight: 600;
    padding: 8px 16px; border-radius: 8px; transition: all 0.2s;
}
.top-nav a.active, .top-nav a:hover { color: var(--accent); background: rgba(0, 220, 130, 0.1); }

.tabs { display: flex; justify-content: center; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.tab-btn {
    background-color: var(--btn-bg); border: 1px solid transparent;
    color: var(--text-muted); padding: 8px 18px; border-radius: 30px;
    cursor: pointer; transition: all 0.2s; font-size: 0.9rem; font-weight: 500;
}
.tab-btn:hover { color: var(--text-main); background-color: var(--border-color); }
.tab-btn.active {
    background-color: var(--accent); color: #000; font-weight: 700;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* --- CHART --- */
.chart-container {
    width: 100%; max-width: 350px; height: 350px;
    margin: 10px auto; position: relative;
}

/* --- NEWS GRID --- */
.news-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px; max-width: 1200px; margin: 40px auto; padding: 0 20px; flex-grow: 1;
}
.card {
    background-color: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 16px; overflow: hidden; display: flex; flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover {
    transform: translateY(-5px); border-color: var(--accent);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}
.card-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.card-header { display: flex; justify-content: space-between; margin-bottom: 15px; align-items: center; }

/* BADGES */
.region-badge {
    background-color: var(--badge-bg); font-size: 0.7rem; padding: 4px 10px;
    border-radius: 6px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-main);
}
.read-time { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

.region-badge.Americas { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.region-badge.Europe { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
.region-badge.Asia { color: #f43f5e; background: rgba(244, 63, 94, 0.1); }
.region-badge.Oceania { color: #06b6d4; background: rgba(6, 182, 212, 0.1); }
.region-badge.Global { color: #10b981; background: rgba(16, 185, 129, 0.1); }

/* CONTENT */
.card h3 { font-size: 1.15rem; margin-bottom: 12px; line-height: 1.4; font-weight: 700; }
.card a { color: var(--text-main); text-decoration: none; transition: color 0.2s; }
.card a:hover { color: var(--accent); }
.summary {
    color: var(--text-muted); font-size: 0.95rem; margin-bottom: 20px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.meta {
    margin-top: auto; font-size: 0.8rem; color: var(--text-muted);
    padding-top: 15px; border-top: 1px solid var(--border-color);
    display: flex; justify-content: space-between;
}

/* --- FOOTER --- */
footer {
    margin-top: 50px; padding: 40px 20px; border-top: 1px solid var(--border-color);
    background-color: var(--bg-card); text-align: center; color: var(--text-muted); font-size: 0.85rem;
}
.footer-content { max-width: 800px; margin: 0 auto; }
.footer-links { margin-top: 15px; display: flex; justify-content: center; gap: 20px; }
.footer-links a { color: var(--accent); text-decoration: none; font-weight: 600; }

@media (max-width: 600px) {
    .side-controls { top: 10px; right: 10px; }
    h1 { font-size: 2rem; }
}
