:root {
    --primary-color: #9d2b2b;
    --primary-dark: #671414;
    --primary-light: #c84b31;
    --secondary-color: #1a2a3a;
    --accent-color: #e06d53;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2b2d42;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.site-header {
    background-color: var(--secondary-color);
    color: #ffffff;
    padding: 1rem 0;
    border-bottom: 3px solid var(--primary-color);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.site-tagline {
    font-size: 0.8rem;
    color: #a0aec0;
    display: block;
    margin-top: 0.1rem;
}

.site-nav {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.nav-link {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.external {
    background-color: var(--primary-color);
    color: #ffffff;
}

.nav-link.external:hover {
    background-color: var(--primary-light);
}

/* Content */
.page-content {
    flex: 1;
    padding: 2.5rem 0;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-dark));
    color: #ffffff;
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    line-height: 1.25;
}

.hero p {
    font-size: 1.15rem;
    color: #e2e8f0;
    max-width: 850px;
    margin-bottom: 1.5rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #d1563a;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Cards */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.card h2 {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.card h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin: 1.2rem 0 0.5rem 0;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    margin: 1.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--card-bg);
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f1f5f9;
    color: var(--secondary-color);
    font-weight: 600;
}

tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-high {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-moderate {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-low {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Figures */
.figure-container {
    margin: 2rem 0;
    text-align: center;
}

.figure-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.figure-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    text-align: left;
}

/* Globe Container */
#globe-container {
    width: 100%;
    height: 600px;
    background-color: #050508;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.globe-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(26, 42, 58, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.globe-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-bottom: 6px;
}

.globe-tooltip {
    position: absolute;
    display: none;
    background: rgba(15, 23, 42, 0.95);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 20;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-width: 260px;
}

/* Publication Card */
.publication-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.pub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.2rem;
}

pre#bibtex-code {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1.2rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Footer */
.site-footer {
    background-color: var(--secondary-color);
    color: #94a3b8;
    padding: 2.5rem 0;
    font-size: 0.9rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}

.footer-col p {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--accent-color);
    text-decoration: none;
}

.footer-col a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .hero h1 {
        font-size: 1.7rem;
    }
    #globe-container {
        height: 450px;
    }
}

/* ---- CoSE dark-mode overrides ---- */
html[data-theme="dark"] {
    --primary-color: #ef8a8a;
    --primary-dark: #f5b7b7;
    --primary-light: #f09070;
    --secondary-color: #1e293b;
    --accent-color: #f09070;
    --bg-light: #0f172a;
    --card-bg: #1e293b;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #334155;
}

html[data-theme="dark"] .site-header {
    background-color: #0f172a;
    border-bottom-color: var(--primary-color);
}

html[data-theme="dark"] .nav-link {
    color: #cbd5e1;
}

html[data-theme="dark"] th {
    background-color: #1e293b;
    color: var(--accent-color);
}

html[data-theme="dark"] tr:hover {
    background-color: #0f172a;
}

html[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #0f172a, var(--primary-dark));
}

html[data-theme="dark"] .publication-card {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] pre#bibtex-code {
    background-color: #0f172a;
}

html[data-theme="dark"] .site-footer {
    background-color: #020617;
}

html[data-theme="dark"] .badge-high {
    background-color: #450a0a;
    color: #fca5a5;
}

html[data-theme="dark"] .badge-moderate {
    background-color: #451a03;
    color: #fcd34d;
}

html[data-theme="dark"] .badge-low {
    background-color: #0c4a6e;
    color: #7dd3fc;
}

html[data-theme="dark"] #globe-container {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
