/* ========================
   GENERAL STYLES
   ======================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================
   HEADER
   ======================== */

header {
    background-color: #0b1120;
    color: #f8fafc;
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    height: 60px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

/* ========================
   LAYOUT CONTAINER
   ======================== */

#container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ========================
   MAP
   ======================== */

#map {
    flex: 1;
    height: 100%;
    z-index: 1;
}

/* Enable touch events on Leaflet interactive elements for better mobile browser support */
.leaflet-interactive {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* ========================
   SIDEBAR
   ======================== */

#sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    background: white;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#sidebar.open {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Sticky Header */
.sidebar-sticky-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

#closeSidebar {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 8px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

#closeSidebar:hover,
#closeSidebar:active {
    background-color: #f1f5f9;
    color: #0f172a;
    transform: scale(1.05);
}

#sidebarContent {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    padding-top: 1rem;
}

#constituencyTitle {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin: 0;
    flex: 1;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

#voters {
    color: #3b82f6;
}

#totalCandidates {
    color: #22c55e;
}

/* ========================
   VIEW DETAILS BUTTON
   ======================== */

.view-details-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #FF8C42 0%, #ff7a29 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.3);
}

.view-details-btn:hover {
    background: linear-gradient(135deg, #ff7a29 0%, #FF8C42 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
}

.view-details-btn:active {
    transform: translateY(0);
}

/* View Party Manifesto Button - Secondary (Lighter) */
.view-party-manifesto-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    margin-top: 0.75rem;
    background: linear-gradient(135deg, #ffa366 0%, #ff9454 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.2);
    opacity: 0.85;
}

.view-party-manifesto-btn:hover {
    opacity: 1;
    background: linear-gradient(135deg, #ff9454 0%, #ffa366 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

.view-party-manifesto-btn:active {
    transform: translateY(0);
}

/* Export Button */
.export-button-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.export-image-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.export-image-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.export-image-btn:active:not(:disabled) {
    transform: translateY(0);
}

.export-image-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.export-image-btn svg {
    flex-shrink: 0;
}

/* Share Stats Button in Header */
.share-stats-btn {
    padding: 0.5rem 0.875rem;
    background: #FF8C42;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.share-stats-btn:hover:not(:disabled) {
    background: #e67a32;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 140, 66, 0.4);
}

.share-stats-btn:active:not(:disabled) {
    transform: translateY(0);
}

.share-stats-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.share-stats-btn svg {
    flex-shrink: 0;
}

/* ========================
   DEMOGRAPHICS SECTION
   ======================== */

.demographics-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.demographics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.demographics-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.urban-badge-small {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.urban-badge-small.urban {
    background: #dbeafe;
    color: #1e40af;
}

.urban-badge-small.semi-urban {
    background: #fde68a;
    color: #92400e;
}

.urban-badge-small.rural {
    background: #a7f3d0;
    color: #065f46;
}

.demo-inline-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.demo-highlight {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.demo-highlight:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.demo-highlight-half {
    flex: 1;
}

.demo-highlight-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.demo-highlight-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #8b5cf6;
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.age-group-range {
    font-size: 2.5rem;
    font-weight: 800;
    color: #FF8C42;
    letter-spacing: -0.02em;
    line-height: 1;
}

.age-group-detail {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.4;
}

/* Ethnic Group Styles */
.ethnic-group-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #FF8C42;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.ethnic-group-detail {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

/* Gender Pie Chart */
.gender-pie-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gender-pie {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(
        #3b82f6 0% var(--male-percent),
        #ec4899 var(--male-percent) 100%
    );
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gender-pie:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gender-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.gender-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gender-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gender-dot-male {
    background: #3b82f6;
}

.gender-dot-female {
    background: #ec4899;
}

.gender-legend-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.gender-percent {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
}

.gender-count {
    font-size: 0.6875rem;
    font-weight: 400;
    color: #64748b;
}

.demo-group {
    margin-bottom: 1.5rem;
}

.demo-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.demo-chart {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.demo-chart-compact {
    gap: 0.375rem;
}

.demo-bar-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-bar-group:hover {
    transform: translateX(4px);
}

.demo-bar-group:hover .demo-bar-label {
    color: #1e293b;
    font-weight: 600;
}

.demo-bar-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #475569;
    min-width: 80px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.demo-bar-container {
    flex: 1;
    position: relative;
    height: 28px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.demo-bar-group:hover .demo-bar-container {
    background: #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.demo-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease-out, filter 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.demo-bar-group:hover .demo-bar {
    filter: brightness(1.1);
    transform: scaleY(1.05);
}

.demo-bar-male {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.demo-bar-female {
    background: linear-gradient(90deg, #ec4899 0%, #f472b6 100%);
}

.demo-bar-ordinary {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.demo-bar-military {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.demo-bar-age {
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
}

.demo-bar-ethnic {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Color set inline via JavaScript */
}

.demo-bar-group:hover .demo-bar-ethnic {
    opacity: 0.8;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.demo-bar-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e293b;
    z-index: 1;
    transition: all 0.2s ease;
}

.demo-bar-group:hover .demo-bar-value {
    font-size: 0.8125rem;
    font-weight: 700;
}

/* ========================
   2020 INCUMBENT SECTION
   ======================== */

.incumbent-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: 8px;
    border: 1px solid #fbbf24;
}

.incumbent-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.incumbent-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.incumbent-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.incumbent-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
}

.incumbent-party {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.incumbent-party-logo {
    height: 18px;
    width: auto;
    object-fit: contain;
    display: inline-block;
}

.incumbent-divider {
    color: #cbd5e1;
}

.incumbent-majority {
    font-weight: 500;
}

/* Candidates Section */
.candidates-section {
    margin-top: 0.5rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
}

#notes {
    color: #64748b;
    font-style: italic;
}

/* ========================
   CANDIDATES LIST
   ======================== */

.candidates-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: candidate-counter;
}

.candidate-item {
    position: relative;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.375rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    counter-increment: candidate-counter;
}

.candidate-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.candidate-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

.candidate-item:hover .candidate-number {
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.4);
}

/* Candidate Photo */
.candidate-photo-container {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.candidate-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.candidate-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.candidate-photo-placeholder svg {
    width: 24px;
    height: 24px;
    fill: #94a3b8;
}

.candidate-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.candidate-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.candidate-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.875rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    flex: 1;
}

.candidate-badges {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.candidate-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.gender-badge {
    padding: 0.3125rem;
}
.gender-badge img {
    height: 12px;
    width: 12px;
}
.gender-badge.male {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.gender-badge.female {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.gender-icon {
    display: block;
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
}

.age-badge {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
}

.manifesto-badge {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #FF8C42;
    border: 1px solid #FF8C42;
    font-weight: 700;
}

.candidate-party {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    background: #f8fafc;
    border-radius: 4px;
    width: fit-content;
    line-height: 1.2;
    border: 1px solid #e2e8f0;
}

.party-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border-radius: 2px;
    flex-shrink: 0;
}

.party-name {
    white-space: nowrap;
}

/* ========================
   MOBILE RESPONSIVE
   ======================== */

@media (max-width: 768px) {
    /* Header Mobile Styles */
    header {
        justify-content: space-between;
        position: relative;
    }

    .header-actions {
        display: flex;
        position: absolute;
        top: 100%;
        right: 0;
        background: #0b1120;
        flex-direction: column;
        width: 200px;
        padding: 1rem 0;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        gap: 0;
        z-index: 10;
    }

    .header-actions.open {
        display: flex !important;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .header-actions a,
    .header-actions button {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        border-radius: 0;
        border: none;
        justify-content: flex-start;
    }

    .header-actions a:hover,
    .header-actions button:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: none;
    }
    
    /* Live Results Button Mobile Adjustments */
    .live-results-btn:hover {
        background: linear-gradient(135deg, #FF8C42 0%, #ff7a29 100%) !important;
        transform: none !important;
    }

    #container {
        flex-direction: column;
    }

    #map {
        height: 60vh;
        min-height: 60vh;
        width: 100%;
    }

    #sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: 85vh;
        max-height: 85vh;
        transform: translateY(100%);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: column;
    }

    #sidebar.open {
        transform: translateY(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .sidebar-sticky-header {
        padding: 1rem 1rem 0.75rem;
        border-radius: 16px 16px 0 0;
    }

    #sidebarContent {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem;
        padding-bottom: 2rem;
    }

    #closeSidebar {
        flex-shrink: 0;
        width: 48px;
        height: 48px;
        font-size: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.03);
        padding: 10px;
    }

    #constituencyTitle {
        font-size: 1.25rem;
    }

    .stats-row {
        gap: 0.625rem;
    }

    .stat-item {
        padding: 0.625rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .incumbent-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .incumbent-header {
        font-size: 0.7rem;
        margin-bottom: 0.375rem;
    }

    .incumbent-name {
        font-size: 0.9rem;
    }

    .incumbent-details {
        font-size: 0.75rem;
        gap: 0.375rem;
    }

    .incumbent-party-logo {
        height: 16px;
    }

    .view-details-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        margin-top: 1rem;
    }

    .view-party-manifesto-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        margin-top: 0.625rem;
    }

    .demographics-section {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .demographics-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 1rem;
    }

    .demographics-title {
        font-size: 0.875rem;
    }

    .urban-badge-small {
        font-size: 0.625rem;
        padding: 0.1875rem 0.5rem;
    }

    .demo-inline-row {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .demo-highlight {
        padding: 0.75rem 0.875rem;
    }

    .demo-highlight-half {
        width: 100%;
    }

    .demo-highlight-label {
        font-size: 0.625rem;
        margin-bottom: 0.375rem;
    }

    .demo-highlight-value {
        font-size: 1rem;
    }

    .age-group-range {
        font-size: 2rem;
    }

    .age-group-detail {
        font-size: 0.8rem;
    }

    .ethnic-group-name {
        font-size: 0.95rem;
    }

    .ethnic-group-detail {
        font-size: 1.5rem;
    }

    .gender-pie-container {
        gap: 0.75rem;
    }

    .gender-pie {
        width: 70px;
        height: 70px;
    }

    .gender-legend {
        gap: 0.375rem;
    }

    .gender-legend-text {
        font-size: 0.75rem;
    }

    .gender-percent {
        font-size: 0.75rem;
    }

    .gender-count {
        font-size: 0.625rem;
    }

    .gender-dot {
        width: 8px;
        height: 8px;
    }

    .demo-group {
        margin-bottom: 1.25rem;
    }

    .demo-label {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .demo-bar-label {
        font-size: 0.75rem;
        min-width: 60px;
    }

    .demo-bar-container {
        height: 24px;
    }

    .demo-bar-value {
        font-size: 0.7rem;
    }

    .section-title {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .candidate-item {
        padding: 0.5rem;
        margin-bottom: 0.3rem;
        gap: 0.5rem;
    }

    .candidate-number {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

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

    .candidate-badges {
        gap: 0.25rem;
    }

    .candidate-badge {
        font-size: 0.625rem;
        padding: 0.1875rem 0.375rem;
    }

    .gender-badge {
        padding: 0.25rem;
    }

    .gender-icon {
        width: 12px;
        height: 12px;
    }

    .candidate-party {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
        gap: 0.3rem;
    }

    .party-logo {
        width: 16px;
        height: 16px;
    }

    .candidates-section {
        flex: 1;
        overflow: visible;
    }

    .candidates-list {
        padding-bottom: 1rem;
    }
}

/* ========================
   LEAFLET OVERRIDES
   ======================== */

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 12px;
    font-family: inherit;
}

/* Parliament labels (permanent tooltips) - Legacy */
.parliament-label {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #1e3a8a;
    border-radius: 6px;
    padding: 6px 10px;
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    text-align: center;
    white-space: nowrap;
}

.parliament-label::before {
    display: none;
}

/* Parliament labels with Tailwind - Override Leaflet tooltip container */
.leaflet-tooltip.parliament-label-tw {
    /* Reset Leaflet defaults */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    /* Enable pointer and touch events */
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    z-index: 1000 !important;
}

/* Remove the tooltip arrow/pointer */
.leaflet-tooltip.parliament-label-tw::before {
    display: none !important;
    border: none !important;
}

.leaflet-tooltip.parliament-label-tw .leaflet-tooltip-content {
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: auto !important;
}

/* Modern Tailwind-inspired label styling */
.parliament-label-tw > div,
.parliament-label-tw .flex {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%) !important;
    border: 1.5px solid rgba(30, 58, 138, 0.25) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    box-shadow: 
        0 10px 25px -5px rgba(0, 0, 0, 0.15),
        0 8px 10px -6px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
    text-align: center !important;
    white-space: nowrap !important;
    backdrop-filter: blur(8px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(180%) !important;
    min-width: 110px !important;
    max-width: 190px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Hover effect */
.leaflet-interactive:hover ~ .parliament-label-tw > div,
.leaflet-interactive:hover ~ .parliament-label-tw .flex,
.parliament-label-tw:hover > div,
.parliament-label-tw:hover .flex {
    transform: translateY(-2px) !important;
    box-shadow: 
        0 15px 35px -5px rgba(0, 0, 0, 0.2),
        0 10px 15px -6px rgba(0, 0, 0, 0.15) !important;
    cursor: pointer !important;
}

/* Active/pressed state for Parliament labels */
.parliament-label-tw:active > div,
.parliament-label-tw:active .flex {
    transform: translateY(0) scale(0.98) !important;
}

/* DUN labels (permanent tooltips) - Legacy */
.dun-label {
    background: rgba(34, 197, 94, 0.95);
    border: 2px solid #166534;
    border-radius: 6px;
    padding: 5px 9px;
    font-weight: 600;
    font-size: 12px;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    text-align: center;
    white-space: nowrap;
}

.dun-label::before {
    display: none;
}

/* DUN labels with Tailwind - Override Leaflet tooltip container */
.leaflet-tooltip.dun-label-tw {
    /* Reset Leaflet defaults */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    /* Enable pointer and touch events */
    pointer-events: auto !important;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    z-index: 1000 !important;
}

/* Remove the tooltip arrow/pointer */
.leaflet-tooltip.dun-label-tw::before {
    display: none !important;
    border: none !important;
}

.leaflet-tooltip.dun-label-tw .leaflet-tooltip-content {
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: auto !important;
}

/* Modern Tailwind-inspired DUN label styling */
.dun-label-tw > div,
.dun-label-tw .flex {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.98) 0%, rgba(22, 163, 74, 0.98) 100%) !important;
    border: 1.5px solid rgba(21, 128, 61, 0.4) !important;
    border-radius: 10px !important;
    padding: 9px 13px !important;
    box-shadow: 
        0 10px 25px -5px rgba(22, 101, 52, 0.25),
        0 8px 10px -6px rgba(22, 101, 52, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset !important;
    text-align: center !important;
    white-space: nowrap !important;
    backdrop-filter: blur(8px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(180%) !important;
    min-width: 100px !important;
    max-width: 180px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Hover effect for DUN labels */
.leaflet-interactive:hover ~ .dun-label-tw > div,
.leaflet-interactive:hover ~ .dun-label-tw .flex,
.dun-label-tw:hover > div,
.dun-label-tw:hover .flex {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 
        0 15px 35px -5px rgba(22, 101, 52, 0.3),
        0 10px 15px -6px rgba(22, 101, 52, 0.25) !important;
    cursor: pointer !important;
}

/* Active/pressed state for DUN labels */
.dun-label-tw:active > div,
.dun-label-tw:active .flex {
    transform: translateY(0) scale(0.98) !important;
}

/* Ensure all text elements inside tooltips are clickable */
.dun-label-tw .text-sm,
.dun-label-tw .text-xs,
.parliament-label-tw .text-sm,
.parliament-label-tw .text-xs {
    pointer-events: auto !important;
}

/* Back button control */
.back-button-control {
    margin-top: 10px !important;
}

.back-button-control button {
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.back-button-control button:hover {
    background: #f8fafc;
    border-color: #1e3a8a;
    color: #1e3a8a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.back-button-control button:active {
    transform: scale(0.98);
}

/* Responsive styling for mobile */
@media (max-width: 768px) {
    .parliament-label {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .parliament-label-tw > div,
    .parliament-label-tw .flex {
        padding: 7px 10px !important;
        min-width: 85px !important;
        max-width: 150px !important;
        border-radius: 8px !important;
    }
    
    .parliament-label-tw .text-sm {
        font-size: 11px !important;
    }
    
    .parliament-label-tw .text-xs {
        font-size: 10px !important;
    }
    
    .dun-label {
        font-size: 10px;
        padding: 4px 7px;
    }
    
    .dun-label-tw > div,
    .dun-label-tw .flex {
        padding: 6px 9px !important;
        min-width: 80px !important;
        max-width: 140px !important;
        border-radius: 8px !important;
    }
    
    .dun-label-tw .text-sm {
        font-size: 11px !important;
    }
    
    .dun-label-tw .text-xs {
        font-size: 9px !important;
    }
    
    .back-button-control button {
        padding: 6px 12px;
        font-size: 13px;
    }
}


/* Header Credits Link */
header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

header #creditsLink, .credit-button {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

header #creditsLink:hover, .credit-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

/* Live Results Button - Special Styling */
.live-results-btn {
    background: linear-gradient(135deg, #FF8C42 0%, #ff7a29 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 2px 12px rgba(255, 140, 66, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.live-results-btn:hover {
    background: linear-gradient(135deg, #ff7a29 0%, #ff6810 100%) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.5);
    transform: translateY(-2px);
}

/* Live Dot Animation */
.live-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    display: inline-block;
    animation: live-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
}

@keyframes live-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0);
    }
}

/* Header Logo Link */
header #headerLogo {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    transition: opacity 0.3s ease;
}

header #headerLogo:hover {
    opacity: 0.9;
}

/* Burger Menu */
.burger-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1;
}

/* Hide burger menu on desktop */
@media (min-width: 769px) {
    .burger-menu {
        display: none;
    }
}

.burger-menu span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================
   CANDIDATE DETAIL MODAL
   ======================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Constituency Modal Specific Styles */
.constituency-modal-content {
    max-width: 700px;
}

#constituencyModalBody {
    padding: 2rem;
}

.modal-constituency-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 24px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    /* Increase touch target */
    padding: 8px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    touch-action: manipulation;
}

.modal-close:hover,
.modal-close:active {
    background: rgba(0, 0, 0, 0.15);
    color: #0f172a;
    transform: scale(1.05);
}

#modalBody {
    padding: 2rem;
}

/* Modal Profile Photo */
.modal-photo-section {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding-top: 0.5rem;
}

.modal-candidate-photo-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-candidate-photo-placeholder svg {
    width: 60px;
    height: 60px;
    fill: #94a3b8;
}

.modal-candidate-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid white;
}

.candidate-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
}

#modalCandidateName {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.modal-party-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.modal-party-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

#modalPartyName {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
}

.modal-info-section {
    margin-bottom: 2rem;
}

.modal-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.modal-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.modal-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #0f172a;
}

.modal-socials-section {
    margin-top: 2rem;
}

.modal-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
}

.modal-socials-grid {
    display: grid;
    gap: 0.75rem;
}

.modal-social-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #0f172a;
    transition: all 0.2s ease;
    font-weight: 500;
}

.modal-social-link:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.modal-social-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.modal-social-icon.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0c63d4 100%);
    color: white;
}

.modal-social-icon.instagram {
    background: linear-gradient(135deg, #e1306c 0%, #c13584 50%, #833ab4 100%);
    color: white;
}

.modal-social-icon.tiktok {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    color: white;
}

.modal-social-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-social-name {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.modal-social-url {
    font-size: 0.875rem;
    color: #64748b;
    word-break: break-all;
}

.modal-no-data {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* Manifestos Section */
.modal-manifestos-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.modal-manifestos-grid {
    display: grid;
    gap: 1.5rem;
}

/* Two-Column Modal Layout */
.modal-content-wide {
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#modalBody {
    overflow-y: auto;
    flex: 1;
    padding: 2rem;
}

#modalBody::-webkit-scrollbar {
    width: 6px;
}

#modalBody::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#modalBody::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#modalBody::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-header-compact {
    display: flex;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.modal-photo-compact {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-photo-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-photo-compact svg {
    width: 40px;
    height: 40px;
    color: #94a3b8;
}

.modal-header-info {
    flex: 1;
    min-width: 0;
}

.modal-name-compact {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.modal-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.modal-party-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
}

.modal-party-logo-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.modal-meta-divider {
    color: #cbd5e1;
}

.modal-constituency-compact {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.modal-demographics-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: #f1f5f9;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
}

.modal-two-columns {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    overflow: hidden;
    flex: 1;
}

/* Left Sidebar */
.modal-sidebar {
    overflow-y: auto;
    padding-right: 1rem;
}

.modal-sidebar::-webkit-scrollbar {
    width: 6px;
}

.modal-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modal-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-sidebar-section {
    margin-bottom: 1.5rem;
}

.modal-sidebar-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-socials-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-social-link-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
}

.modal-social-link-compact:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.modal-social-icon-compact {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-social-icon-compact.facebook { background: #1877f2; }
.modal-social-icon-compact.instagram { background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); }
.modal-social-icon-compact.tiktok { background: #000; }

.modal-social-icon-compact svg {
    width: 18px;
    height: 18px;
    color: white;
}

.modal-social-name-compact {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
}

.modal-manifestos-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.25rem;
}

/* Custom scrollbar for manifestos */
.modal-manifestos-compact::-webkit-scrollbar {
    width: 6px;
}

.modal-manifestos-compact::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modal-manifestos-compact::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-manifestos-compact::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-manifesto-thumb {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
}

.modal-manifesto-thumb:hover {
    transform: scale(1.02);
}

.modal-manifesto-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Manifesto Lightbox Styles */
.manifesto-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.manifesto-lightbox.active {
    display: flex;
    opacity: 1;
}

.manifesto-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(4px);
}

.manifesto-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.manifesto-lightbox-image-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.manifesto-lightbox-image-wrapper img {
    max-width: 100%;
    max-height: calc(85vh - 3rem);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.15s ease;
}

.manifesto-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.manifesto-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.manifesto-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.manifesto-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.manifesto-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.manifesto-nav-btn:disabled:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%);
}

.manifesto-nav-prev {
    left: 2rem;
}

.manifesto-nav-next {
    right: 2rem;
}

.manifesto-page-indicator {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .manifesto-lightbox-content {
        padding: 3rem 1rem;
    }
    
    .manifesto-lightbox-image-wrapper {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .manifesto-lightbox-image-wrapper img {
        max-height: calc(80vh - 3rem);
    }
    
    .manifesto-lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .manifesto-nav-btn {
        width: 48px;
        height: 48px;
    }
    
    .manifesto-nav-prev {
        left: 0.5rem;
    }
    
    .manifesto-nav-next {
        right: 0.5rem;
    }
}

/* PDF Viewer Modal Styles */
.pdf-viewer-wrapper {
    position: relative;
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#pdfViewerFrame {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-open-new-tab {
    position: absolute;
    top: 1.5rem;
    right: 5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    backdrop-filter: blur(8px);
    text-decoration: none;
}

.pdf-open-new-tab:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .pdf-viewer-wrapper {
        width: 95vw;
        height: 80vh;
    }
    
    .pdf-open-new-tab {
        top: 1rem;
        right: 4rem;
        width: 40px;
        height: 40px;
    }
    
    .pdf-open-new-tab svg {
        width: 16px;
        height: 16px;
    }
}

.modal-no-data-compact {
    padding: 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8125rem;
    background: #f8fafc;
    border-radius: 8px;
}

/* Right Main: History */
.modal-main {
    overflow-y: auto;
    padding-right: 0.5rem;
}

.modal-main::-webkit-scrollbar {
    width: 6px;
}

.modal-main::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modal-main::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-main::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    background: white;
    padding-bottom: 0.75rem;
    z-index: 10;
}

.modal-main-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.modal-history-link {
    font-size: 0.8125rem;
    color: #FF8C42;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.modal-history-link:hover {
    color: #e67a2e;
}

.modal-history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}

.modal-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f1f5f9;
    border-top-color: #FF8C42;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.75rem;
}

.modal-history-loading p {
    font-size: 0.875rem;
    margin: 0;
}

.modal-history-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.modal-stat-card {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
}

.modal-stat-card.wins {
    background: #dcfce7;
}

.modal-stat-card.losses {
    background: #fee2e2;
}

.modal-stat-card.winrate {
    background: rgba(255, 140, 66, 0.1);
}

.modal-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.modal-stat-card.wins .modal-stat-value {
    color: #166534;
}

.modal-stat-card.losses .modal-stat-value {
    color: #991b1b;
}

.modal-stat-card.winrate .modal-stat-value {
    color: #FF8C42;
}

.modal-stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-stat-card.wins .modal-stat-label {
    color: #16a34a;
}

.modal-stat-card.losses .modal-stat-label {
    color: #dc2626;
}

.modal-stat-card.winrate .modal-stat-label {
    color: #FF8C42;
}

.modal-history-timeline {
    position: relative;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.modal-history-timeline::-webkit-scrollbar {
    width: 6px;
}

.modal-history-timeline::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.modal-history-timeline::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.modal-history-timeline::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.modal-timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
}

.modal-timeline-item:last-child {
    padding-bottom: 0;
}

.modal-timeline-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 12px;
    bottom: -12px;
    width: 2px;
    background: #e2e8f0;
}

.modal-timeline-item:last-child::before {
    display: none;
}

.modal-timeline-dot {
    position: absolute;
    left: 0;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 1px #e2e8f0;
    z-index: 2;
}

.modal-timeline-dot.won {
    background: #22c55e;
}

.modal-timeline-dot.lost {
    background: #ef4444;
}

.modal-timeline-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 0.875rem;
    border: 1px solid #e2e8f0;
}

.modal-timeline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.625rem;
}

.modal-timeline-seat {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #1e293b;
    line-height: 1.3;
}

.modal-timeline-meta {
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.modal-timeline-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.modal-timeline-badge.won {
    background: #dcfce7;
    color: #166534;
}

.modal-timeline-badge.lost {
    background: #fee2e2;
    color: #991b1b;
}

.modal-timeline-details {
    font-size: 0.8125rem;
    color: #64748b;
}

.modal-no-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.modal-no-history svg {
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.modal-no-history p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Seat History Section in Sidebar */
.seat-history-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.seat-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.seat-history-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.expand-history-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.expand-history-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.expand-history-btn.expanded svg {
    transform: rotate(180deg);
}

.seat-history-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #64748b;
    font-size: 0.875rem;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #f1f5f9;
    border-top-color: #FF8C42;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.seat-history-timeline {
    position: relative;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.5rem;
    transition: max-height 0.3s ease;
}

.seat-history-timeline::-webkit-scrollbar {
    width: 5px;
}

.seat-history-timeline::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.seat-history-timeline::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.seat-history-timeline::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.seat-history-timeline.expanded {
    max-height: none;
    overflow-y: visible;
}

/* Compact Seat History (reduced height) */
.seat-history-compact .seat-history-timeline {
    max-height: 180px;
}

.seat-history-item {
    position: relative;
    padding-left: 1.75rem;
    padding-bottom: 1rem;
}

.seat-history-item:last-child {
    padding-bottom: 0;
}

.seat-history-item::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 10px;
    bottom: -8px;
    width: 2px;
    background: #e2e8f0;
}

.seat-history-item:last-child::before {
    display: none;
}

.seat-history-dot {
    position: absolute;
    left: 0;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 1px #e2e8f0;
    z-index: 2;
}

/* Party colors for dots */
.seat-history-dot.BN { background: #1e40af; }
.seat-history-dot.WARISAN { background: #dc2626; }
.seat-history-dot.PN { background: #16a34a; }
.seat-history-dot.PKR { background: #0284c7; }
.seat-history-dot.DAP { background: #dc2626; }
.seat-history-dot.PBS { background: #0891b2; }
.seat-history-dot.UPKO { background: #7c3aed; }
.seat-history-dot.SOLIDARITI { background: #ea580c; }
.seat-history-dot.STAR { background: #eab308; }
.seat-history-dot.USNO { background: #0ea5e9; }
.seat-history-dot.BERJAYA { background: #8b5cf6; }
.seat-history-dot.PPKB { background: #06b6d4; }
.seat-history-dot.PASOK { background: #10b981; }
.seat-history-dot.SCA { background: #6366f1; }
.seat-history-dot.PERIKATAN { background: #14b8a6; }
.seat-history-dot.BEBAS { background: #64748b; }

.seat-history-card {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.seat-history-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.seat-history-year {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.seat-history-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
    margin-bottom: 0.375rem;
    line-height: 1.3;
}

.seat-history-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.75rem;
}

.seat-history-party {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: #f1f5f9;
    border-radius: 4px;
    font-weight: 600;
    color: #475569;
}

.seat-history-votes {
    color: #64748b;
}

.seat-history-percentage {
    font-weight: 600;
    color: #FF8C42;
}

.seat-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
}

.seat-history-empty svg {
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.seat-history-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-content-wide {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        margin: 0;
        border-radius: 16px 16px 0 0;
    }
    
    #modalBody {
        padding: 1.5rem 1rem;
    }
    
    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }
    
    /* Compact header for mobile */
    .modal-header-compact {
        flex-direction: row;
        gap: 1rem;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        align-items: center;
    }
    
    .modal-photo-compact {
        width: 56px;
        height: 56px;
    }
    
    .modal-photo-compact svg {
        width: 28px;
        height: 28px;
    }
    
    .modal-header-info {
        flex: 1;
    }
    
    .modal-name-compact {
        font-size: 1.375rem;
    }
    
    .modal-meta-row {
        justify-content: center;
        font-size: 0.8125rem;
    }
    
    .modal-party-compact {
        font-size: 0.8125rem;
        padding: 0.25rem 0.625rem;
    }
    
    .modal-constituency-compact {
        font-size: 0.8125rem;
    }
    
    .modal-demographics-row {
        justify-content: center;
    }
    
    /* Stack columns on mobile */
    .modal-two-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .modal-sidebar {
        padding-right: 0;
        overflow-y: visible;
    }
    
    .modal-sidebar-section {
        margin-bottom: 1rem;
    }
    
    .modal-sidebar-title {
        font-size: 0.8125rem;
    }
    
    .modal-main {
        padding-right: 0;
        overflow-y: visible;
    }
    
    .modal-main-header {
        position: relative;
        padding-bottom: 0.5rem;
    }
    
    .modal-main-title {
        font-size: 1rem;
    }
    
    .modal-history-link {
        font-size: 0.75rem;
    }
    
    .modal-history-stats {
        gap: 0.5rem;
    }
    
    .modal-stat-card {
        padding: 0.75rem;
    }
    
    .modal-stat-value {
        font-size: 1.25rem;
    }
    
    .modal-stat-label {
        font-size: 0.6875rem;
    }
    
    .modal-history-timeline {
        max-height: 400px;
    }
    
    .modal-timeline-item {
        padding-left: 1.5rem;
    }
    
    .modal-timeline-card {
        padding: 0.75rem;
    }
    
    .modal-timeline-seat {
        font-size: 0.875rem;
    }
    
    .modal-timeline-meta {
        font-size: 0.75rem;
    }
    
    .modal-timeline-badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
    }
    
    .modal-timeline-details {
        font-size: 0.75rem;
    }
    
    /* Social links more compact */
    .modal-social-link-compact {
        padding: 0.5rem;
    }
    
    .modal-social-icon-compact {
        width: 28px;
        height: 28px;
    }
    
    .modal-social-icon-compact svg {
        width: 16px;
        height: 16px;
    }
    
    .modal-social-name-compact {
        font-size: 0.75rem;
    }
}

.modal-manifesto-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    background: white;
}

.modal-manifesto-card:hover {
    border-color: #FF8C42;
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.1);
}

/* Image Manifesto Styles */
.modal-manifesto-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #f8fafc;
}

.modal-manifesto-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
    background: white;
}

.modal-manifesto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
}

.modal-manifesto-image-container:hover .modal-manifesto-overlay {
    opacity: 1;
}

/* PDF Manifesto Styles */
.modal-manifesto-pdf-container {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.modal-manifesto-pdf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 1px solid #cbd5e1;
}

.modal-manifesto-pdf-title {
    font-weight: 600;
    color: #334155;
    font-size: 0.875rem;
}

.modal-manifesto-pdf-open-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #FF8C42;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-manifesto-pdf-open-btn:hover {
    background: #ff7a28;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.3);
}

.modal-manifesto-pdf-viewer {
    width: 100%;
    height: 500px;
    border: none;
    background: white;
}

/* Generic File Type Styles */
.modal-manifesto-generic {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.modal-manifesto-generic:hover {
    background: #f1f5f9;
    color: #FF8C42;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-manifesto-generic svg {
    width: 32px;
    height: 32px;
}

/* Reference/Source Link Styles */
.modal-manifesto-reference-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-top: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.modal-manifesto-reference-link:hover {
    color: #FF8C42;
    background: #fef3e9;
}

/* Responsive adjustments for manifestos */
@media (max-width: 768px) {
    .modal-manifesto-pdf-viewer {
        height: 400px;
    }
    
    .modal-manifesto-image {
        max-height: 400px;
    }
    
    .modal-manifesto-pdf-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .modal-manifesto-pdf-open-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Contribute CTA Button in Modal */
.contribute-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.contribute-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.contribute-cta-button:active {
    transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modal-overlay {
        align-items: center;
        padding: 1rem;
    }

    .modal-content {
        max-height: 85vh;
        border-radius: 12px;
        max-width: 100%;
        margin: 0;
    }

    .constituency-modal-content {
        max-height: 90vh;
    }

    .modal-constituency-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    #modalBody {
        padding: 1.5rem;
    }

    #constituencyModalBody {
        padding: 1.5rem;
    }

    .candidate-header {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }

    #modalCandidateName {
        font-size: 1.5rem;
    }

    .modal-party-badge {
        padding: 0.4rem 0.875rem;
    }

    .modal-party-logo {
        width: 28px;
        height: 28px;
    }

    #modalPartyName {
        font-size: 0.9rem;
    }

    .modal-info-section {
        margin-bottom: 1.5rem;
    }

    .modal-section-title {
        font-size: 1.1rem;
    }

    .modal-social-link {
        padding: 0.875rem 1rem;
    }

    .modal-social-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .contribute-cta-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    .modal-close {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        width: 48px;
        height: 48px;
        font-size: 28px;
        background: rgba(0, 0, 0, 0.08);
        padding: 10px;
    }
}

/* Make candidate items clickable */
.candidate-item {
    cursor: pointer;
    user-select: none;
}

.candidate-item:active {
    transform: scale(0.98);
}

/* ========================
   HEADER ACTIONS & SHARE BUTTON
   ======================== */

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

/* Desktop: Ensure header-actions are visible */
@media (min-width: 769px) {
    .header-actions {
        display: flex;
        position: static;
        flex-direction: row;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        width: auto;
        padding: 0;
    }
}

.share-button {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.debug-button {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    user-select: none;
}

.debug-button:hover,
.debug-button:active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

/* Map Filter Control */
.map-filter-control {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin: 10px;
    overflow: hidden;
}

.filter-section {
    min-width: 160px;
}

.filter-header {
    background: #0b1120;
    color: white;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.filter-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    width: 100%;
    border: none;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    border-bottom: 2px solid transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 140, 66, 0.1);
    user-select: none;
}

.filter-button:hover {
    background: #f8fafc;
}

.filter-button.active {
    background: #fff7ed;
    border-bottom-color: #FF8C42;
    color: #FF8C42;
}

.filter-button.active .filter-icon {
    transform: scale(1.1);
}

.filter-icon {
    font-size: 1.125rem;
    transition: transform 0.2s ease;
}

.filter-label {
    flex: 1;
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-filter-control {
        margin: 8px;
    }
    
    .filter-section {
        min-width: 140px;
    }
    
    .filter-button {
        padding: 8px 10px;
        font-size: 0.8125rem;
    }
}

/* ========================
   CONTRIBUTION BANNER
   ======================== */

.contribution-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 380px;
    background: linear-gradient(135deg, #ffffff 0%, #fffbf7 100%);
    border-radius: 12px;
    box-shadow: 
        0 8px 32px rgba(255, 140, 66, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 140, 66, 0.2);
    animation: slideInUp 0.5s ease-out, subtle-glow 3s ease-in-out infinite;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

@keyframes subtle-glow {
    0%, 100% {
        box-shadow: 
            0 8px 32px rgba(255, 140, 66, 0.15),
            0 4px 12px rgba(0, 0, 0, 0.08),
            0 0 0 1px rgba(255, 140, 66, 0.2);
    }
    50% {
        box-shadow: 
            0 8px 32px rgba(255, 140, 66, 0.25),
            0 4px 12px rgba(0, 0, 0, 0.1),
            0 0 0 1px rgba(255, 140, 66, 0.4);
    }
}

/* NEW Badge */
.banner-new-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #FF8C42 0%, #ff6810 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 3;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Animated Party Logos Background */
.banner-party-logos {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 12px;
    padding: 8px;
    overflow: hidden;
    opacity: 0.06;
    pointer-events: none;
    animation: scroll-logos 20s linear infinite;
}

@keyframes scroll-logos {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.banner-party-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    filter: grayscale(40%) brightness(1.1);
    animation: float-banner-logo 3s ease-in-out infinite;
    flex-shrink: 0;
}

.banner-party-logo:nth-child(1) { animation-delay: 0s; }
.banner-party-logo:nth-child(2) { animation-delay: 0.5s; }
.banner-party-logo:nth-child(3) { animation-delay: 1s; }
.banner-party-logo:nth-child(4) { animation-delay: 1.5s; }
.banner-party-logo:nth-child(5) { animation-delay: 2s; }
.banner-party-logo:nth-child(6) { animation-delay: 2.5s; }

@keyframes float-banner-logo {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-6px) scale(1.05);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.contribution-banner.hiding {
    animation: slideOutDown 0.3s ease-in;
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.contribution-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    position: relative;
    z-index: 2;
    gap: 12px;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.banner-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.contribution-banner-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    line-height: 1;
}

.contribution-banner-text {
    flex: 1;
    min-width: 0;
}

.contribution-banner-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 3px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.banner-pulse-dot {
    width: 6px;
    height: 6px;
    background: #FF8C42;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.7);
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(255, 140, 66, 0);
    }
}

.contribution-banner-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
    font-weight: 500;
}

.banner-highlight {
    color: #FF8C42;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.1) 0%, rgba(255, 140, 66, 0.05) 100%);
    padding: 1px 5px;
    border-radius: 4px;
}

.contribution-banner-button {
    background: linear-gradient(135deg, #FF8C42 0%, #ff7a29 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 
        0 4px 12px rgba(255, 140, 66, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.contribution-banner-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.contribution-banner-button:hover::before {
    left: 100%;
}

.contribution-banner-button span {
    position: relative;
    z-index: 1;
}

.contribution-banner-button svg {
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.contribution-banner-button:hover {
    background: linear-gradient(135deg, #ff7a29 0%, #ff6810 100%);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 
        0 6px 20px rgba(255, 140, 66, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.contribution-banner-button:hover svg {
    transform: translateX(3px);
}

.contribution-banner-button:active {
    transform: translateY(0) scale(0.98);
}

.contribution-banner-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: #64748b;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contribution-banner-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #334155;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .contribution-banner {
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
    
    .banner-new-badge {
        top: 6px;
        right: 6px;
        font-size: 0.5625rem;
        padding: 2px 6px;
    }
    
    .contribution-banner-content {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .banner-left {
        gap: 8px;
    }
    
    .banner-right {
        gap: 5px;
    }
    
    .contribution-banner-icon {
        font-size: 1.5rem;
    }
    
    .contribution-banner-title {
        font-size: 0.8125rem;
    }
    
    .banner-pulse-dot {
        width: 5px;
        height: 5px;
    }
    
    .contribution-banner-subtitle {
        font-size: 0.6875rem;
    }
    
    .banner-highlight {
        padding: 0px 4px;
    }
    
    .contribution-banner-button {
        padding: 7px 12px;
        font-size: 0.75rem;
    }
    
    .contribution-banner-button svg {
        width: 12px;
        height: 12px;
    }
    
    .contribution-banner-close {
        width: 22px;
        height: 22px;
        font-size: 1rem;
    }
    
    .banner-party-logo {
        height: 24px;
    }
}

/* Make candidate items clickable */
.candidate-item {
    cursor: pointer;
    user-select: none;
}

.candidate-item:active {
    transform: scale(0.98);
}


/* ========================
   SEARCH BAR & RESULTS
   ======================== */

/* Search Container */
.search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin: 0 1rem;
}

/* Search Box */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.625rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    margin-right: 0.625rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 16px; /* At least 16px to prevent mobile zoom */
    font-weight: 500;
    padding: 0.25rem 0;
    /* Additional mobile zoom prevention */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px; /* Match input size */
}

.search-clear {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 0.5rem;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.search-clear svg {
    width: 16px;
    height: 16px;
}

.search-close-mobile {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 0.5rem;
}

.search-close-mobile:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.search-close-mobile svg {
    width: 18px;
    height: 18px;
}

/* Search Dropdown */
.search-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    max-height: 70vh;
    overflow-y: auto;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-dropdown-content {
    padding: 0.5rem;
}

/* Search Results Category */
.search-category {
    margin-bottom: 1rem;
}

.search-category:last-child {
    margin-bottom: 0;
}

.search-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.search-category-icon {
    font-size: 1rem;
}

.search-category-count {
    margin-left: auto;
    background: #e2e8f0;
    color: #475569;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Search Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.search-result-item:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    transform: translateX(4px);
}

.search-result-item:active {
    transform: translateX(2px) scale(0.99);
}

.search-result-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.search-result-icon.candidate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.search-result-icon.constituency {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.search-result-icon.parliament {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    flex-wrap: wrap;
}

.search-result-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
}

.search-result-party {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: #FF8C42;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* See All Button */
.search-see-all {
    display: block;
    width: 100%;
    padding: 0.875rem;
    margin-top: 0.5rem;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-see-all:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #475569;
}

/* Empty State */
.search-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: #94a3b8;
}

.search-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.search-empty-subtitle {
    font-size: 0.9rem;
    color: #94a3b8;
}

/* Loading State */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.search-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top-color: #FF8C42;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.75rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================
   EXPANDABLE SEARCH PANEL
   ======================== */

.search-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.search-panel.open {
    transform: translateX(0);
}

.search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    border-bottom: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.search-panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.search-panel-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-panel-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.search-panel-close svg {
    width: 24px;
    height: 24px;
}

.search-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Search Panel Result Item (larger, richer) */
.search-panel-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid #e2e8f0;
    background: white;
    margin-bottom: 1rem;
}

.search-panel-item:hover {
    border-color: #FF8C42;
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.15);
    transform: translateY(-2px);
}

.search-panel-item:active {
    transform: translateY(0);
}

.search-panel-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.search-panel-content-area {
    flex: 1;
    min-width: 0;
}

.search-panel-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.search-panel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.search-panel-detail {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
}

/* Search Panel Overlay (for mobile backdrop) */
.search-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.search-panel-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ========================
   MOBILE RESPONSIVE SEARCH
   ======================== */

@media (max-width: 768px) {
    .search-container {
        position: static;
        margin: 0 0.5rem;
        flex: 0 0 auto;
        width: 44px;
    }

    /* Collapsed state - just show icon button in header */
    .search-container:not(.expanded) .search-box {
        width: 100%;
        padding: 0.5rem;
        min-width: 44px;
        justify-content: center;
        display: flex;
        align-items: center;
    }

    .search-container:not(.expanded) .search-icon {
        margin-right: 0;
        cursor: pointer;
        flex-shrink: 0;
    }

    /* Hide input and clear button when collapsed */
    .search-container:not(.expanded) .search-input,
    .search-container:not(.expanded) .search-clear,
    .search-container:not(.expanded) .search-close-mobile {
        display: none !important;
    }

    /* Expanded state - position below header, full width */
    .search-container.expanded {
        position: fixed;
        top: 60px; /* Header height */
        left: 0;
        right: 0;
        width: 100%;
        margin: 0;
        z-index: 1050;
        background: white;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        padding: 0.75rem 1rem;
        animation: slideDownMobile 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes slideDownMobile {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .search-container.expanded .search-box {
        width: 100%;
        background: rgba(0, 0, 0, 0.05);
        border: 2px solid #e2e8f0;
        backdrop-filter: none;
        padding: 0.625rem 1rem;
    }

    .search-container.expanded .search-icon {
        color: #64748b;
        margin-right: 0.625rem;
    }

    .search-container.expanded .search-input {
        display: block;
        flex: 1;
        color: #0f172a;
        font-size: 16px; /* At least 16px to prevent iOS auto-zoom */
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .search-container.expanded .search-input::placeholder {
        color: #94a3b8;
        font-size: 16px; /* Match input size */
    }

    .search-container.expanded .search-clear {
        display: flex;
        color: #64748b;
    }

    .search-container.expanded .search-close-mobile {
        display: flex;
        color: #64748b;
    }

    /* Dropdown positioning for expanded mobile search */
    .search-container.expanded .search-dropdown {
        position: absolute; /* Keep it absolute, not fixed! */
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        width: auto;
        max-height: calc(70vh - 80px); /* Account for search bar */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y; /* Allow vertical scrolling */
        z-index: 1100; /* Ensure it's on top */
        pointer-events: auto; /* Make sure it can receive clicks */
    }

    .search-dropdown {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .search-dropdown-content {
        padding: 0.5rem;
    }

    /* Full-width panel on mobile */
    .search-panel {
        width: 100%;
        max-width: 100%;
    }

    .search-panel-header {
        padding: 1.25rem 1.5rem;
    }

    .search-panel-title {
        font-size: 1.25rem;
    }

    .search-panel-content {
        padding: 1.25rem;
    }

    .search-panel-item {
        padding: 1rem;
        gap: 1rem;
    }

    .search-panel-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .search-panel-name {
        font-size: 1rem;
    }

    /* Search overlay backdrop for mobile - DISABLED, was blocking clicks */
    .search-mobile-backdrop {
        display: none !important; /* Force disabled for now */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: transparent;
        z-index: 1049;
        pointer-events: none; /* Don't block clicks! */
    }

    .search-mobile-backdrop.visible {
        display: none !important; /* Keep disabled */
    }
}

@media (max-width: 600px) {
    .search-container:not(.expanded) {
        width: 40px;
    }

    .search-container:not(.expanded) .search-box {
        width: 40px;
        min-width: 40px;
        padding: 0.45rem;
    }

    .search-result-item {
        padding: 0.75rem;
        gap: 0.875rem;
    }

    .search-result-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .search-result-name {
        font-size: 0.9rem;
    }

    .search-result-meta {
        font-size: 0.75rem;
    }
}

/* ========================
   PARTY MANIFESTO MODAL
   ======================== */

.party-manifesto-body {
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-height: 800px;
}

.party-manifesto-header {
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.party-manifesto-title {
    font-size: 1.75rem;
    padding: 8px 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.party-manifesto-subtitle {
    font-size: 0.95rem;
    padding: 8px 20px;
    color: #64748b;
}

.party-manifesto-credit {
    margin-top: 0.75rem;
    padding: 0 20px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.party-manifesto-credit a {
    color: #FF8C42;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.party-manifesto-credit a:hover {
    color: #ff7a29;
    text-decoration: underline;
}

.party-manifesto-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1.5rem;
}

.party-manifesto-loading p {
    color: #64748b;
    font-size: 0.95rem;
}

.party-manifesto-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
    color: #94a3b8;
}

.party-manifesto-error svg {
    color: #cbd5e1;
}

.party-manifesto-error p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Two-Column Layout for Desktop */
.party-manifesto-container {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    flex: 1;
    overflow: hidden;
}

/* Left Party Selector Strip (Desktop) / Bottom (Mobile) */
.party-manifesto-sidebar {
    width: 150px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    order: 1;
}

.party-manifesto-sidebar-header {
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.party-manifesto-sidebar-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.party-count {
    font-size: 0.75rem;
    color: #64748b;
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-weight: 500;
}

/* Vertical Scrolling Party List (Desktop) */
.party-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.875rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.party-list::-webkit-scrollbar {
    height: 6px;
}

.party-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.party-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.party-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Compact Party Tiles */
.party-tile {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.party-tile:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.party-tile.active {
    border-color: #FF8C42;
    border-width: 2px;
    background: linear-gradient(135deg, rgba(255, 140, 66, 0.08) 0%, rgba(255, 140, 66, 0.03) 100%);
    box-shadow: 0 2px 12px rgba(255, 140, 66, 0.25);
}

.party-tile.active:hover {
    transform: translateY(-2px);
}

.party-tile-logo {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f8fafc;
    padding: 0.25rem;
    flex-shrink: 0;
}

.party-tile-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.party-tile-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.2;
    max-width: 85px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.party-tile.active .party-tile-name {
    color: #FF8C42;
}

.party-tile-pages {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 500;
}

.party-tile.active .party-tile-pages {
    color: #ff9454;
}

/* Right Content - Manifesto Viewer */
.party-manifesto-viewer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    overflow: hidden;
    order: 1;
}

.party-manifesto-viewer-content {
    flex: 1;
    overflow-y: auto;
}

.party-manifesto-viewer-content::-webkit-scrollbar {
    width: 8px;
}

.party-manifesto-viewer-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.party-manifesto-viewer-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.party-manifesto-viewer-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Empty State */
.party-manifesto-viewer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 4rem 2rem;
    gap: 1rem;
    color: #94a3b8;
}

.party-manifesto-viewer-empty svg {
    color: #cbd5e1;
}

.party-manifesto-viewer-empty p {
    color: #64748b;
    font-size: 0.95rem;
}

/* Viewer Header */
.party-manifesto-viewer-header {
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #FF8C42 0%, #ff7a29 100%);
    color: white;
    border-bottom: 2px solid #ff7a29;
}

.party-manifesto-viewer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.party-manifesto-viewer-meta {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Pages Scroll Container */
.party-manifesto-pages-scroll {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Page Card */
.party-manifesto-page-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.party-manifesto-page-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.party-manifesto-page-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.party-manifesto-page-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.party-manifesto-page-img:hover {
    border-color: #FF8C42;
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.2);
    transform: scale(1.01);
}

/* Party Manifesto Lightbox */
.party-manifesto-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.party-manifesto-lightbox.active {
    display: flex;
    opacity: 1;
}

.party-manifesto-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.party-manifesto-lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.party-manifesto-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #0f172a;
    transition: all 0.2s ease;
    z-index: 10001;
}

.party-manifesto-lightbox-close:hover {
    background: white;
    transform: scale(1.1);
}

.party-manifesto-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10001;
}

.party-manifesto-lightbox-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.party-manifesto-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.party-manifesto-lightbox-nav:disabled:hover {
    transform: translateY(-50%) scale(1);
}

.party-manifesto-lightbox-prev {
    left: 20px;
}

.party-manifesto-lightbox-next {
    right: 20px;
}

.party-manifesto-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 10001;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .party-manifesto-body {
        height: 90vh;
    }
    
    .party-manifesto-title {
        font-size: 1.5rem;
    }
    
    .party-manifesto-credit {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }
    
    /* Switch to column layout on mobile */
    .party-manifesto-container {
        flex-direction: column;
    }
    
    /* Party selector at bottom on mobile */
    .party-manifesto-sidebar {
        width: 100%;
        border-radius: 0;
        border-top: 2px solid #e2e8f0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
        background: white;
        order: 2;
    }
    
    /* Manifesto viewer takes priority on mobile */
    .party-manifesto-viewer-container {
        order: 1;
    }
    
    .party-manifesto-sidebar-header {
        padding: 0.625rem 1rem;
        background: #f8fafc;
    }
    
    .party-manifesto-sidebar-header h3 {
        font-size: 0.8rem;
    }
    
    .party-count {
        font-size: 0.7rem;
    }
    
    /* Horizontal scroll on mobile */
    .party-list {
        flex-direction: row;
        padding: 0.75rem 1rem 0.875rem;
        gap: 0.5rem;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .party-tile {
        padding: 0.5rem 0.625rem;
        min-width: 75px;
        gap: 0.3rem;
    }
    
    .party-tile-logo {
        width: 32px;
        height: 32px;
    }
    
    .party-tile-name {
        font-size: 0.65rem;
        max-width: 70px;
    }
    
    .party-tile-pages {
        font-size: 0.6rem;
    }
    
    .party-manifesto-viewer-header {
        padding: 1.25rem 1.5rem;
    }
    
    .party-manifesto-viewer-title {
        font-size: 1.15rem;
    }
    
    .party-manifesto-pages-scroll {
        padding: 1.25rem;
        gap: 1.25rem;
    }
    
    .party-manifesto-page-card {
        padding: 0.875rem;
    }
    
    .party-manifesto-lightbox-close,
    .party-manifesto-lightbox-nav {
        width: 40px;
        height: 40px;
    }
    
    .party-manifesto-lightbox-close {
        top: 10px;
        right: 10px;
    }
    
    .party-manifesto-lightbox-prev {
        left: 10px;
    }
    
    .party-manifesto-lightbox-next {
        right: 10px;
    }
    
    .party-manifesto-lightbox-counter {
        bottom: 10px;
        font-size: 0.85rem;
        padding: 0.625rem 1.25rem;
    }
}

/* Very small mobile screens */
@media (max-width: 480px) {
    .party-tile {
        min-width: 70px;
    }
    
    .party-tile-logo {
        width: 28px;
        height: 28px;
    }
    
    .party-tile-name {
        font-size: 0.6rem;
        max-width: 65px;
    }
    
    .party-list {
        padding: 0.625rem 0.875rem 0.75rem;
    }
}

/* ========================
   PREDICTIONS MODAL
   ======================== */

.predictions-modal .modal-content {
    position: relative;
    overflow: hidden;
    max-width: 700px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.predictions-modal-content {
    position: relative;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
}

/* Animated Background */
.predictions-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
    opacity: 0.08;
    pointer-events: none;
}

.party-rank-item {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: float-ranks 8s ease-in-out infinite;
    white-space: nowrap;
}

.party-rank-item:nth-child(1) { left: -10%; top: 5%; animation-duration: 10s; }
.party-rank-item:nth-child(2) { right: -15%; top: 15%; animation-duration: 12s; }
.party-rank-item:nth-child(3) { left: -8%; top: 35%; animation-duration: 11s; }
.party-rank-item:nth-child(4) { right: -12%; top: 45%; animation-duration: 13s; }
.party-rank-item:nth-child(5) { left: -10%; top: 60%; animation-duration: 9s; }
.party-rank-item:nth-child(6) { right: -15%; top: 70%; animation-duration: 14s; }
.party-rank-item:nth-child(7) { left: -8%; bottom: 10%; animation-duration: 10.5s; }
.party-rank-item:nth-child(8) { right: -12%; bottom: 5%; animation-duration: 11.5s; }
.party-rank-item:nth-child(9) { left: 50%; top: -5%; animation-duration: 13s; transform: translateX(-50%); }
.party-rank-item:nth-child(10) { left: 50%; bottom: -5%; animation-duration: 12.5s; transform: translateX(-50%); }
.party-rank-item:nth-child(11) { left: 20%; top: -8%; animation-duration: 11s; }
.party-rank-item:nth-child(12) { right: 20%; bottom: -8%; animation-duration: 13.5s; }

@keyframes float-ranks {
    0%, 100% { 
        transform: translateY(0px) translateX(0px);
        opacity: 0.6;
    }
    25% { 
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
    50% { 
        transform: translateY(-10px) translateX(-10px);
        opacity: 1;
    }
    75% { 
        transform: translateY(-25px) translateX(5px);
        opacity: 0.7;
    }
}

.party-rank-position {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FF8C42;
    min-width: 35px;
}

.party-rank-logo-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.party-rank-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.party-rank-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

/* Main Content */
.predictions-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
    width: 100%;
}

.predictions-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: bounce-gentle 2s ease-in-out infinite;
}

@keyframes bounce-gentle {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.predictions-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.predictions-subtitle {
    font-size: 1.05rem;
    color: #64748b;
    margin-bottom: 2.5rem;
    line-height: 1.5;
}

.predictions-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
    align-items: flex-start;
    text-align: left;
    width: 100%;
}

.prediction-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.875rem 1.25rem;
    background: white;
    border-radius: 12px;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.prediction-feature:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 140, 66, 0.15);
}

.prediction-feature svg {
    color: #FF8C42;
    flex-shrink: 0;
}

.prediction-feature span {
    color: #1e293b;
    font-weight: 500;
    font-size: 0.95rem;
}

.predictions-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #FF8C42 0%, #ff7a29 100%);
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.3);
    margin-bottom: 1rem;
}

.predictions-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 140, 66, 0.4);
    background: linear-gradient(135deg, #ff7a29 0%, #FF8C42 100%);
}

.predictions-cta-btn svg {
    transition: transform 0.3s ease;
}

.predictions-cta-btn:hover svg {
    transform: translateX(5px);
}

.predictions-maybe-later {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}

.predictions-maybe-later:hover {
    color: #64748b;
}

/* Make Prediction Button (Sidebar) */
.make-prediction-btn {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #FF8C42 0%, #ff7a29 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.25);
    margin-top: 8px;
}

.make-prediction-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 140, 66, 0.35);
    background: linear-gradient(135deg, #ff7a29 0%, #FF8C42 100%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .predictions-modal-content {
        padding: 2rem 1.5rem;
    }
    
    .predictions-icon {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    
    .predictions-title {
        font-size: 1.5rem;
    }
    
    .predictions-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }
    
    .predictions-features {
        gap: 0.75rem;
        margin-bottom: 2rem;
    }
    
    .prediction-feature {
        padding: 0.75rem 1rem;
    }
    
    .prediction-feature span {
        font-size: 0.875rem;
    }
    
    .predictions-cta-btn {
        width: 100%;
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .party-rank-item {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .party-rank-position {
        font-size: 1rem;
        min-width: 28px;
    }
    
    .party-rank-logo-wrapper {
        width: 32px;
        height: 32px;
    }
    
    .party-rank-name {
        font-size: 0.8rem;
    }
}
