/* Base Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
}

#header {
    background: #2c3e50;
    color: white;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#header h1 {
    margin: 0;
    font-size: 1.8rem;
}

#map-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

#map {
    width: 100%;
    height: 100%;
}

/* Base Map Toggle */
#base-map-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#base-map-toggle i {
    font-size: 20px;
    color: #2c3e50;
}

/* Base Map Selection Panel */
#base-map-panel {
    position: absolute;
    top: 70px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    width: 150px;
    display: none;
}

#base-map-panel.active {
    display: block;
}

.base-map-option {
    margin: 8px 0;
    display: flex;
    align-items: center;
}

.base-map-option input {
    margin-right: 8px;
}

.base-map-option label {
    font-size: 0.9rem;
    cursor: pointer;
}

/* Legend with Layer Toggles */
#legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    max-width: 200px;
    font-size: 0.8rem;
}

#legend h4 {
    margin: 10px 0 5px 0;
    font-size: 0.9rem;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 3px;
}

.layer-toggle {
    margin: 10px 0;
}

.layer-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.layer-toggle input {
    margin-right: 8px;
}

.legend-scale {
    margin-left: 20px;
    margin-top: 5px;
}

.legend-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 1px solid #999;
}

/* Story Map */
#story-map {
    position: absolute;
    bottom: 120px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    max-width: 300px;
}

#story-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: #777;
    font-size: 1rem;
    padding: 5px;
    z-index: 1001;
}

#story-close-btn:hover {
    color: #333;
}

.story-panel {
    display: none;
}

.story-panel.active {
    display: block;
}

.story-content {
    margin-top: 10px;
}

.story-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    margin-top: 10px;
    border-radius: 4px;
}

#story-nav {
    text-align: center;
    margin-top: 10px;
}

.story-nav-btn {
    background: #bdc3c7;
    color: #2c3e50;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    margin: 0 3px;
    cursor: pointer;
    font-size: 0.7rem;
}

.story-nav-btn.active {
    background: #3498db;
    color: white;
}

/* Chart Styles */
.chart-container {
    position: relative;
    width: 100%;
    height: 200px;
    margin: 15px 0;
}

.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Popup Styles */
.leaflet-popup-content {
    font-family: 'Arial', sans-serif;
    min-width: 200px;
    font-size: 0.9rem;
}

.toilet-popup h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.toilet-status {
    margin-bottom: 8px;
}

.toilet-details {
    margin-top: 8px;
}

.toilet-details p {
    margin: 5px 0;
}

.toilet-features {
    margin-top: 8px;
}

.feature {
    display: inline-block;
    margin-right: 5px;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.feature.accessible {
    background: #4BC0C0;
    color: white;
}

.feature.limited {
    background: #FFCE56;
    color: #333;
}

.feature.non-accessible {
    background: #FF6384;
    color: white;
}

.feature.baby {
    background: #36A2EB;
    color: white;
}

/* Temple Bar Area Circle */
.temple-bar-area {
    stroke: true;
    color: '#ff7800';
    weight: 3;
    fillColor: '#ff7800';
    fillOpacity: 0.2;
}

/* Scale Control */
.leaflet-control-scale {
    margin-bottom: 20px !important;
    margin-left: 20px !important;
}

/* Toilet Markers */
.toilet-marker {
    font-size: 24px !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    text-align: center;
}

.accessible-toilet-icon {
    color: #4BC0C0;
}

.limited-toilet-icon {
    color: #FFCE56;
}

.nonaccessible-toilet-icon {
    color: #FF6384;
}

.proposed-toilet-icon {
    color: #00FF00;
    font-size: 24px !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    text-align: center;
}

/* Hide default Leaflet controls */
.leaflet-control-layers {
    display: none !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    #legend {
        max-width: 180px;
        font-size: 0.7rem;
        padding: 10px;
    }
    
    #story-map {
        max-width: 250px;
        bottom: 100px;
    }
    
    .story-content {
        font-size: 0.9rem;
    }
    
    .story-nav-btn {
        width: 22px;
        height: 22px;
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    #header h1 {
        font-size: 1.4rem;
    }
    
    #legend {
        max-width: 150px;
        bottom: 10px;
        left: 10px;
    }
    
    #story-map {
        max-width: 200px;
        right: 10px;
        bottom: 80px;
    }
    
    .chart-container {
        height: 150px;
    }
}