:root {
    --primary-color: #004b23;
    /* Emerald Green */
    --secondary-color: #d4af37;
    /* Gold */
    --accent-color: #006400;
    --text-color: #212529;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Amiri', serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Studies Platform */
.studies-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.study-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--secondary-color);
}

.study-badge {
    background: rgba(212, 175, 55, 0.1);
    color: var(--secondary-color);
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 3px;
    display: inline-block;
    margin-bottom: 1rem;
}

.study-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.action-btns {
    display: flex;
    gap: 12px;
}

.btn-action {
    background: #f0f2f5;
    border: 1px solid #ddd;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-action.preview:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-action.download:hover {
    color: #28a745;
    border-color: #28a745;
}

.btn-action.share:hover {
    color: #007bff;
    border-color: #007bff;
}

.btn-discuss {
    background: var(--light-bg);
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

/* Digital Diplomacy */
.light-section {
    background: #f0f2f5;
}

.digital-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.digital-item.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.podcast-player {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1.5rem;
}

.play-icon {
    font-size: 1.5rem;
    cursor: pointer;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 3rem;
    border: 1px solid var(--secondary-color);
    width: 70%;
    max-width: 900px;
    border-radius: 15px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.close-modal {
    position: absolute;
    left: 20px;
    top: 20px;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.modal-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    font-size: 2.22rem;
}

.modal-text-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    padding: 1rem 0;
    white-space: pre-wrap;
    /* Preserves line breaks from dashboard */
}

.modal-footer {
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

/* Print Styles for PDF */
@media print {

    /* Hide everything on the page */
    body * {
        display: none !important;
    }

    /* Specifically show the modal and its printable content */
    #article-modal,
    #article-modal *,
    .modal-printable,
    .modal-printable * {
        display: block !important;
    }

    #article-modal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .modal-content {
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 2cm !important;
        /* Standard margin for PDF/Print */
    }

    .modal-header h2 {
        color: #000 !important;
        font-size: 24pt !important;
    }

    .no-print,
    .close-modal {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .digital-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--glass-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    font-family: 'Playfair Display', serif;
}

.logo-img {
    height: 60px;
    width: 60px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        0 0 15px rgba(212, 175, 55, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--white);
}

.logo-img:hover {
    transform: rotate(5deg) scale(1.1);
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(212, 175, 55, 0.5);
}

.logo span {
    background: linear-gradient(45deg, var(--primary-color), #006400);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

.btn-login {
    background: var(--primary-color);
    color: var(--white) !important;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease !important;
}

.btn-login:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

#hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('pcds_hero_official.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
}

.hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, var(--white), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2.5rem;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
}

.btn.primary {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.btn.secondary {
    border: 2px solid var(--white);
    color: var(--white);
}

.btn:hover {
    transform: scale(1.05);
}

/* Sections */
section {
    padding: 6rem 0;
}

.section-title {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 3.5rem;
    color: var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
    margin: 1rem auto;
}

.gold-text {
    color: var(--secondary-color);
}

.dark-section {
    background: var(--primary-color);
    color: var(--white);
}

/* Stats */
#stats {
    background: var(--white);
    margin-top: -50px;
    position: relative;
    z-index: 10;
    box-shadow: var(--shadow);
    border-radius: 10px;
    margin-left: 5%;
    margin-right: 5%;
    padding: 3rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
}

.counter-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-item p {
    font-weight: 600;
    color: #666;
}

/* Units Grid */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.unit-card {
    background: var(--white);
    padding: 2.5rem 1.5rem;
    border-radius: 15px;
    text-align: center;
    transition: all 0.4s ease;
    border: 1px solid #eee;
}

.unit-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    border-color: var(--secondary-color);
}

.unit-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.unit-card h3 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.unit-link {
    display: inline-block;
    margin-top: 1.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 700;
}

/* High-Contrast Professional Map Styles */
.world-map-wrapper {
    position: relative;
    width: 100%;
    background: #000c05;
    /* Solid Deep Green */
    background-image:
        linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    border-radius: 15px;
    padding: 0;
    border: 2px solid rgba(212, 175, 55, 0.4);
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.8);
    cursor: grab;
}

/* Remove the dimming overlay if it exists or adjust it */
.world-map-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 5, 2, 0.6) 100%);
    pointer-events: none;
    z-index: 1;
}

.world-map-wrapper:active {
    cursor: grabbing;
}

.country-path {
    fill: rgba(0, 46, 21, 0.4);
    /* Deep Emerald Land */
    stroke: rgba(212, 175, 55, 0.6);
    /* Vibrant Gold Borders */
    stroke-width: 1.5;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.country-path:hover {
    fill: rgba(212, 175, 55, 0.2);
    stroke: #ffd700;
    stroke-width: 2.5;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
}

.map-controls {
    position: absolute;
    bottom: 25px;
    left: 25px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    z-index: 20;
    padding: 8px;
    background: rgba(0, 15, 5, 0.8);
    backdrop-filter: blur(12px);
    border-radius: 50px;
    border: 1px solid rgba(212, 175, 55, 0.5);
}

.map-controls button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--secondary-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-controls button:hover {
    background: var(--secondary-color);
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 15px var(--secondary-color);
}

#map-pan-group {
    transition: transform 0.2s cubic-bezier(0.1, 0.7, 1.0, 0.1);
}

#world-map-svg {
    width: 100%;
    height: auto;
}

.world-bg path {
    stroke: rgba(212, 175, 55, 0.4);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.2));
}

.active-region {
    fill: rgba(212, 175, 55, 0.25) !important;
    stroke: #ffd700 !important;
    stroke-width: 2.5 !important;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
}

.active-node {
    fill: white !important;
    r: 10 !important;
    filter: drop-shadow(0 0 20px white) drop-shadow(0 0 40px var(--secondary-color));
    stroke-width: 3 !important;
}

.map-path {
    fill: var(--secondary-color);
    stroke: #fff;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 8px var(--secondary-color));
    transition: all 0.3s ease;
}

.map-path.has-diplomat {
    fill: rgba(212, 175, 55, 0.3);
    stroke: var(--secondary-color);
}

.map-path:hover {
    fill: #fff !important;
    r: 10 !important;
    filter: drop-shadow(0 0 15px #fff);
}

.map-path.has-diplo.map-overlay-info {
    position: absolute;
    top: 25px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 5;
    font-family: monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.compass-icon {
    font-size: 1.5rem;
    opacity: 0.6;
    animation: rotate 10s infinite linear;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.map-tooltip {
    position: fixed;
    display: none;
    padding: 0;
    background: rgba(0, 20, 10, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    overflow: hidden;
}

.tooltip-header {
    background: rgba(212, 175, 55, 0.2);
    padding: 8px 15px;
    font-weight: bold;
    color: var(--secondary-color);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.tooltip-body {
    padding: 12px 15px;
}

.rank-tag {
    font-size: 0.75rem;
    opacity: 0.7;
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.name-val {
    font-size: 1rem;
    font-weight: 600;
}

.atlas-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
    align-items: flex-start;
}

.search-box input {
    width: 100%;
    padding: 1rem;
    border-radius: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    margin-top: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

@keyframes pulse {
    0% {
        r: 6;
        opacity: 1;
    }

    50% {
        r: 10;
        opacity: 0.7;
    }

    100% {
        r: 6;
        opacity: 1;
    }
}