:root {
    --patriot-navy: #0b1f3a;
    --patriot-navy-2: #07162a;
    --patriot-red: #b31942;
    --patriot-red-2: #8f1335;
    --patriot-cream: #f7f3ea;
    --patriot-ink: #101827;
    --patriot-gold: #c9a227;
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-border: rgba(11, 31, 58, 0.18);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.25);
}

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

html {
    font-size: 16px;
}

body.presidential-theme {
    background: radial-gradient(1200px 700px at 20% -10%, rgba(201, 162, 39, 0.18), transparent 60%),
        radial-gradient(900px 600px at 110% 10%, rgba(179, 25, 66, 0.20), transparent 55%),
        linear-gradient(180deg, var(--patriot-navy) 0%, var(--patriot-navy-2) 100%);
    color: var(--patriot-cream);
    font-family: 'Merriweather', Georgia, serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body.presidential-theme a {
    color: var(--patriot-cream);
}

body.presidential-theme .terminal-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.25rem 1.5rem 3rem;
    position: relative;
}

@media (min-width: 1200px) {
    body.presidential-theme .terminal-container.wide {
        max-width: 1400px;
        width: 92%;
    }
}

body.presidential-theme .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-decoration: none;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 0.9rem;
    backdrop-filter: blur(6px);
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

body.presidential-theme .back-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

body.presidential-theme .terminal-header {
    margin-top: 1.25rem;
    border-radius: 14px 14px 0 0;
    padding: 0.9rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-bottom: none;
    background: linear-gradient(90deg, rgba(179, 25, 66, 0.95) 0%, rgba(247, 243, 234, 0.95) 50%, rgba(11, 31, 58, 0.95) 100%);
}

body.presidential-theme .terminal-btn {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background: rgba(255, 255, 255, 0.85);
}

body.presidential-theme .btn-close,
body.presidential-theme .btn-min,
body.presidential-theme .btn-max {
    background: rgba(255, 255, 255, 0.85);
}

body.presidential-theme .terminal-title {
    margin-left: auto;
    margin-right: auto;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: rgba(7, 22, 42, 0.92);
}

body.presidential-theme .main-card {
    background: var(--card-bg);
    color: var(--patriot-ink);
    border: 1px solid var(--card-border);
    border-radius: 0 0 14px 14px;
    padding: 2.25rem;
    box-shadow: var(--shadow);
}

body.presidential-theme .section-header {
    margin-top: 0;
    margin-bottom: 1.4rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(11, 31, 58, 0.18);
}

body.presidential-theme .section-header h1 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 2.15rem;
    color: var(--patriot-navy);
    letter-spacing: 0.01em;
}

body.presidential-theme .section-header h1::before {
    content: "";
}

body.presidential-theme .stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: rgba(11, 31, 58, 0.04);
    border: 1px solid rgba(11, 31, 58, 0.12);
    border-radius: 12px;
}

body.presidential-theme .stat-item {
    text-align: center;
    padding: 0.85rem 0.75rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(11, 31, 58, 0.10);
}

body.presidential-theme .stat-value {
    display: block;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 800;
    font-size: 1.65rem;
    line-height: 1.2;
    color: var(--patriot-navy);
}

body.presidential-theme .stat-value small {
    display: block;
    margin-top: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(16, 24, 39, 0.68);
}

body.presidential-theme .stat-label {
    display: block;
    margin-top: 0.35rem;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--patriot-red);
}

body.presidential-theme .presidents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

body.presidential-theme .president-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(11, 31, 58, 0.14);
    border-radius: 14px;
    padding: 1.25rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    overflow: hidden;
}

body.presidential-theme .president-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(179, 25, 66, 0.12) 0%, rgba(201, 162, 39, 0.10) 38%, rgba(11, 31, 58, 0.12) 100%);
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

body.presidential-theme .president-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    border-color: rgba(11, 31, 58, 0.22);
}

body.presidential-theme .president-card:hover::before {
    opacity: 1;
}

body.presidential-theme .president-photo {
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
    display: inline-block;
}

body.presidential-theme .president-photo img {
    width: 110px;
    height: 130px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(11, 31, 58, 0.35);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    filter: saturate(1.05) contrast(1.05);
}

body.presidential-theme .president-number {
    position: absolute;
    top: -10px;
    left: -10px;
    padding: 4px 8px;
    border-radius: 10px;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 900;
    font-size: 0.85rem;
    background: var(--patriot-navy);
    color: var(--patriot-cream);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

body.presidential-theme .president-number.republican { background: var(--patriot-red); }
body.presidential-theme .president-number.democrat { background: #2343a5; }
body.presidential-theme .president-number.democratic-republican { background: linear-gradient(135deg, #2343a5 50%, var(--patriot-red) 50%); }
body.presidential-theme .president-number.whig { background: var(--patriot-gold); color: var(--patriot-ink); }
body.presidential-theme .president-number.federalist { background: #1f2a44; }

body.presidential-theme .president-card h4 {
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0.35rem 0 0.75rem;
    color: var(--patriot-navy);
    position: relative;
}

body.presidential-theme .president-card h4::before {
    content: "";
}

body.presidential-theme .president-card p {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: rgba(16, 24, 39, 0.82);
    font-size: 0.88rem;
    margin-bottom: 0.65rem;
    line-height: 1.55;
    position: relative;
}

body.presidential-theme .president-card .label {
    color: rgba(11, 31, 58, 0.70);
    font-weight: 700;
}

body.presidential-theme .president-card .value {
    color: rgba(16, 24, 39, 0.88);
    font-weight: 600;
}

body.presidential-theme .positive {
    color: #0f7a3c;
    font-weight: 800;
}

body.presidential-theme .negative {
    color: #b42318;
    font-weight: 800;
}

body.presidential-theme .research-block {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(11, 31, 58, 0.16);
    border-radius: 12px;
    padding: 1.25rem 1.25rem;
    color: rgba(16, 24, 39, 0.90);
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.75;
}

body.presidential-theme .summary-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(11, 31, 58, 0.14);
    border-radius: 12px;
}

body.presidential-theme .summary-card p {
    color: rgba(16, 24, 39, 0.85);
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

body.presidential-theme .summary-card h4 {
    font-family: 'Merriweather', Georgia, serif;
    letter-spacing: 0.01em;
}

body.presidential-theme .summary-card.positive h4 {
    color: #0f7a3c;
}

body.presidential-theme .summary-card.negative h4 {
    color: #b42318;
}

body.presidential-theme .article-teaser {
    color: rgba(7, 22, 42, 0.88);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(11, 31, 58, 0.14);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-style: italic;
}

body.presidential-theme .view-details-btn,
body.presidential-theme .edit-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(11, 31, 58, 0.18);
    background: rgba(255, 255, 255, 0.75);
    color: var(--patriot-navy);
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

body.presidential-theme .view-details-btn:hover,
body.presidential-theme .edit-link:hover {
    background: rgba(11, 31, 58, 0.06);
    border-color: rgba(11, 31, 58, 0.28);
    transform: translateY(-1px);
}

body.presidential-theme .footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 1.8rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

body.presidential-theme .footer-nav a {
    color: rgba(247, 243, 234, 0.92);
    text-decoration: none;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 650;
    font-size: 0.95rem;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

body.presidential-theme .footer-nav a:hover {
    background: rgba(255, 255, 255, 0.10);
    transform: translateY(-1px);
}

body.presidential-theme .footer-nav a i {
    margin-right: 0.45rem;
    color: var(--patriot-gold);
}

@media (max-width: 600px) {
    body.presidential-theme .main-card {
        padding: 1.4rem;
    }

    body.presidential-theme .section-header h1 {
        font-size: 1.75rem;
    }

    body.presidential-theme .presidents-grid {
        grid-template-columns: 1fr;
    }

    body.presidential-theme .terminal-container.president-details .main-card {
        background: var(--card-bg) !important;
        color: var(--patriot-ink) !important;
        border: 1px solid var(--card-border) !important;
        box-shadow: var(--shadow) !important;
        padding: 1.4rem !important;
        border-radius: 14px !important;
    }

    body.presidential-theme .terminal-container.president-details .section-header {
        border-bottom: 1px solid rgba(11, 31, 58, 0.18) !important;
    }

    body.presidential-theme .terminal-container.president-details .section-header h1 {
        color: var(--patriot-navy) !important;
    }

    body.presidential-theme .terminal-container.president-details .section-header small {
        color: rgba(16, 24, 39, 0.70) !important;
        font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    }

    body.presidential-theme .terminal-container.president-details .president-nav {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    body.presidential-theme .terminal-container.president-details .president-nav .nav-btn {
        padding: 0.45rem 0.65rem !important;
        border-radius: 999px !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    body.presidential-theme .terminal-container.president-details .president-nav select {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.45rem 2.0rem 0.45rem 0.75rem !important;
    }
}
