/* Theme Settings */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Playfair+Display:wght@600;700;800;900&family=Public+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* LIGHT MODE (Original) */
    --bg: #FAF9F6;
    --bg-deep: #F0EFEB;
    --fg: #1A1A2E;
    --fg-light: #4A4A5A;
    --muted: #8B8B9E;
    --accent: #E8590C;
    --accent-light: #FFF4E6;
    --teal: #0D9488;
    --teal-light: #E6F7F5;
    --card: #FFFFFF;
    --border: #E8E6E1;
    --danger: #DC2626;
    --warning: #F59E0B;
    --success: #10B981;
    --info: #3B82F6;
    --header-bg: rgba(255, 255, 255, 0.8);
    --hero-overlay: linear-gradient(135deg, rgba(26,26,46,0.9) 0%, rgba(26,26,46,0.4) 100%);
}

[data-theme="dark"] {
    /* DARK MODE (Palantir Inspired) */
    --bg: #0f1115;
    --bg-deep: #161921;
    --fg: #e2e8f0;
    --fg-light: #94a3b8;
    --muted: #64748b;
    --accent: #f59e0b;
    --accent-light: rgba(245, 158, 11, 0.1);
    --teal: #14b8a6;
    --teal-light: rgba(20, 184, 166, 0.1);
    --card: rgba(22, 25, 33, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    --header-bg: rgba(15, 17, 21, 0.8);
    --hero-overlay: linear-gradient(135deg, rgba(15,17,21,0.95) 0%, rgba(15,17,21,0.6) 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { 
    font-family: 'Public Sans', sans-serif; 
    background-color: var(--bg); 
    color: var(--fg); 
    overflow-x: hidden; 
}

/* Base custom classes to replace hardcoded tailwind */
.theme-header { background: var(--header-bg) !important; }
.theme-card { background: var(--card) !important; border-color: var(--border) !important; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 3px; }

/* Ticker */
.ticker-wrap { 
    overflow: hidden; 
    background: var(--teal-light);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--teal-light);
    color: var(--teal); 
    font-family: 'Public Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.ticker { display: inline-flex; min-width: 200%; animation: ticker 60s linear infinite; white-space: nowrap; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* Hero Overlay */
.hero-overlay { background: var(--hero-overlay); }

/* Category Pills */
.cat-pill {
    padding: 6px 16px; 
    border-radius: 6px; 
    font-size: 13px; 
    font-weight: 500;
    cursor: pointer; 
    transition: all 0.2s ease; 
    border: 1px solid var(--border);
    background: transparent; 
    color: var(--fg-light); 
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cat-pill:hover { border-color: var(--teal); color: var(--teal); }
.cat-pill.active { background: var(--teal-light); color: var(--teal); border-color: var(--teal); }

/* Alerts */
.alert-badge { animation: pulse-badge 2s ease-in-out infinite; }
@keyframes pulse-badge { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Map */
#map { border-radius: 12px; z-index: 1; border: 1px solid var(--border); }
[data-theme="dark"] #map { filter: invert(90%) hue-rotate(180deg) brightness(85%) contrast(85%); }

/* Article Details */
.article-body p { margin-bottom: 1.35em; line-height: 1.9; color: var(--fg-light); font-size: 18px; }
.article-body p:first-of-type::first-letter {
    font-family: 'Playfair Display', serif; font-size: 3.6em; font-weight: 800;
    float: left; line-height: 0.85; margin: 0.05em 0.12em 0 0; color: var(--teal);
}
.article-body blockquote {
    border-left: 4px solid var(--teal); padding: 18px 26px; margin: 28px 0;
    background: var(--teal-light); border-radius: 0 14px 14px 0;
    font-style: italic; color: var(--fg); font-size: 16px; line-height: 1.7;
}
.article-body h3 {
    font-family: 'Playfair Display', serif; font-size: 1.55em; font-weight: 700;
    margin: 2em 0 0.7em; color: var(--fg);
}
.article-body ul { margin: 1.2em 0 1.6em 1.4em; color: var(--fg-light); }
.article-body ul li { margin-bottom: 0.6em; font-size: 17px; line-height: 1.75; }
.article-body ul li::marker { color: var(--teal); }
.progress-bar { position: fixed; top: 0; left: 0; height: 3.5px; background: var(--teal); z-index: 200; width: 0%; transition: width 0.1s linear; }

/* Dashboard Tables */
.index-table { width: 100%; text-align: left; border-collapse: separate; border-spacing: 0; }
.index-table th { padding: 12px; font-size: 12px; text-transform: uppercase; color: var(--fg-light); border-bottom: 1px solid var(--border); font-family: 'JetBrains Mono', monospace;}
.index-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--fg); }

/* Toast */
.toast-container { position: fixed; top: 60px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
    padding: 12px 16px; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 10px; min-width: 280px;
    background: var(--fg);
    border: 1px solid var(--border);
    animation: slideInToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), fadeOutToast 0.4s ease 4s forwards;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
@keyframes slideInToast { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOutToast { to { transform: translateX(120%); opacity: 0; } }

/* Alert Panel Animation */
.alert-panel {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.alert-panel.open {
    transform: translateX(0);
}

/* Search Box styling */
.search-box {
    width: 100%;
    background-color: var(--bg-deep);
    border-radius: 0.75rem;
    padding: 0.6rem 1rem 0.6rem 2.75rem;
    font-size: 0.875rem;
    color: var(--fg);
    border: 1px solid transparent;
    outline: none;
    transition: all 0.3s ease;
}
.search-box:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px var(--teal-light);
}


/* Added tab-btn styles */
.tab-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--teal);
}
.tab-btn.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
}
