﻿:root {
    /* Renk Paleti (Modern, EÄŸitim TemalÄ±, GÃ¶z Yormayan) */
    --bg-main: #f0f4f8;
    /* Soft mavi-gri arkaplan */
    --bg-panel: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --primary: #3b82f6;
    /* Soft Mavi */
    --primary-hover: #2563eb;
    --success: #10b981;
    /* Soft YeÅŸil */
    --danger: #ef4444;
    /* Soft KÄ±rmÄ±zÄ± */
    --warning: #f59e0b;
    /* Soft Turuncu */
    --purple: #8b5cf6;
    /* Soft Mor */

    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --border-radius: 16px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* --- YARDIMCI SIFATLAR --- */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.fw-500 {
    font-weight: 500;
}

.fw-bold {
    font-weight: 700;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.text-blue {
    color: var(--primary);
}

.text-green {
    color: var(--success);
}

.text-orange {
    color: var(--warning);
}

.text-red {
    color: var(--danger);
}

.text-purple {
    color: var(--purple);
}

.bg-orange {
    background-color: var(--warning);
}

.bg-blue {
    background-color: var(--primary);
}

.bg-green {
    background-color: var(--success);
}

/* --- ÃœST BAR (TOP BAR) --- */
.top-bar {
    background-color: var(--bg-panel);
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    width: 280px;
}

.country-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-country-tag {
    background-color: var(--bg-main);
    color: var(--text-main);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
}

.header-select {
    width: 280px;
    background-color: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-weight: 600;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.time-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.current-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-main);
    background-color: var(--bg-main);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
}

.playback-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    background: var(--primary);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}

.btn-icon.outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-icon.outline:hover {
    background: var(--primary);
    color: white;
}

.speed-toggles {
    display: flex;
    background: var(--bg-main);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-left: 8px;
}

.btn-speed {
    background: transparent;
    border: none;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-speed.active {
    background: var(--text-main);
    color: white;
}

/* --- ANA LAYOUT (DASHBOARD) --- */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 12px;
    padding: 10px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.panel {
    background: var(--bg-panel);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-height: 0;
}

.scrollable-panel {
    overflow-y: hidden;
}

/* Orta panel: asla scroll olmasın */
.middle-panel {
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

/* Sağ panel: scroll olabilir */
.right-panel {
    overflow-y: auto;
}

.panel-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.panel-header h2 {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-weight: 800;
}

/* --- SOL PANEL (KONTROLLER) --- */
.left-panel {
    overflow-y: auto;
}

.left-panel .text-sm {
    font-size: 0.75rem;
}

.control-section {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-color);
}

.section-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

/* Sliders */
.investment-sliders {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.slider-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
}

.modern-range {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.modern-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-main);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Toggle Switch */
.policy-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.policy-list::-webkit-scrollbar {
    width: 4px;
}

.policy-list::-webkit-scrollbar-track {
    background: transparent;
}

.policy-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-container:hover {
    background: #f1f5f9;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary);
    background-image: linear-gradient(90deg, var(--success) var(--cooldown-progress, 0%), transparent var(--cooldown-progress, 0%));
}

input:not(:checked)+.slider {
    background-color: #cbd5e1;
    background-image: linear-gradient(90deg, #94a3b8 var(--cooldown-progress, 0%), transparent var(--cooldown-progress, 0%));
}

input:checked+.slider:before {
    transform: translateX(18px);
}

/* Inline Cooldown Popup */
.inline-cooldown-popup {
    position: fixed;
    background: rgba(30, 41, 59, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: fadeInOut 2.5s ease forwards;
    white-space: nowrap;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }

    15% {
        opacity: 1;
        transform: translateY(0);
    }

    85% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* Dropdowns */
.modern-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-main);
    background-color: #f8fafc;
    cursor: pointer;
    transition: border 0.2s;
}

.modern-select:focus {
    border-color: var(--primary);
    outline: none;
}


/* --- ORTA PANEL (METRÄ°KLER VE GRAFÄ°KLER) --- */

/* Dev NÃ¼fus KartÄ± */
.hero-metric-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
    color: white;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    position: relative;
}

.hero-flag {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 105px;
    height: 70px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    /* Yuvarlatılmış köşeler */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
    z-index: 2;
    transition: all 0.5s ease;
}

.hero-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 2px;
}

.hero-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 6px;
}

.mini-metrics-row {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.mini-metric {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pill-blue {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.pill-red {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid #dc2626;
}

.pill-yellow {
    background: rgba(245, 158, 11, 0.9);
    border: 1px solid #d97706;
}

/* 4 Ana Kart IzgarasÄ± */
.main-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 14px;
    flex-shrink: 0;
}

.m-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.m-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.m-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.card-blue .m-icon {
    background: #eff6ff;
    color: var(--primary);
}

.card-purple .m-icon {
    background: #f5f3ff;
    color: var(--purple);
}

.card-green .m-icon {
    background: #ecfdf5;
    color: var(--success);
}

.card-orange .m-icon {
    background: #fffbeb;
    color: var(--warning);
    border: 1px solid #fef3c7;
}

.m-data {
    display: flex;
    flex-direction: column;
}

.m-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
}

.m-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

/* Grafikler */
.charts-wrapper {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 0 14px 10px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.chart-line-wrapper {
    flex: 3;
}

.chart-pie-wrapper {
    flex: 1;
    min-width: 200px;
}

.chart-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chart-box h4 {
    font-size: 0.75rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    flex-shrink: 0;
}

.canvas-container {
    position: relative;
    flex: 1;
    min-height: 150px;
    width: 100%;
}


/* --- SAÄ PANEL (KAPASÄ°TE & OLAYLAR) --- */

.panel-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header-inline {
    margin-bottom: 10px;
}

.panel-header-inline h2 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-weight: 700;
}

/* Kapasite BarlarÄ± */
.cap-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cap-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cap-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 700;
}

.cap-title {
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cap-percent {
    color: var(--text-muted);
}

.cap-bar-bg {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.cap-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Etkiler Kutusu */
.effects-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 12px;
}

.effect-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.effect-item:last-child {
    border-bottom: none;
}

.effect-cause {
    font-weight: 600;
    color: var(--text-main);
}

.effect-arrow {
    color: var(--text-muted);
}

.effect-result {
    font-weight: 600;
}

.result-up {
    color: var(--success);
}

.result-down {
    color: var(--danger);
}


/* Loglar */
.log-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 0px;
    /* Alttan taÅŸma engellemesi */
}

.events-log {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    /* Limit yÃ¼kseklik */
    padding-right: 4px;
}

.event-item {
    background: #fff;
    border-left: 3px solid var(--primary);
    padding: 10px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    border-left-width: 3px;
    animation: slideIn 0.3s ease-out forwards;
}

.event-item .time {
    display: block;
    font-size: 0.75rem;
    color: var(--primary);
    margin-bottom: 2px;
    font-weight: 800;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar Ã–zelleÅŸtirme */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* =========================================================
   YENİ OLAY UI TASARIMI (EVENT BANNER & ACCENTS)
   ========================================================= */

/* Ana Nüfus Kartı Üzerindeki Banner */
.active-event-banner {
    position: absolute;
    top: 12px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 5;
    animation: fadeIn 0.3s ease;
}

.active-event-banner i {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

#event-title {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
}

.event-time-left {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 10px;
}

/* Kart Vurguları (Accent Borders) */
.m-card {
    border-top: 4px solid transparent;
    transition: all 0.3s ease;
}

/* Olay Aktifken Arka Plan (Tint) ve Vurgular */
.val-box.event-active {
    position: relative;
    overflow: hidden;
}

.val-box.event-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    transition: background 0.5s ease;
}

/* Z-Index ayarı ana içerik üstte kalsın diye */
.val-box.event-active .v-title,
.val-box.event-active .v-value,
.val-box.event-active .v-subs {
    position: relative;
    z-index: 2;
}

/* Renk Paletleri (Pastel & Yumuşak) */
/* 1. Kuraklık (Kum Sarısı - Amber) */
.e-drought.val-box::before {
    background: rgba(217, 119, 6, 0.4);
}

/* amber-600 */
.e-drought.m-card {
    border-top-color: rgba(217, 119, 6, 0.5);
}

/* 2. Salgın (Epidemic - Soft Kırmızı) */
.e-epidemic.val-box::before {
    background: rgba(220, 38, 38, 0.4);
}

/* red-600 */
.e-epidemic.m-card {
    border-top-color: rgba(220, 38, 38, 0.5);
}

/* 3. Pandemi (Koyu Pembe/Mor Pastel) */
.e-pandemic.val-box::before {
    background: rgba(190, 24, 93, 0.4);
}

/* rose-700 */
.e-pandemic.m-card {
    border-top-color: rgba(190, 24, 93, 0.5);
}

/* 4. İç Savaş (Bordo Pastel) */
.e-civil_war.val-box::before {
    background: rgba(127, 29, 29, 0.4);
}

/* red-900 */
.e-civil_war.m-card {
    border-top-color: rgba(127, 29, 29, 0.5);
}

/* 5. Kriz (Lila / Gri Pastel) */
.e-crisis.val-box::before {
    background: rgba(107, 114, 128, 0.4);
}

/* gray-500 */
.e-crisis.m-card {
    border-top-color: rgba(107, 114, 128, 0.5);
}

/* 6. Boom (Soft Yeşil) */
.e-boom.val-box::before {
    background: rgba(5, 150, 105, 0.4);
}

/* emerald-600 */
.e-boom.m-card {
    border-top-color: rgba(5, 150, 105, 0.5);
}


/* =========================================================
   TOOLTIP STYLES
   ========================================================= */
.tooltip-parent {
    position: relative;
    cursor: help;
}

.tooltip-parent:hover {
    z-index: 100000;
}

.tooltip-parent::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: rgba(15, 23, 42, 0.85);
    /* Yarı opak kutucuk */
    color: white;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    white-space: normal;
    width: max-content;
    max-width: 200px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 99999;
    pointer-events: none;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tooltip-parent::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.85) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 99999;
    pointer-events: none;
}

.tooltip-parent:hover::after,
.tooltip-parent:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* Tooltip alanının altına açılması için (başlık barı için) */
.tooltip-parent.tooltip-bottom::after {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(-10px);
}

.tooltip-parent.tooltip-bottom::before {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(-10px);
    border-color: transparent transparent rgba(15, 23, 42, 0.85) transparent;
}

.tooltip-parent.tooltip-bottom:hover::after,
.tooltip-parent.tooltip-bottom:hover::before {
    transform: translateX(-50%) translateY(8px);
}

.m-card.tooltip-parent:hover::after,
.m-card.tooltip-parent:hover::before,
.mini-metric.tooltip-parent:hover::after,
.mini-metric.tooltip-parent:hover::before {
    transform: translateX(-50%) translateY(8px);
}

.m-card.tooltip-parent::after,
.m-card.tooltip-parent::before,
.mini-metric.tooltip-parent::after,
.mini-metric.tooltip-parent::before {
    bottom: auto;
    top: 100%;
}

.m-card.tooltip-parent::before,
.mini-metric.tooltip-parent::before {
    border-color: transparent transparent rgba(15, 23, 42, 0.85) transparent;
    top: calc(100% - 12px);
}

/* --- BÖLÜM 13: GELİŞMİŞ OLAY MOTORU --- */
.event-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.event-badge.show {
    opacity: 1;
    transform: translateY(0);
}

.event-badge.hidden {
    display: none;
}

.event-pandemic {
    background: rgba(220, 38, 38, 0.9);
}

.event-epidemic {
    background: rgba(234, 88, 12, 0.9);
}

.event-drought {
    background: rgba(202, 138, 4, 0.9);
}

.event-civil_war {
    background: rgba(153, 27, 27, 0.9);
}

.event-boom {
    background: rgba(22, 163, 74, 0.9);
}

.event-crisis {
    background: rgba(147, 51, 234, 0.9);
}

.overlay-pandemic {
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.12) 0%, rgba(220, 38, 38, 0) 100%);
}

.overlay-epidemic {
    background: linear-gradient(180deg, rgba(234, 88, 12, 0.1) 0%, rgba(234, 88, 12, 0) 100%);
}

.overlay-drought {
    background: linear-gradient(180deg, rgba(202, 138, 4, 0.1) 0%, rgba(202, 138, 4, 0) 100%);
}

.overlay-civil_war {
    background: linear-gradient(180deg, rgba(153, 27, 27, 0.12) 0%, rgba(153, 27, 27, 0) 100%);
}

.overlay-boom {
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.08) 0%, rgba(22, 163, 74, 0) 100%);
}

.overlay-crisis {
    background: linear-gradient(180deg, rgba(147, 51, 234, 0.1) 0%, rgba(147, 51, 234, 0) 100%);
}

/* --- NEWS TICKER --- */
.news-ticker-bar {
    display: flex;
    align-items: center;
    background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
    color: #f8fafc;
    font-size: 0.7rem;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
    height: 26px;
    position: relative;
}

.ticker-label {
    background: #ef4444;
    color: white;
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    z-index: 2;
    flex-shrink: 0;
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.ticker-content span {
    display: inline-block;
    padding-left: 100%;
    animation: ticker-scroll var(--ticker-duration, 12s) linear infinite;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* --- TREND ICONS --- */
.trend-icon {
    font-size: 0.6rem;
    margin-left: 4px;
    vertical-align: middle;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

.trend-neutral {
    color: var(--text-muted);
    opacity: 0.5;
}

/* --- NEW EVENT TYPES --- */
.event-migration_wave {
    background: rgba(59, 130, 246, 0.9);
}

.event-crisis_small {
    background: rgba(147, 51, 234, 0.7);
}

.event-crisis_medium {
    background: rgba(147, 51, 234, 0.85);
}

.event-crisis_large {
    background: rgba(127, 29, 29, 0.9);
}

.overlay-migration_wave {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0) 100%);
}

.overlay-crisis_small {
    background: linear-gradient(180deg, rgba(147, 51, 234, 0.08) 0%, rgba(147, 51, 234, 0) 100%);
}

.overlay-crisis_medium {
    background: linear-gradient(180deg, rgba(147, 51, 234, 0.1) 0%, rgba(147, 51, 234, 0) 100%);
}

.overlay-crisis_large {
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.12) 0%, rgba(127, 29, 29, 0) 100%);
}

.d-none {
    display: none !important;
}

/* --- INTRO OVERLAY --- */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    background: transparent;
}

.intro-text-group {
    text-align: center;
    opacity: 0;
    transform: scale(0.96);
    animation: introFadeIn 0.7s ease forwards;
}

.intro-title {
    font-family: 'Inter', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0;
    letter-spacing: -2px;
    line-height: 1.1;
}

.intro-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    color: #475569;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 4px;
}

/* Credit lines on intro screen */
.intro-credit-line {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #475569;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 18px;
    margin-bottom: 2px;
}

.intro-powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.intro-powered-by img {
    height: 24px;
    width: auto;
    filter: grayscale(1) opacity(0.8);
    transition: filter 0.3s;
}

.intro-overlay.fade-out .intro-text-group {
    animation: introFadeOut 0.6s ease forwards;
}

.intro-overlay.done {
    display: none;
}

@keyframes introFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.96);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes introFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-18px) scale(1);
    }
}

/* --- INTRO HIDDEN STATE (for staggered reveal) --- */
.intro-hidden {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.intro-hidden.intro-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Cards get a subtle pop-in */
.c-card.intro-hidden {
    transform: translateY(20px) scale(0.97);
    pointer-events: none;
}

.c-card.intro-hidden.intro-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* --- COUNTRY REVEAL SCREEN --- */
.country-reveal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: revealFadeIn 0.5s ease forwards;
}

.reveal-card {
    text-align: center;
    max-width: 400px;
    width: 90%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.reveal-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.reveal-country-name {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
}

.reveal-flag {
    width: 96px;
    height: 64px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin: 0 auto 1.5rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.reveal-stats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reveal-stats li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.reveal-stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.reveal-stat-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: #1e293b;
}

.country-reveal.fade-out {
    animation: revealFadeOut 0.5s ease forwards;
}

@keyframes revealFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.97);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes revealFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.97);
    }
}

/* --- START SCREEN --- */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

/* Canvas ve Açık Tema Arka Plan */
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    /* En arkada */
    pointer-events: none;
}

.start-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Soft airy background */
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #f0f4f8 50%, #e2e8f0 100%);
    z-index: -4;
    pointer-events: none;
}

.start-bg-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 1;
    z-index: -2;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.start-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.start-content {
    text-align: center;
    max-width: 1200px;
    padding: 1rem 2rem;
    position: relative;
    z-index: 10;
    transform: translateY(-40px);
}

.start-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0px;
    letter-spacing: -2px;
}

.start-subtitle {
    font-size: 1.5rem;
    color: #475569;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

.start-desc {
    font-size: 1.15rem;
    color: #64748b;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.country-cards {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.c-card {
    background: rgba(255, 255, 255, 0.6);
    /* Glassmorphism açık tema */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 1.5rem;
    width: 250px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-bottom: 3.5rem;
}

.c-card:hover {
    transform: translateY(-8px) scale(1.05);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.c-card-congo:hover {
    border-color: rgba(16, 185, 129, 0.5);
}

.c-card-estonia:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

.c-card-balanced:hover {
    border-color: rgba(45, 212, 191, 0.5);
}

.c-card-random:hover {
    border-color: rgba(168, 85, 247, 0.5);
    /* Purple accent */
}

.c-flag {
    width: 56px;
    height: 42px;
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #64748b;
}

.c-card-balanced .c-flag {
    background: transparent;
    box-shadow: none;
}

.c-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.4rem;
    letter-spacing: 0.5px;
}

.c-desc-card {
    font-size: 0.85rem;
    font-style: italic;
    color: #475569;
    margin-bottom: 1rem;
}

.c-info {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%;
}

.c-info li {
    font-size: 0.82rem;
    color: #334155;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.c-info li::before {
    content: "•";
    color: #64748b;
    font-weight: bold;
    margin-right: 0.5rem;
}

.c-card-congo .c-info li::before {
    color: #10b981;
}

.c-card-estonia .c-info li::before {
    color: #3b82f6;
}

.c-card-balanced .c-info li::before {
    color: #14b8a6;
}

.c-level {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.9rem;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    background: rgba(248, 250, 252, 0.8);
    border-top: 1px solid rgba(226, 232, 240, 1);
}

.level-dynamic {
    color: #059669;
    /* daha koyu yeşil */
}

.level-hard {
    color: #2563eb;
    /* daha koyu mavi */
}

.level-balanced {
    color: #0f766e;
    /* daha koyu teal */
}

.level-random {
    color: #a855f7;
    /* purple-500 */
}

/* Footer Detayları */
.start-footer-left,
.start-footer-right {
    position: absolute;
    bottom: 20px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    z-index: 2;
}

.start-footer-left {
    left: 30px;
}

.start-footer-right {
    right: 30px;
}

/* --- ARAYÜZ TANITIM MODU --- */
body.tutorial-active .dashboard,
body.tutorial-active .top-bar {
    pointer-events: none;
    user-select: none;
}

.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9000;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.tutorial-box {
    background: white;
    border-radius: var(--radius-sm);
    padding: 24px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 9001;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: fixed;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.tutorial-box h3 {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
}

.tutorial-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.tut-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.tut-nav {
    display: flex;
    gap: 8px;
}

.btn-tut {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tut:hover {
    background: var(--primary-hover);
}

.btn-tut.outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-tut.outline:hover {
    background: #eff6ff;
}

.btn-tut.skip {
    background: #e2e8f0;
    color: var(--text-muted);
}

.btn-tut.skip:hover {
    background: #cbd5e1;
}

.tut-checkbox-container {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
}

.tut-checkbox-container label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* SPOTLIGHT EFEKTİ */
.tutorial-highlight {
    position: relative;
    z-index: 9002 !important;
    background: white;
    border-radius: inherit;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.4), 0 0 20px rgba(0, 0, 0, 0.5) !important;
    pointer-events: none !important;
    transition: all 0.3s ease;
}

/* --- GÖREVLER SİSTEMİ (MISSIONS) --- */
.mission-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    position: relative;
    cursor: pointer;
}

.mission-card:hover {
    z-index: 1000;
}

.mission-card.completed {
    border-left: 3px solid var(--success);
    background: #f0fdf4;
    opacity: 0.85;
}

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mission-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.mission-status-icon {
    font-size: 0.75rem;
}

.mission-details {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: max-content;
    max-width: 250px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    flex-direction: column;
    gap: 4px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}

.mission-card:hover .mission-details {
    display: flex;
}

.mission-details::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 15px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent rgba(15, 23, 42, 0.95) transparent;
}

.mission-desc {
    font-size: 0.75rem;
    color: #f1f5f9;
    line-height: 1.3;
}

.mission-progress {
    font-size: 0.7rem;
    font-weight: 700;
    color: #38bdf8;
    margin-top: 2px;
}

/* --- TOAST BİLDİRİM SİSTEMİ --- */
.toast-msg {
    background: white;
    min-width: 250px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--success);
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: auto;
    animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-header {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toast-body {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-msg.fade-out {
    animation: toastOut 0.4s forwards;
}

@keyframes toastOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}