body {
    background-color: #011625;
    color: #f1f5f9;
}

/* Set the map to fill the entire viewport */
#map {
    height: 100vh;
    width: 100%;
    z-index: 1; /* Ensure it's below any potential overlays */
    background-color: #022c3a;
    background-image: radial-gradient(circle at top left, rgba(13,148,136,0.25), transparent 45%), radial-gradient(circle at bottom, rgba(37,99,235,0.2), transparent 55%);
}

/* Custom styling for the popup container for better look and feel */
.leaflet-popup-content-wrapper {
    border-radius: 0.75rem; /* rounded-xl */
    padding: 0;
    background-color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
}

.leaflet-popup-content {
    margin: 0;
    padding: 0;
}

/* Ensure the popup tip matches the wrapper style */
.leaflet-popup-tip {
    background: #ffffff;
}

.constituency-label span {
    font-size: 0.65rem;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow:
        -1px -1px 0 #f8fafc,
         1px -1px 0 #f8fafc,
        -1px  1px 0 #f8fafc,
         1px  1px 0 #f8fafc;
}
.constituency-label {
    pointer-events: none;
    white-space: nowrap;
}

.popup-card {
    padding: 0;
    width: 100%;
    max-width: 19rem;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.popup-header {
    background: linear-gradient(135deg, #e0f2fe 0%, #eef2ff 100%);
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid #dbeafe;
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
}

.candidate-panel {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.75rem 0.75rem 0.9rem 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.18);
}

.candidate-panel__heading h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
}

.candidate-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.candidate-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #ffffff;
    border-radius: 0.65rem;
    padding: 0.55rem 0.6rem;
    border: 1px solid #e2e8f0;
}

.candidate-img {
    width: 64px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.candidate-item__info {
    flex: 1;
}

.candidate-name {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
}

.candidate-party {
    margin: 0.15rem 0 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.candidate-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.candidate-badge--winner {
    background: #ecfdf3;
    color: #15803d;
    border-color: #bbf7d0;
}

.candidate-badge--default {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}
