* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
    background-color: #f0f2f5;
    color: #333;
}
.container {
    max-width: 1450px;
    margin: 0 auto;
    padding: 15px;
}
header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 3px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
h1 {
    color: #1a3c5e;
    font-size: 1.6rem;
    margin: 0;
    flex: 1 1 auto;
    min-width: 250px;
}
.view-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}
.view-toggle-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}
.view-toggle {
    position: relative;
    display: inline-flex;
    background: #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
}
.view-toggle input {
    display: none;
}
.view-toggle .toggle-option {
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #777;
    transition: all 0.3s;
    z-index: 1;
    cursor: pointer;
    border-radius: 20px;
}
.view-toggle .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 4px);
    height: calc(100% - 4px);
    background: #1a5276;
    border-radius: 18px;
    transition: transform 0.3s;
    z-index: 0;
}
.view-toggle.results-active .toggle-slider {
    transform: translateX(100%);
}
.view-toggle.results-active .toggle-option[data-view="candidates"] { color: #777; }
.view-toggle.results-active .toggle-option[data-view="results"]   { color: #fff; }
.view-toggle:not(.results-active) .toggle-option[data-view="candidates"] { color: #fff; }
.view-toggle:not(.results-active) .toggle-option[data-view="results"]   { color: #777; }
.results-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.summary-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.summary-item.active-filter {
    border-color: #333;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}
.summary-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}
.summary-count {
    font-size: 1.1rem;
    font-weight: 700;
}
.content {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.map-container {
    flex: 1;
    min-width: 320px;
    height: 620px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
#map {
    height: 100%;
    width: 100%;
}
.controls {
    flex: 0 0 310px;
    background-color: white;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 620px;
    overflow-y: auto;
}
.filter-section {
    margin-bottom: 16px;
}
.filter-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1rem;
}
select,
input {
    width: 100%;
    padding: 9px 10px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
select:focus,
input:focus {
    border-color: #1a5276;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.1);
}
.constituency-info {
    background-color: white;
    border-radius: 10px;
    padding: 18px;
    margin-top: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.info-title {
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 1.1rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}
.info-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.info-item {
    margin-bottom: 8px;
}
.info-item.full-width {
    grid-column: 1 / -1;
}
.info-label {
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.candidate-name {
    font-weight: 600;
    color: #1a3c5e;
}
.party-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 4px;
}
.winner-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #ffd700;
    color: #333;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 215, 0, 0);
    }
}
.no-data {
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.85rem;
}
.result-row {
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #f9fafb;
    border-left: 3px solid #e0e0e0;
}
.result-row.winner-row {
    background: #f0fdf4;
    border-left-color: #22c55e;
}
.result-votes {
    font-size: 0.8rem;
    color: #666;
}
.result-percent {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a3c5e;
}
.margin-info {
    font-size: 0.85rem;
    color: #555;
    padding: 4px 8px;
    background: #fff3cd;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}
.alliance-stats {
    margin-top: 14px;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #1a5276;
}
.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.85rem;
    padding: 4px 0;
}
.stat-item:last-child {
    margin-bottom: 0;
}
.stat-label {
    color: #555;
    font-weight: 600;
}
.stat-value {
    font-weight: 700;
    color: #2c3e50;
}
.party-fullforms {
    background-color: white;
    border-radius: 10px;
    padding: 18px;
    margin-top: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.alliances-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 2px solid #f0f0f0;
}
.alliance-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}
.alliance-item[data-alliance="AITC+"] {
    border-left-color: #20C646;
}
.alliance-item[data-alliance="BJP"] {
    border-left-color: #FF9933;
}
.alliance-item[data-alliance="INC"] {
    border-left-color: #00BFFF;
}
.alliance-item[data-alliance="LF+"] {
    border-left-color: #cc0d0d;
}
.alliance-item[data-alliance="OTH"] {
    border-left-color: #777777;
}
.parties-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.party-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    transition: all 0.3s ease;
    min-height: 50px;
    cursor: pointer;
    font-size: 0.8rem;
}
.party-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.party-item.translucent {
    opacity: 0.35;
    filter: grayscale(0.7);
    transition: all 0.3s ease;
}
.alliance-item.active {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    border-left-width: 6px;
}
.party-fullform {
    font-size: 0.78rem;
    color: #495057;
    font-weight: 500;
    line-height: 1.3;
}
.legend {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 11px;
    width: 160px;
    max-height: 280px;
    overflow-y: auto;
}
.legend-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}
.legend .party-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.legend .legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.legend .legend-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}
.winner-star {
    color: #ffd700;
    font-size: 1.2rem;
    margin-left: 2px;
}
@media (max-width: 1200px) {
    .parties-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 768px) {
    .content {
        flex-direction: column;
    }
    .controls {
        flex: 1;
        max-height: none;
    }
    .parties-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .map-container {
        height: 420px;
    }
    h1 {
        font-size: 1.3rem;
    }
    .results-summary-bar {
        gap: 6px;
        padding: 8px 10px;
    }
    .summary-item {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
}
@media (max-width: 480px) {
    .parties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .alliances-section {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 1.1rem;
    }
    .info-content {
        grid-template-columns: 1fr;
    }
    .view-toggle-wrapper {
        padding: 6px 10px;
        gap: 5px;
    }
    .view-toggle .toggle-option {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}