/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    color: #e2e8f0;
    line-height: 1.6;
    min-height: 100vh;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    font-size: 18px;
}

.loading-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-subtext {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 10px;
    color: #a0aec0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Header with Logos */
/* Header with Logos */
.header {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.header-logos-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

.header-content {
    text-align: center;
    width: 100%;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f9f6f6;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #d90ceb 0%, #9ee004 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content p {
    font-size: 0.95rem;
    color: #a0aec0;
    font-weight: 400;
    margin-bottom: 0;
}

.header-logo-left,
.header-logo-right {
    flex-shrink: 0;
}

.logo-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-image:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.logo-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.logo-circle span {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-language {
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #e2e8f0;
    font-size: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-language:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Map Overlay Controls */
.map-overlay-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.filter-select-overlay {
    padding: 2px 5px;
    border: 2px solid #adb2b9;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.7);
    color: #252627;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-select-overlay:focus {
    outline: none;
    border-color: #1f2542;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(255, 222, 195, 0.9);
}

.filter-select-overlay option {
    background: #ebebec;
    color: #370138;
}

.constituency-filter-overlay {
    max-width: none;
}

/* Button Styles */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 2px solid #2d3748;
    
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 2px solid #2d3748;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #4a5568;
    transform: translateY(-1px);
}

.btn-facebook {
    background: linear-gradient(135deg, #1877f2 0%, #166fe5 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.3);
}

.btn-facebook:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.5);
}

.btn-twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.3);
}

.btn-twitter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 161, 242, 0.5);
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3);
}

.btn-instagram:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 48, 108, 0.5);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Map Section */
.map-section {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

#map {
    height: 600px;
    width: 100%;
    border-radius: 16px;
    position: relative;
}

/* Division Labels */
.division-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.division-name {
    font-family: Helvetica;
    background: transparent;
    color: #2f3134f3; /* Changed to a lighter, more subtle color */
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 400; /* Changed from 600 to normal weight (non-bold) */
    text-align: center;
    white-space: nowrap;
    opacity: 0.85; /* Added slight transparency */
}

/* Input Section */
.input-section {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    max-height: 600px;
}

.no-selection {
    text-align: center;
    color: #718096;
    padding: 60px 20px;
}

.no-selection h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #e2e8f0;
}

.no-selection p {
    font-size: 1rem;
    line-height: 1.8;
    color: #a0aec0;
    margin-bottom: 20px;
}

.no-selection .user-info {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
    display: inline-block;
}

/* Party Selection */
.party-selection {
    animation: slideIn 0.3s ease;
}

.party-selection h4 {
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 10px;
    text-align: center;
}

.party-instruction {
    text-align: center;
    color: #a0aec0;
    margin-bottom: 25px;
    font-size: 1rem;
}

.party-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.party-option {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.party-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.party-option:hover .party-arrow {
    transform: translateX(5px);
}

.party-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.party-info {
    flex: 1;
}

.party-info h5 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.party-info span {
    font-size: 0.9rem;
    color: #a0aec0;
}

.party-arrow {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: bold;
    transition: transform 0.2s ease;
}

/* Constituency Form */
.constituency-form {
    animation: slideIn 0.3s ease;
}

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

.form-header {
    margin-bottom: 10px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.form-header h3 {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0px;
}

.party-badge {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.party-badge span:first-child {
    color: #a0aec0;
}

.party-badge span:last-child {
    color: #667eea;
}

/*
.constituency-info {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.5;
}
*/
/* Leader Inputs Section */
.leader-inputs-section h4 {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 10px;
}

.form-instruction {
    color: #a0aec0;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.leader-inputs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

/* Leader Selection Container - Enhanced Form with Duplicate Prevention */
.leader-selection-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leader-dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #2d3748;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    transition: all 0.2s ease;
}

.leader-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.leader-dropdown option {
    background: #1a202c;
    color: #e2e8f0;
}

.btn-add-leader {
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 6px;
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.btn-add-leader:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.leader-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #2d3748;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    transition: all 0.2s ease;
}

.leader-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.leader-input::placeholder {
    color: #718096;
}

/* Duplicate validation styling */
.leader-input.duplicate {
    border-color: #f56565;
    box-shadow: 0 0 0 3px rgba(245, 101, 101, 0.2);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.form-help {
    background: rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.5;
}

.analytics-section {
    display: grid;
    grid-template-columns: 1fr; /* Single column for desktop */
    gap: 20px;
    margin-bottom: 30px;
}


/* Word Cloud Section - Full Width */
.wordcloud-section {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.wordcloud-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 25px;
    text-align: center;
}

/* Analytics Container */
.analytics-container {
    position: relative;
    width: 100%;
    height: 450px; /* Increased height */
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
    flex: 1;
}

#wordcloudContainer {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

#chartContainer {
    position: relative;
    width: 100%;
    height: 450px; /* Same as word cloud */
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}


/* Advanced Speech Bubble Tooltip Styles */
.speech-bubble {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
    word-break: break-word;
    line-height: 1.3;
    color: white;
    animation: bubbleFloat 8s ease-in-out infinite;
    user-select: none;
    overflow: visible;
    max-width: 28ch;
    opacity: 0.9;
    backdrop-filter: blur(5px);
}

/* Speech bubble animation */
@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-3px) rotate(0.5deg);
    }
    50% {
        transform: translateY(-6px) rotate(0deg);
    }
    75% {
        transform: translateY(-3px) rotate(-0.5deg);
    }
}

.speech-bubble:hover {
    transform: scale(1.1) translateY(-5px);
    z-index: 999 !important;
    animation-play-state: paused;
    filter: brightness(1.1) saturate(1.2);
    opacity: 1 !important;
}

/* Circular Shape - For Top 1st Leaders */
.speech-bubble.bubble-circular {
    padding: 1em;
    border-radius: 50%;
    background: var(--bubble-color, #4ECDC4);
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    aspect-ratio: 1;
    width: auto;
    height: auto;
    min-width: 80px;
    min-height: 80px;
}

.speech-bubble.bubble-circular:before {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: inherit;
    border-radius: 50%;
}

.speech-bubble.bubble-circular:after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: inherit;
    border-radius: 50%;
}

/* Parabolic Shape - For Top 2nd Leaders */
.speech-bubble.bubble-parabolic {
    --b: 3em;
    --h: 1.8em;
    --t: .6;
    --p: 50%;
    --r: 1.2em;
    padding: 1em;
    border-radius: var(--r) var(--r) min(var(--r),100% - var(--p) - (1 - var(--t))*var(--b)/2) min(var(--r),var(--p) - (1 - var(--t))*var(--b)/2)/var(--r);
    background: var(--bubble-color, #4ECDC4);
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.speech-bubble.bubble-parabolic:before {
    content: "";
    position: absolute;
    top: 100%;
    left: clamp(-1*var(--t)*var(--b),var(--p) - (var(--t) + 1)*var(--b)/2,100% - var(--b));
    width: var(--b);
    height: var(--h);
    background: inherit;
    border-bottom-right-radius: 100%;
    -webkit-mask: radial-gradient(calc(var(--t)*100%) 105% at 0 0,#0000 99%,#000 101%);
    mask: radial-gradient(calc(var(--t)*100%) 105% at 0 0,#0000 99%,#000 101%);
}

/* Rectangular Shape - For Top 3rd Leaders */
.speech-bubble.bubble-rectangular {
    padding: 1em 1.2em;
    border-radius: 12px;
    background: var(--bubble-color, #4ECDC4);
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.speech-bubble.bubble-rectangular:before {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--bubble-color, #4ECDC4);
}


/* Chart Section - Full Width */
.chart-section {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.chart-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 25px;
    text-align: center;
}


#leaderChart {
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
}


/* Party Legend - NEW */
.party-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chart-empty {
    text-align: center;
    color: #718096;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 40px;
}

/* Bottom Actions Section - NEW */
.bottom-actions {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.share-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 1rem;
    white-space: nowrap;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    border-left: 4px solid #48bb78;
}

.notification.error {
    border-left: 4px solid #f56565;
}

.notification.warning {
    border-left: 4px solid #ed8936;
}

.notification.info {
    border-left: 4px solid #4299e1;
}

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

/* Custom Leaflet Styles */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
}

.leaflet-popup-content {
    margin: 10px;
    font-family: inherit;
    font-size: 0.8rem;
    line-height: 1.2;
    color: #ffffff;
}

.leaflet-popup-tip {
    background: rgba(0, 0, 0, 0.9);
}

.leaflet-control {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    background: rgba(0, 0, 0, 0.8);
}

.leaflet-control a {
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
}

.leaflet-control a:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

/* Smaller Zoom Controls */
.leaflet-control-zoom {
    transform: scale(0.8);
    transform-origin: bottom left;
}

.leaflet-control-zoom a {
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;
    font-size: 16px !important;
}

/* Adjust position for bottom-left placement */
.leaflet-bottom.leaflet-left {
    bottom: 10px;
    left: 10px;
}


/* Custom tooltip styles */
.custom-tooltip {
    background: rgba(0, 0, 0, 0.9) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6) !important;
}

.custom-tooltip:before {
    border-top-color: rgba(0, 0, 0, 0.9) !important;
}

/* Division tooltip styles */
.division-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
}

/* Text center utility */
.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .analytics-section {
        grid-template-columns: 1fr; /* Already single column */
    }
    
    .analytics-container {
        height: 400px;
    }

    #wordcloudContainer {
        height: 450px;       
    }
    
    
    #chartContainer {
        height: 400px;
    }
    
    .bottom-actions {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .share-section {
        justify-content: center;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    #map {
        height: 400px;
    }
    
    .input-section {
        max-height: none;
    }
    
    .map-overlay-controls {
        right: 10px;
        top: 10px;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
        .header {
        padding: 20px 15px;
        position: relative;
    }
    
    .header-logos-row {
        width: 100%;
        max-width: none;
        margin-bottom: 10px;
    }
    
    .header-logo-left,
    .header-logo-right {
        width: auto;
    }
    
    .logo-image {
        width: 70px;
        height: 70px;
    }

    .logo-circle {
        width: 70px;
        height: 70px;
    }
    
    .logo-circle span {
        font-size: 1.8rem;
    }
    
    .header-content {
        order: 3;
        width: 100%;
    }
    
    .header-content h1 {
        font-size: 1.6rem;
    }
    
    .header-content p {
        font-size: 0.85rem;
    }
    
    .language-switcher {
        position: static;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 10px;
    }

    .form-actions {
        flex-direction: column;
    }
    
    .wordcloud-section,
    .chart-section {
        padding: 20px;
    }
    
    .analytics-container {
        height: 350px;
    }
    
    #chartContainer {
        height: 350px;
    }
    
    .party-option {
        padding: 15px;
    }
    
    .party-color {
        width: 24px;
        height: 24px;
        margin-right: 15px;
    }
    
    .party-info h5 {
        font-size: 1.1rem;
    }
    
    .party-info span {
        font-size: 0.8rem;
    }
    
    .leader-selection-container {
        gap: 6px;
    }
    
    .btn-add-leader {
        font-size: 0.67rem;
        padding: 5px 8px;
    }

    #wordcloudContainer {
        height: 450px;       
    }
    
    
    .speech-bubble {
        font-size: 11px !important;
        padding: 6px 10px !important;
    }
    
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        max-width: none;
    }
    
    .map-overlay-controls {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 15px;
        min-width: auto;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .bottom-actions {
        padding: 20px;
    }
    
    .share-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .share-label {
        margin-bottom: 5px;
    }

    .party-legend {
        gap: 10px;
        padding: 10px;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
    
    .legend-color {
        width: 16px;
        height: 16px;
    }
}