:root {
    --bg: #0a0a0a;
    --card: #141414;
    --card-hover: #1a1a1a;
    --border: #222;
    --text: #fafafa;
    --text-dim: #888;
    --red: #ef4444;
    --green: #22c55e;
    --yellow: #eab308;
    --blue: #3b82f6;
    --purple: #a855f7;
}

/* LIGHT MODE */
[data-theme="light"] {
    --bg: #f8fafc;
    --card: #ffffff;
    --card-hover: #f1f5f9;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-dim: #64748b;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }

/* SCROLL PROGRESS */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--purple));
    z-index: 200;
    transition: width 0.1s;
    width: 0%;
}

/* OFFLINE BANNER */
.offline-banner {
    position: fixed;
    top: -50px;
    left: 0;
    right: 0;
    background: var(--yellow);
    color: #000;
    text-align: center;
    padding: 10px;
    font-size: .85rem;
    font-weight: 600;
    z-index: 300;
    transition: top 0.3s;
}
.offline-banner.visible {
    top: 0;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.5 } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* SKELETON LOADING */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.skeleton-card {
    background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 20px;
    height: 160px;
    border: 1px solid var(--border);
}

/* NAVBAR */
nav {
    position: fixed; top: 0; width: 100%; z-index: 100;
    padding: 16px 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}
[data-theme="light"] nav {
    background: rgba(248, 250, 252, 0.8);
}

.nav-inner {
    max-width: 1000px; margin: 0 auto; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
}

.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.5px; }
.logo span { color: var(--red); }

.nav-links { display: flex; gap: 20px; list-style: none; align-items: center; }
.nav-links a {
    font-size: .85rem; font-weight: 500; color: var(--text-dim);
    transition: color .2s;
}
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

/* THEME TOGGLE */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.theme-toggle:hover {
    color: var(--yellow);
    border-color: var(--yellow);
}

/* MOBILE MENU */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--card);
    z-index: 200;
    transition: right 0.3s ease;
    padding: 80px 24px 24px;
    border-left: 1px solid var(--border);
}
.mobile-menu.open { right: 0; }
.mobile-menu a {
    display: block;
    padding: 14px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    transition: color .2s;
}
.mobile-menu a:hover { color: var(--text); }
.mobile-menu .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.mobile-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* HERO */
.hero {
    padding: 120px 0 40px;
    text-align: center;
}

.hero-flag {
    width: 80px; height: 52px; border-radius: 8px;
    object-fit: cover; margin-bottom: 16px;
    border: 2px solid var(--border);
}

.hero h1 {
    font-size: 2.5rem; font-weight: 800; letter-spacing: -1.5px;
    margin-bottom: 8px;
}
.hero h1 span { color: var(--red); }

.hero-sub { color: var(--text-dim); font-size: .95rem; }

.hero-actions {
    margin-top: 20px; display: flex; gap: 12px;
    justify-content: center; flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px; border-radius: 100px;
    font-size: .85rem; font-weight: 600;
    border: 1px solid var(--border); background: var(--card);
    color: var(--text-dim); cursor: pointer;
    transition: all .2s; display: inline-flex; align-items: center; gap: 8px;
}
.action-btn:hover {
    border-color: var(--red); color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}
.action-btn.share { border-color: var(--green); color: var(--green); }
.action-btn.share:hover { background: rgba(34, 197, 94, 0.1); }
.action-btn.download { border-color: var(--blue); color: var(--blue); }
.action-btn.download:hover { background: rgba(59, 130, 246, 0.1); }

.auto-refresh {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 100px;
    background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--blue); font-size: .8rem; font-weight: 500;
    margin-top: 16px;
}
.auto-refresh i { animation: pulse 2s infinite; }

/* LAYOUT */
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* SECTION TITLE */
.section-title {
    font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px;
    margin: 40px 0 20px; display: flex; align-items: center; gap: 12px;
}
.section-title::before {
    content: ''; display: block; width: 24px; height: 2px;
    background: var(--red);
}

/* STATS */
.stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
}

.stat-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 24px;
    transition: all .2s; position: relative; overflow: hidden;
}
.stat-card:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
}

.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: 3px; border-radius: 20px 20px 0 0;
}
.stat-card.cases::before { background: var(--yellow); }
.stat-card.deaths::before { background: var(--red); }
.stat-card.recovered::before { background: var(--green); }
.stat-card.active::before { background: var(--blue); }

.stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; margin-bottom: 12px;
}
.stat-card.cases .stat-icon { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.stat-card.deaths .stat-icon { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.stat-card.recovered .stat-icon { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.stat-card.active .stat-icon { background: rgba(59, 130, 246, 0.15); color: var(--blue); }

.stat-label { font-size: .8rem; color: var(--text-dim); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 1.8rem; font-weight: 800; letter-spacing: -1px; }
.stat-rate { font-size: .75rem; color: var(--text-dim); margin-top: 4px; }
.stat-today {
    font-size: .75rem; font-weight: 600; margin-top: 8px;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 100px;
}
.stat-today.up { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.stat-today.down { background: rgba(34, 197, 94, 0.15); color: var(--green); }

/* EXTRA INFO */
.extra-grid {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 12px; margin-bottom: 40px;
}
.extra-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; padding: 16px; text-align: center;
    transition: all .2s;
}
.extra-card:hover { background: var(--card-hover); transform: translateY(-2px); }
.extra-value { font-size: 1.1rem; font-weight: 700; }
.extra-label { font-size: .7rem; color: var(--text-dim); margin-top: 4px; }

/* CHART */
.chart-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 24px;
    margin-bottom: 16px;
    transition: all .2s;
}
.chart-card:hover { background: var(--card-hover); }
.chart-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.chart-label { font-size: .9rem; font-weight: 600; }
.chart-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
    padding: 6px 12px; border-radius: 100px;
    font-size: .7rem; font-weight: 600;
    background: var(--card); border: 1px solid var(--border);
    color: var(--text-dim); cursor: pointer;
    transition: all .2s;
}
.filter-btn:hover, .filter-btn.active {
    border-color: var(--red); color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}
.chart-container { position: relative; height: 280px; }

.mode-toggle {
    display: flex; gap: 8px; margin-bottom: 16px;
    justify-content: center;
}
.mode-btn {
    padding: 8px 20px; border-radius: 100px;
    font-size: .8rem; font-weight: 600;
    background: var(--card); border: 1px solid var(--border);
    color: var(--text-dim); cursor: pointer;
    transition: all .2s;
}
.mode-btn:hover, .mode-btn.active {
    border-color: var(--red); color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

/* PIE CHART */
.pie-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px; margin-bottom: 40px;
}
.pie-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 24px;
}
.pie-container { position: relative; height: 250px; }

/* COMPARISON TABLE */
.compare-wrapper {
    overflow-x: auto; margin-bottom: 40px;
    border: 1px solid var(--border); border-radius: 20px;
}
.compare-table {
    width: 100%; border-collapse: collapse;
    background: var(--card);
    min-width: 600px;
}
.compare-table th, .compare-table td {
    padding: 12px 14px; text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: .8rem;
}
.compare-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim); font-weight: 600;
    font-size: .7rem; text-transform: uppercase;
}
[data-theme="light"] .compare-table th {
    background: rgba(0, 0, 0, 0.03);
}
.compare-table th:first-child,
.compare-table td:first-child { text-align: left; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: var(--card-hover); }
.country-cell { display: flex; align-items: center; gap: 10px; }
.country-flag { width: 24px; border-radius: 4px; }
.compare-table .highlight td {
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid var(--red);
}
.compare-table .highlight td:first-child { border-left: none; }
.rank { color: var(--text-dim); font-size: .7rem; width: 20px; }

/* MILESTONE */
.milestone-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 40px;
}
.milestone-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 16px; padding: 20px;
    position: relative; overflow: hidden;
    transition: all .2s;
}
.milestone-card:hover { background: var(--card-hover); transform: translateY(-2px); }
.milestone-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
}
.milestone-card.m1::before { background: var(--yellow); }
.milestone-card.m2::before { background: var(--red); }
.milestone-card.m3::before { background: var(--green); }
.milestone-card.m4::before { background: var(--blue); }
.milestone-number { font-size: 1.3rem; font-weight: 800; margin-bottom: 4px; }
.milestone-label { font-size: .75rem; color: var(--text-dim); }
.milestone-date { font-size: .7rem; color: var(--text-dim); margin-top: 8px; opacity: 0.6; }

/* VACCINE */
.vaccine-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 16px; margin-bottom: 24px;
}
.vaccine-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 20px;
    display: flex; align-items: center; gap: 16px;
    transition: all .2s;
}
.vaccine-card:hover { background: var(--card-hover); transform: translateY(-2px); }
.vaccine-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.vaccine-label { font-size: .8rem; color: var(--text-dim); }
.vaccine-value { font-size: 1.3rem; font-weight: 800; }
.vaccine-progress {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 20px; margin-bottom: 24px;
}
.progress-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.progress-header span { font-size: .9rem; font-weight: 600; }
.progress-percent { color: var(--purple); font-weight: 800; }
.progress-bar-container {
    height: 12px; background: rgba(168, 85, 247, 0.1);
    border-radius: 100px; overflow: hidden;
}
.progress-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--purple), #c084fc);
    border-radius: 100px; transition: width 1s ease;
}
.progress-note {
    font-size: .75rem; color: var(--text-dim); margin-top: 8px;
}
.vaccine-chart-container {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 24px;
    height: 250px; position: relative;
}

/* WORLD DATA */
.world-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 24px;
}
.world-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 20px; text-align: center;
    transition: all .2s;
}
.world-card:hover { background: var(--card-hover); transform: translateY(-2px); }
.world-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin: 0 auto 12px;
}
.world-label { font-size: .8rem; color: var(--text-dim); margin-bottom: 4px; }
.world-value { font-size: 1.5rem; font-weight: 800; }
.world-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border); border-radius: 20px;
}
.world-table {
    width: 100%; border-collapse: collapse;
    background: var(--card); min-width: 600px;
}
.world-table th, .world-table td {
    padding: 12px 14px; text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: .8rem;
}
.world-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim); font-weight: 600;
    font-size: .7rem; text-transform: uppercase;
}
[data-theme="light"] .world-table th {
    background: rgba(0, 0, 0, 0.03);
}
.world-table th:first-child,
.world-table td:first-child { text-align: left; }
.world-table tr:last-child td { border-bottom: none; }
.world-table tr:hover td { background: var(--card-hover); }

/* TIPS */
.tips-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px; margin-bottom: 40px;
}
.tip-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 20px; padding: 24px;
    display: flex; gap: 16px; align-items: flex-start;
    transition: all .2s;
}
.tip-card:hover { background: var(--card-hover); transform: translateY(-2px); }
.tip-icon {
    width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.tip-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.tip-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.tip-icon.yellow { background: rgba(234, 179, 8, 0.15); color: var(--yellow); }
.tip-icon.purple { background: rgba(168, 85, 247, 0.15); color: var(--purple); }
.tip-title { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.tip-desc { font-size: .8rem; color: var(--text-dim); line-height: 1.5; }

/* FOOTER */
footer {
    padding: 60px 0 0;
    border-top: 1px solid var(--border);
    font-size: .8rem;
    color: var(--text-dim);
    background: var(--card);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-brand .logo {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.footer-desc {
    font-size: .85rem;
    line-height: 1.6;
    color: var(--text-dim);
    max-width: 300px;
}

.footer-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--text-dim);
    transition: color .2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.footer-links a i {
    width: 16px;
    text-align: center;
    font-size: .75rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

.footer-copy p {
    font-size: .8rem;
    color: var(--text-dim);
}

.footer-social {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: all .2s;
}

.social-link:hover {
    background: var(--red);
    border-color: var(--red);
    color: white;
    transform: translateY(-2px);
}

/* SCROLL TO TOP */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--red);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
    z-index: 50;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}
.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}
.scroll-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.4);
}

/* INSTALL PROMPT */
.install-prompt {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}
.install-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.install-content i {
    color: var(--blue);
    font-size: 1.2rem;
}
.install-content span {
    font-size: .9rem;
    font-weight: 600;
}
.install-btn {
    background: var(--blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}
.install-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
}

/* LOADING */
.loading {
    text-align: center; padding: 60px 0;
    color: var(--text-dim);
}
.loading i { font-size: 2rem; animation: spin 1s linear infinite; }

/* RATE CARDS */
.rate-card {
    border-radius: 14px; padding: 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.rate-card .rate-icon { font-size: 2rem; opacity: 0.3; }
.rate-card .rate-label { font-size: .8rem; color: #888; }
.rate-card .rate-value { font-size: 1.5rem; font-weight: 800; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .extra-grid { grid-template-columns: repeat(2, 1fr); }
    .extra-card { padding: 12px 8px; }
    .extra-value { font-size: .9rem; }
    .nav-links { display: none; }
    .mobile-toggle { display: block; }
    .stat-value { font-size: 1.3rem; }
    .chart-container { height: 200px; }
    .pie-grid { grid-template-columns: 1fr; }
    .pie-container { height: 200px; }
    .compare-table { font-size: .75rem; }
    .compare-table th, .compare-table td { padding: 10px 8px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .vaccine-stats { grid-template-columns: 1fr; }
    .world-grid { grid-template-columns: repeat(2, 1fr); }
    .section-title { font-size: 1.2rem; }
    .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
