:root {
    --bg-color: #0d1117;
    --panel-bg: #161b22;
    --border-color: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --brand-gold: #c69b3d;
    --live-red: #da3633;

    --winner-1: #c62828;
    /* Fuat Balıkesir - Kırmızı */
    --winner-2: #1565c0;
    /* Orhan İstanbul - Mavi */
    --winner-3: #2e7d32;
    /* Hüseyin Kars - Yeşil */
    --winner-4: #6a1b9a;
    /* Hayriye Ankara - Mor */
    --winner-5: #ef6c00;
    /* Fulya Konya - Turuncu */
    --tie: #4a5568;
    /* Berabere - Gri/Mavi */
    --uncast: #21262d;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-overlay.hidden {
    display: none;
}

.login-box {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-logo {
    height: 80px;
    margin-bottom: 1.5rem;
}

.login-box h2 {
    color: var(--brand-gold);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.login-box input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.login-box input:focus {
    border-color: var(--brand-gold);
}

.login-btn {
    width: 100%;
    padding: 0.9rem 1rem;
    background: #3465AE;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #2a528d;
}

.login-error {
    color: var(--live-red);
    margin-top: 1rem;
    font-size: 0.85rem;
    min-height: 1.2em;
}

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

body {
    font-family: 'Public Sans', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Header */
.main-header {
    background-color: var(--panel-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gss-logo {
    height: 50px;
    width: auto;
}

.presentation-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex-grow: 1;
    text-align: center;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        opacity: 1;
    }
}



.sub-title {
    font-weight: 600;
    color: var(--brand-gold);
}

.stats-summary {
    display: flex;
    gap: 2rem;
}

.summary-item .label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.summary-item .value {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 350px 1fr 350px;
    height: calc(100vh - 100px);
    gap: 1px;
    background-color: var(--border-color);
}

.sidebar {
    background-color: var(--bg-color);
    padding: 1.5rem;
    overflow-y: auto;
}

.panel-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--brand-gold);
    padding-left: 10px;
}

/* Map Section */
.map-section {
    background-color: #0b0e14;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.svg-turkiye-haritasi {
    width: 100%;
    max-width: 900px;
}

.svg-turkiye-haritasi svg {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

#svg-turkiye-haritasi path {
    cursor: pointer;
    transition: fill 0.2s ease, transform 0.2s ease;
    stroke: #000;
    stroke-width: 0.5;
}

#svg-turkiye-haritasi path:hover {
    filter: brightness(1.2);
    stroke-width: 1.5;
    stroke: #fff;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

/* Candidate Cards */
.candidate-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.candidate-card:hover {
    border-color: var(--brand-gold);
    background: #1c2128;
}

.candidate-card.selected {
    border-color: var(--brand-gold);
    background: #1c2128;
    box-shadow: 0 0 10px rgba(198, 155, 61, 0.2);
}

.cand-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.cand-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.win-count {
    font-weight: 800;
    color: var(--brand-gold);
}

.progress-container {
    height: 8px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    transition: width 1s ease-out;
}

/* City Details */
.city-info-card {
    background: var(--panel-bg);
    border-radius: 8px;
    overflow: hidden;
}

.city-header {
    background: #3465AE;
    color: #fff;
    padding: 1rem;
    font-weight: 800;
    font-size: 1.2rem;
}

.vote-table {
    width: 100%;
    border-collapse: collapse;
}

.vote-table tr {
    border-bottom: 1px solid var(--border-color);
}

.vote-table td {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
}

.vote-table .vote-val {
    text-align: right;
    font-weight: 600;
}

.placeholder-text {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 5rem;
}

/* Voted Provinces List (Bottom) */
.voted-provinces-container {
    margin-top: 2rem;
    width: 100%;
    max-width: 900px;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    display: none;
    /* Shown when candidate selected */
}

.voted-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: center;
}

.voted-provinces-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.city-pill {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    color: var(--text-primary);
}

/* Map Highlighting */
#svg-turkiye-haritasi g path {
    fill-opacity: 0.3;
    /* Dim by default */
}

#svg-turkiye-haritasi g.highlight path {
    fill-opacity: 1 !important;
}

#svg-turkiye-haritasi g.highlight:hover path {
    filter: brightness(1.2);
}

.main-footer {
    text-align: center;
    font-size: 10px;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-text {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

.btn-text:hover {
    color: #fff;
    border-color: #fff;
}

.map-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Branch Sections for Multi-Branch Cities */
.branch-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.branch-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.branch-header {
    background: var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.branch-president {
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Mobile Responsiveness */
@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 280px 1fr 280px;
    }
}

@media (max-width: 900px) {
    .main-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .logo {
        flex-wrap: wrap;
        justify-content: center;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .gss-logo {
        height: 32px;
    }

    .stats-summary {
        gap: 1rem;
    }

    .dashboard-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
    }

    .sidebar.leaderboard {
        order: 1;
        max-height: 300px;
    }

    .map-section {
        order: 2;
        padding: 1rem;
    }

    .sidebar.detail-panel {
        order: 3;
    }

    .voted-provinces-container {
        order: 4;
    }
}

@media (max-width: 600px) {
    .main-header {
        padding: 0.5rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .gss-logo {
        height: 28px;
    }

    .sub-title {
        font-size: 0.7rem;
    }

    .summary-item .value {
        font-size: 1rem;
    }

    .sidebar {
        padding: 1rem;
    }

    .panel-title {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    .candidate-card {
        padding: 0.75rem;
    }

    .cand-name {
        font-size: 0.8rem;
    }

    .win-count {
        font-size: 0.75rem;
    }

    .city-pill {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}