/* --- BASE STYLES --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    text-align: center;
    padding: 2rem 1rem;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

h1 { margin: 0; color: #b30000; } /* Turkish Red */
p { color: #666; }

.controls {
    margin-top: 1.5rem;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

input, select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 250px;
    max-width: 100%;
}

/* --- PARLIAMENT MAP --- */
.parliament-map {
    position: relative;
    width: 100%;             /* Let it fill the screen on phones */
    max-width: 800px;        /* Stop it from getting too huge on desktop */
    margin: 0 auto;
    overflow: visible;
}

.seat {
    position: absolute;
    width: 10px;  
    height: 10px; 
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.2s, box-shadow 0.2s;
}

.seat:hover {
    transform: translate(-50%, -50%) scale(1.8);
    z-index: 10;
}

.seat.faded {
    opacity: 0.1; 
}

/* --- PARTY COLORS --- */
.akp { background-color: #FFCC00; } 
.chp { background-color: #E3000F; } 
.mhp { background-color: #8B0000; } 
.dem { background-color: #800080; } 
.iyi { background-color: #00BFFF; } 
.saadet { background-color: #FF1493; } 
.gelecek { background-color: #2E8B57; } 
.deva { background-color: #00008B; } 
.yrp { background-color: #FF0000; } 
.tip { background-color: #B22222; } 
.dp { background-color: #FF4500; } 
.hudapar { background-color: #008000; } 
.emep { background-color: #FFD700; } 
.dbp { background-color: #CCCC00; } 
.dsp { background-color: #1E90FF; } 
.bagimsiz { background-color: #808080; } 
.yeniyol { background-color: #008080; } 

/* --- MODAL (POPUP) --- */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden { display: none; }

.modal-content {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh; 
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allows the entire white box to scroll */
}

.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.contact-info {
    background: #f1f1f1;
    padding: 10px;
    border-radius: 5px;
    margin: 15px 0;
}

.voting-history {
    margin-top: 15px;
    flex-grow: 1;
}

.voting-history li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- EXPORT PANEL --- */
.export-section {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 50px;
}

.export-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-width: 800px;
    width: 90%;
    overflow: hidden; /* Keeps the rounded corners neat when collapsed */
}

/* The clickable header */
.export-summary {
    padding: 15px 30px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none; /* Hides default browser arrow */
    background-color: #f8f9fa;
    transition: background-color 0.2s;
}

.export-summary::-webkit-details-marker {
    display: none; /* Hides default arrow in Safari/Chrome */
}

.export-summary:hover {
    background-color: #f1f3f5;
}

.export-summary h2 { margin: 0; color: #333; font-size: 1.3rem; }

.toggle-icon {
    font-size: 1.2rem;
    color: #666;
    transition: transform 0.3s ease;
}

/* Rotates the arrow when the details tag is open */
details[open] .toggle-icon {
    transform: rotate(180deg);
}

.export-content {
    padding: 20px 30px;
    border-top: 1px solid #eee;
}

.export-content p { font-size: 0.9rem; margin-top: 0; margin-bottom: 20px; color: #666; }

.export-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    background-color: #fcfcfc;
}

/* --- CHECKBOX STYLING --- */
.group-header {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: block;
}

.checkbox-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: #fcfcfc;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    height: 100%;
    box-sizing: border-box;
}

.checkbox-box label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin: 0; 
    font-size: 0.95rem;
}

.checkbox-box input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.download-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.download-btn:hover { background-color: #218838; }

/* --- MP STATISTICS PANEL --- */
.stats-panel {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.stat-box {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 15px;
    min-width: 110px;
    cursor: help;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    line-height: 1.2;
}

/* --- VOTE BADGES --- */
.vote-kabul { 
    background-color: #28a745; 
    color: white; 
    padding: 4px 12px; 
    border-radius: 5px; 
    font-weight: bold; 
    font-size: 0.85rem; 
    text-align: center; 
    min-width: 80px;
}

.vote-ret { 
    background-color: #dc3545; 
    color: white; 
    padding: 4px 12px; 
    border-radius: 5px; 
    font-weight: bold; 
    font-size: 0.85rem; 
    text-align: center; 
    min-width: 80px;
}

.vote-cekimser {
    background-color: #fd7e14; 
    color: white; 
    padding: 4px 12px; 
    border-radius: 5px; 
    font-weight: bold; 
    font-size: 0.85rem; 
    text-align: center; 
    min-width: 80px;
}

.vote-katilmadi { 
    background-color: #6c757d; 
    color: white; 
    padding: 4px 12px; 
    border-radius: 5px; 
    font-size: 0.85rem; 
    text-align: center; 
    min-width: 80px;
}

/* --- MOBILE OPTIMIZATIONS --- */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem 1rem;
        max-height: 95vh;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .controls input, .controls select {
        width: 100%;
        max-width: 100%;
    }

    .export-card {
        padding: 15px;
    }
}
/* --- NEW: PARTY STATS SIDEBAR --- */
.party-stats-sidebar {
    position: absolute;
    right: 20px;
    top: 120px;
    width: 260px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.party-stats-sidebar h3 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.party-stats-sidebar .stats-desc {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

#party-stats-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#party-stats-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.9rem;
    font-weight: 500;
}

#party-stats-list li:last-child {
    border-bottom: none;
}

.stat-badge {
    background: #fdf0f0;
    border: 1px solid #f5c6c6;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
    color: #b30000;
}

/* --- UPDATE: MOBILE RESPONSIVE TWEAKS --- */
@media (max-width: 1100px) {
    .party-stats-sidebar {
        position: static;
        width: 90%;
        max-width: 800px;
        margin: 20px auto;
        box-sizing: border-box;
    }

}

/* --- FOOTER & YASAL UYARI --- */
.legal-disclaimer {
    width: 100%;
    background-color: #2c3e50;
    color: #95a5a6;
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    margin-top: 40px;
    box-sizing: border-box;
}

.legal-disclaimer p {
    max-width: 800px;
    margin: 0 auto;
    color: #bdc3c7;
    line-height: 1.5;
}

.legal-disclaimer strong {
    color: #ecf0f1;
}
