/* ==========================================================================
   Kosova Elections 2025 - Coalition Analysis Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables & Reset
   -------------------------------------------------------------------------- */
:root {
    --color-primary: #e94560;
    --color-primary-light: #ff6b6b;
    --color-accent: #ffbd69;
    --color-success: #2ecc71;
    --color-warning: #f1c40f;
    --color-danger: #e74c3c;
    --color-text: #fff;
    --color-text-muted: #a0a0a0;
    --color-bg-dark: #1a1a2e;
    --color-bg-mid: #16213e;
    --color-bg-light: #0f3460;
    
    /* Party Colors */
    --color-vv: #e94560;
    --color-pdk: #0066B3;
    --color-ldk: #1B3F8B;
    --color-aak: #8B4513;
    --color-srpska: #FFD700;
    --color-serb-other: #DAA520;
    --color-bosniak: #2ecc71;
    --color-turkish: #00a8e8;
    --color-roma: #9b59b6;
    --color-gorani: #e67e22;
    --color-rasic: #00CED1;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--color-bg-dark), var(--color-bg-mid), var(--color-bg-light));
    min-height: 100vh;
    color: var(--color-text);
    padding: 15px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    position: relative;
}

header h1 {
    font-size: clamp(1.4rem, 5vw, 2.5rem);
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    padding-top: 50px;
}

header p {
    color: var(--color-text-muted);
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
}

header .source {
    color: #666;
    font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   Language Switch
   -------------------------------------------------------------------------- */
.lang-switch {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
    border-radius: 25px;
}

.lang-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: var(--color-text);
}

.lang-btn.active {
    background: var(--color-primary);
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.card h2 {
    font-size: clamp(1rem, 3vw, 1.3rem);
    margin-bottom: 15px;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Info Boxes
   -------------------------------------------------------------------------- */
.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: #93c5fd;
}

.info-box.green {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.info-box.yellow {
    background: rgba(234, 179, 8, 0.1);
    border-color: rgba(234, 179, 8, 0.3);
    color: #fde047;
}

.info-box.red {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* --------------------------------------------------------------------------
   Results Table
   -------------------------------------------------------------------------- */
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.results-table th,
.results-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-table th {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.results-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.results-table .highlight-row {
    background: rgba(233, 69, 96, 0.15);
}

.results-table .sub-row {
    opacity: 0.7;
    font-size: 0.75rem;
}

.party-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

/* --------------------------------------------------------------------------
   Sliders
   -------------------------------------------------------------------------- */
.slider-container {
    margin: 15px 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.slider-value {
    background: var(--color-primary);
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    border: none;
}

/* --------------------------------------------------------------------------
   Result Boxes
   -------------------------------------------------------------------------- */
.result-box {
    background: rgba(233, 69, 96, 0.1);
    border: 2px solid var(--color-primary);
    border-radius: 12px;
    padding: 15px;
    margin: 12px 0;
    text-align: center;
}

.big-number {
    font-size: clamp(2rem, 10vw, 3.5rem);
    font-weight: bold;
    color: var(--color-primary);
}

.result-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 5px;
}

/* --------------------------------------------------------------------------
   Progress Bar
   -------------------------------------------------------------------------- */
.progress-bar {
    height: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-weight: bold;
    font-size: 0.8rem;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    transition: width 0.5s ease;
}

.threshold-line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--color-text);
}

.threshold-label {
    position: absolute;
    top: -16px;
    transform: translateX(-50%);
    font-size: 0.65rem;
}

/* --------------------------------------------------------------------------
   Stats Grid
   -------------------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.stats-grid.five-col {
    grid-template-columns: repeat(5, 1fr);
}

.stats-grid.four-col {
    grid-template-columns: repeat(4, 1fr);
}

.stat-item {
    text-align: center;
    padding: 12px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-item .value {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    font-weight: bold;
    color: var(--color-primary);
}

.stat-item .label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Minority Section
   -------------------------------------------------------------------------- */
.minority-section {
    background: rgba(155, 89, 182, 0.1);
    border: 1px solid rgba(155, 89, 182, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.minority-section.friendly {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.3);
}

.minority-section.hostile {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
}

.minority-section h4 {
    color: #bb8fce;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.minority-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.minority-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 6px 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

.friendly-badge {
    color: #2ecc71;
    font-weight: bold;
}

.hostile-badge {
    color: #e74c3c;
    font-weight: bold;
}

.uncertain-badge {
    color: #f1c40f;
    font-weight: bold;
}

/* --------------------------------------------------------------------------
   Scenarios Grid
   -------------------------------------------------------------------------- */
.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.scenario-card {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.scenario-card.success {
    border-color: rgba(46, 204, 113, 0.5);
    background: rgba(46, 204, 113, 0.1);
}

.scenario-card.warning {
    border-color: rgba(241, 196, 15, 0.5);
    background: rgba(241, 196, 15, 0.1);
}

.scenario-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.scenario-icon {
    font-size: 1.5rem;
}

.scenario-name {
    font-weight: bold;
    font-size: 0.95rem;
}

.scenario-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.scenario-result {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.scenario-seats {
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-primary);
}

.scenario-threshold {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
}

.scenario-threshold.reached {
    color: #2ecc71;
}

.scenario-threshold.not-reached {
    color: #e74c3c;
}

.scenario-probability {
    height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.prob-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.prob-text {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: bold;
}

/* --------------------------------------------------------------------------
   Coalition Probabilities
   -------------------------------------------------------------------------- */
.coalition-prob-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.coalition-probability-item {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.coalition-prob-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.coalition-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.probability-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.probability-badge.high {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.probability-badge.medium {
    background: rgba(241, 196, 15, 0.3);
    color: #f1c40f;
}

.probability-badge.low {
    background: rgba(230, 126, 34, 0.3);
    color: #e67e22;
}

.probability-badge.very-low {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.coalition-prob-details {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
}

.seats-count {
    color: var(--color-text-muted);
}

.majority-indicator, .president-indicator {
    font-weight: bold;
}

.majority-indicator.success, .president-indicator.success {
    color: #2ecc71;
}

.majority-indicator.fail, .president-indicator.fail {
    color: #e74c3c;
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Quotes Container
   -------------------------------------------------------------------------- */
.quotes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.quotes-section {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 15px;
}

.quotes-section.friendly {
    border-left: 4px solid #2ecc71;
}

.quotes-section.hostile {
    border-left: 4px solid #e74c3c;
}

.quotes-section.opposition {
    border-left: 4px solid #9b59b6;
}

.quotes-section h4 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--color-text);
}

.quote-item {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.quote-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.quote-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.quote-header .party-name {
    font-weight: bold;
    font-size: 0.85rem;
}

.seats-badge {
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}

.prob-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
}

.prob-badge.high {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.prob-badge.low {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.prob-badge.danger {
    background: rgba(155, 89, 182, 0.3);
    color: #bb8fce;
}

.quote-item blockquote {
    font-style: italic;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    padding-left: 10px;
    border-left: 2px solid rgba(255,255,255,0.2);
    margin-bottom: 5px;
}

.quote-item cite {
    font-size: 0.7rem;
    color: #666;
}

/* --------------------------------------------------------------------------
   President Scenarios
   -------------------------------------------------------------------------- */
.president-scenarios {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.president-option {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    background: rgba(0,0,0,0.2);
}

.president-option.success {
    border: 2px solid #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.president-option.warning {
    border: 2px solid #f1c40f;
    background: rgba(241, 196, 15, 0.1);
}

.president-option .seats-needed {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 8px 0;
}

.president-option.success .seats-needed {
    color: #2ecc71;
}

.president-option.warning .seats-needed {
    color: #f1c40f;
}

.president-option .note {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Parliament Visualization
   -------------------------------------------------------------------------- */
.parliament-viz {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin: 12px 0;
}

.seat {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.seat:hover {
    transform: scale(1.4);
}

.seat.vv { background: var(--color-vv); }
.seat.pdk { background: var(--color-pdk); }
.seat.ldk { background: var(--color-ldk); }
.seat.aak { background: var(--color-aak); }
.seat.srpska { background: var(--color-srpska); }
.seat.rasic { background: var(--color-rasic); }
.seat.serb-other { background: var(--color-serb-other); }
.seat.bosniak { background: var(--color-bosniak); }
.seat.turkish { background: var(--color-turkish); }
.seat.roma { background: var(--color-roma); }
.seat.gorani { background: var(--color-gorani); }

/* --------------------------------------------------------------------------
   Legend
   -------------------------------------------------------------------------- */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 12px 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Chart Container
   -------------------------------------------------------------------------- */
.chart-container {
    height: 250px;
    margin: 15px 0;
}

/* --------------------------------------------------------------------------
   Key Finding Box
   -------------------------------------------------------------------------- */
.key-finding {
    display: flex;
    gap: 15px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(52, 152, 219, 0.15));
    border: 2px solid rgba(46, 204, 113, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
}

.key-finding-icon {
    font-size: 2rem;
}

.key-finding-text {
    font-size: 0.9rem;
    line-height: 1.5;
}

.key-finding-text strong {
    color: #2ecc71;
}

/* --------------------------------------------------------------------------
   Analyst & Kurti Quotes
   -------------------------------------------------------------------------- */
.analyst-quote,
.kurti-quote {
    background: rgba(0,0,0,0.2);
    border-left: 4px solid #3498db;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.analyst-quote blockquote,
.kurti-quote blockquote {
    font-style: italic;
    font-size: 0.85rem;
    color: #bdc3c7;
    margin-bottom: 8px;
    line-height: 1.5;
}

.analyst-quote cite,
.kurti-quote cite {
    font-size: 0.75rem;
    color: #7f8c8d;
}

/* --------------------------------------------------------------------------
   Minority Summary
   -------------------------------------------------------------------------- */
.minority-summary {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.summary-row.success {
    background: rgba(46, 204, 113, 0.15);
    border-left: 3px solid #2ecc71;
}

.summary-row.warning {
    background: rgba(241, 196, 15, 0.15);
    border-left: 3px solid #f1c40f;
}

.summary-row.danger {
    background: rgba(231, 76, 60, 0.15);
    border-left: 3px solid #e74c3c;
}

/* --------------------------------------------------------------------------
   Scenario Partners
   -------------------------------------------------------------------------- */
.scenario-partners {
    font-size: 0.7rem;
    color: #95a5a6;
    margin-bottom: 10px;
    padding: 5px 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Blocked Coalition
   -------------------------------------------------------------------------- */
.coalition-probability-item.blocked {
    opacity: 0.6;
    border: 1px dashed rgba(231, 76, 60, 0.5);
}

.blocked-note {
    font-size: 0.7rem;
    color: #e74c3c;
    margin-top: 5px;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Quote Notes
   -------------------------------------------------------------------------- */
.quote-note {
    font-size: 0.7rem;
    color: #7f8c8d;
    margin-top: 5px;
    padding-left: 10px;
    border-left: 2px solid rgba(255,255,255,0.1);
}

/* --------------------------------------------------------------------------
   Uncertain Section
   -------------------------------------------------------------------------- */
.quotes-section.uncertain {
    border-left: 4px solid #f1c40f;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (min-width: 600px) {
    header h1 {
        padding-top: 0;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .full-width {
        grid-column: 1 / -1;
    }
    
    .stats-grid.five-col {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .seat {
        width: 16px;
        height: 16px;
    }
    
    .parliament-viz {
        gap: 4px;
    }
    
    .minority-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 400px) {
    .lang-switch {
        position: relative;
        top: 0;
        right: 0;
        margin: 0 auto 15px;
        justify-content: center;
        width: fit-content;
    }
    
    header h1 {
        padding-top: 0;
    }
    
    .seat {
        width: 11px;
        height: 11px;
    }
    
    .minority-grid {
        grid-template-columns: 1fr;
    }
    
    .president-scenarios {
        grid-template-columns: 1fr;
    }
    
    .stats-grid.five-col {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid.four-col {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease forwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }
