.pawins-map-container {
    position: relative;
    width: 100%;
    height: 60vh;
}

#map {
    height: 100%;
    width: 100%;
}

#topic-selector {
    position: absolute;
    top: 10px;
    left: 50px;
    z-index: 1000;
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

/* New styles for top controls */
.top-controls-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

#reset-button {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    height: 36px; /* Match height with dropdown */
    white-space: nowrap;
}

#reset-button:hover {
    background: #f0f0f0;
}

/* Style for the district dropdown */
.district-dropdown {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    flex: 1;
    min-width: 200px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 12px auto;
    padding-right: 30px;
}

.district-dropdown:hover {
    border-color: #1698cb;
}

.district-dropdown:focus {
    outline: none;
    border-color: #1698cb;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.report-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.report-button:hover {
    background-color: #0056b3;
}

.report-button-wrapper {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 0;
}

.topic-dropdown-wrapper {
    position: relative;
    margin-top: 10px;
}

.topic-dropdown-button {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    min-width: 200px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-dropdown-button:hover {
    border-color: #1698cb;
}

.topic-dropdown-button:focus {
    outline: none;
    border-color: #1698cb;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.topic-dropdown-text {
    flex: 1;
    text-align: left;
}

.topic-dropdown-arrow {
    font-size: 12px;
    transition: transform 0.2s;
}

.topic-dropdown-wrapper.open .topic-dropdown-arrow {
    transform: rotate(180deg);
}

.topic-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1001;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.topic-dropdown-wrapper.open .topic-dropdown-content {
    display: block;
}

.topic-checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    padding: 8px 12px;
    transition: background-color 0.2s;
}

.topic-checkbox-item:hover {
    background-color: #f0f0f0;
}

.topic-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

.topic-checkbox-item span {
    user-select: none;
    flex: 1;
}

.leaflet-popup {
    z-index: 1001 !important;
}

.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 450px !important;
}

.leaflet-popup-close-button {
    font-size: 20px !important;
    color: white !important;
    font-weight: bold !important;
    right: 10px !important;
    top: 5px !important;
}

.leaflet-popup-close-button:hover {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

.leaflet-popup-tip-container {
    display: none;
}

.popup-content {
    padding: 0;
}

.popup-header {
    background: #1698cb;
    padding: 10px 15px;
    border-radius: 8px 8px 0 0;
    margin: -1px;
}

.popup-header h3 {
    margin: 0;
    padding-bottom: 5px;
    font-size: 16px;
    color: white !important;
}

.popup-header::after {
    display: none !important;
}

.popup-body {
    padding: 5px;
}

.custom-district-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 550px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1500;
}

.custom-district-popup .popup-header {
    background: #1698cb;
    padding: 5px 10px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-district-popup .popup-header h3 {
    margin: 0;
    padding: 0;
    font-size: 16px;
    color: white;
}

.custom-district-popup .popup-body {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

.custom-district-popup .popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0;
    padding: 0;
}

.custom-district-popup .popup-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.district-links {
    list-style-type: none;
    padding: 0;
    margin: 10px 0 15px 0;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.district-links::-webkit-scrollbar {
    width: 8px;
}

.district-links::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.district-links::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.district-links::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.district-links li {
    margin: 5px 0;
}

.district-links a {
    color: #4a90e2;
    text-decoration: none;
}

.district-links a:hover {
    text-decoration: underline;
}

.district-tooltip-container {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    font-size: 14px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.district-tooltip {
    max-width: 200px;
}

.tooltip-topics, .tooltip-incidents {
    margin-top: 5px;
    font-size: 12px;
}

.label {
    font-weight: bold;
    color: #666;
}

.entry-content ul {
    padding: 0 20px !important;
}

.facilities { color: #761cd4 !important; font-weight: bold !important; }
.book_bans { color: #2f7dd2 !important; font-weight: bold !important; }
.ilc_presence { color: #20c47b !important; font-weight: bold !important; }
.pronouns { color: #fe7620 !important; font-weight: bold !important; }
.sports { color: #d5297f !important; font-weight: bold !important; }
.black { color: #423934 !important; }
.date { color: #423934; font-size: 90%; }

@media (max-width: 768px) {
    .pawins-map-container {
        height: 45vh;
    }

    #topic-selector {
        top: 10px;
        right: 10px;
        width: auto;
    }
    
    .top-controls-wrapper {
        display: flex;
        flex-direction: row; /* Keep items on same line */
        align-items: center;
        gap: 8px; /* Smaller gap for mobile */
        width: 100%;
    }
    
    .district-dropdown {
        flex: 1; /* Take available space */
        min-width: 0; /* Allow for narrower width */
        max-width: none;
    }
    
    #reset-button {
        width: auto; /* Don't force full width */
        margin-bottom: 0; /* Remove bottom margin */
        white-space: nowrap;
        flex-shrink: 0; /* Prevent button from shrinking */
        min-width: 60px; /* Ensure minimum width */
    }
    
    /* Mobile responsive for topic dropdown */
    .topic-dropdown-button {
        min-width: 150px;
        font-size: 13px;
    }
    
    .topic-checkbox-item {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .leaflet-popup-content {
        width: 90vw !important;
        max-width: 450px !important;
    }
    
    .leaflet-popup {
        top: -60px !important;
    }
    
    .leaflet-popup-tip-container {
        top: 100%;
        margin-top: 0;
    }
    
    .custom-district-popup {
        width: 90%;
    }
}

/* Loading Spinner Styles */
.loading-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Above all map elements */
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #1698cb; /* Match with header color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

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

.positive {
    font-weight: bold;
}

.positive-icon {
    margin-left: 3px;
    vertical-align: text-bottom;
    display: inline;
}