/* ============================================
   New Map Styles - Clean and Simple
   ============================================ */

/* Map Container */
.map-container {
    position: relative;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* Map Loading Bar */
.map-loading-bar {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: min(480px, 90%);
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1100;
    color: #fff;
}

.map-loading-bar-track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.map-loading-bar-fill {
    width: 40%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-red-light), var(--color-brown-light));
    animation: mapLoadingIndeterminate 1.3s infinite;
}

.map-loading-text {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

@keyframes mapLoadingIndeterminate {
    0% {
        transform: translateX(-120%);
    }
    50% {
        transform: translateX(20%);
    }
    100% {
        transform: translateX(120%);
    }
}

/* Scroll Indicator Button */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-red);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-height: 48px;
}

.scroll-indicator:hover {
    background: var(--color-red-dark);
    transform: translateX(-50%) translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.5);
}

.scroll-indicator:focus {
    outline: 3px solid var(--color-white);
    outline-offset: 3px;
}

.scroll-indicator-icon {
    height: 42px; /* 50% larger than original 28px */
    width: auto;
    display: block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-3px);
    }
}

.scroll-indicator span {
    font-weight: 600;
}

/* Custom cursor for map section using color logo (with pointer fallback) */
.map-section,
.map-section * {
    cursor: url("../images/logos/SVG_PRU color.svg") 16 16, pointer;
}

/* Map Controls - Fixed to viewport when map is visible */
.map-controls {
    position: fixed;
    top: 140px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@media (max-width: 600px) {
    .map-controls {
        top: 160px;
    }
}

.map-controls .map-control-btn {
    pointer-events: auto;
}

.map-control-btn {
    background: var(--color-red);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-control-btn:hover {
    background: var(--color-red-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.map-control-btn:focus {
    outline: 3px solid var(--color-white);
    outline-offset: 2px;
}

.map-control-btn.reset {
    background: var(--color-brown);
}

.map-control-btn.reset:hover {
    background: #6b4423;
}

.map-control-btn.clear {
    background: var(--color-gray-dark);
}

.map-control-btn.clear:hover {
    background: #222;
}

.map-control-btn .btn-label {
    font-size: 0.85rem;
}

/* Data Source Toggle */
.data-source-toggle {
    pointer-events: auto;
    background: white;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gray-dark);
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--color-red);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-text {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.toggle-text-active,
.toggle-text-inactive {
    transition: opacity 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked ~ .toggle-text .toggle-text-active {
    opacity: 0;
    display: none;
}

.toggle-label input[type="checkbox"]:checked ~ .toggle-text .toggle-text-inactive {
    opacity: 1;
    display: inline;
}

.toggle-label input[type="checkbox"]:not(:checked) ~ .toggle-text .toggle-text-active {
    opacity: 1;
    display: inline;
}

.toggle-label input[type="checkbox"]:not(:checked) ~ .toggle-text .toggle-text-inactive {
    opacity: 0;
    display: none;
}

/* Data Source Info Button */
.data-source-info-btn {
    background: transparent;
    border: none;
    color: var(--color-gray-dark);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.data-source-info-btn:hover {
    background: var(--color-gray-light);
    color: var(--color-red);
}

.data-source-info-btn:focus {
    outline: 2px solid var(--color-red);
    outline-offset: 2px;
}

/* Data Source Info Modal */
.data-source-info-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.data-source-info-modal[aria-hidden="false"] {
    display: flex;
}

.data-source-info-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.data-source-info-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--color-gray-dark);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.data-source-info-close:hover {
    background: var(--color-gray-light);
    color: var(--color-red);
}

.data-source-info-content h3 {
    margin: 0 0 20px 0;
    color: var(--color-red);
    font-size: 1.5rem;
}

.data-source-info-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-gray-light);
}

.data-source-info-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.data-source-info-section h4 {
    margin: 0 0 12px 0;
    color: var(--color-gray-dark);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-source-info-section h4 i {
    color: var(--color-red);
}

.data-source-info-section p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: var(--color-gray-dark);
}

.data-source-info-note {
    background: var(--color-gray-light);
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--color-gray-dark);
    margin-top: 12px;
}

.data-source-info-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid var(--color-red);
}

.data-source-info-footer p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-gray-dark);
}

@media (max-width: 768px) {
    .map-control-btn .btn-label {
        display: none;
    }
    .map-control-btn {
        padding: 10px;
        min-width: 48px;
    }
    
    .data-source-toggle {
        min-width: 120px;
        padding: 6px 10px;
    }
    
    .toggle-text {
        font-size: 0.75rem;
    }
    
    .data-source-info-content {
        padding: 20px;
        max-height: 85vh;
    }
    
    .data-source-info-content h3 {
        font-size: 1.3rem;
        padding-right: 40px;
    }
    
    .data-source-info-section h4 {
        font-size: 1rem;
    }
}

/* Legend */
.info.legend {
    background: white;
    background: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    font-size: 13px;
}

.info.legend h4 {
    margin: 0 0 8px 0;
    color: #777;
    font-size: 14px;
}

.legend-item {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-item i {
    width: 18px;
    height: 18px;
    display: inline-block;
    opacity: 0.7;
    border-radius: 2px;
}

/* Palm Tree Markers */
.palmtree-marker {
    background: transparent !important;
    border: none !important;
}

/* Marker Clustering */
.marker-cluster-container {
    background: transparent !important;
    border: none !important;
}

.marker-cluster {
    background: var(--color-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.marker-cluster-small {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.marker-cluster-medium {
    width: 40px;
    height: 40px;
    font-size: 14px;
    background: var(--color-brown);
}

.marker-cluster-large {
    width: 50px;
    height: 50px;
    font-size: 16px;
    background: var(--color-red-dark);
}

/* Imported Metrics Section */
.metrics-section {
    margin-bottom: 2rem;
}

.metrics-section-title {
    font-size: 1.2rem;
    color: var(--color-gray-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metrics-section-title i {
    color: var(--color-red);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.metric-card {
    background: white;
    border: 1px solid var(--color-gray-light);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.metric-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.metric-name {
    font-size: 0.9rem;
    color: var(--color-gray-dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.metric-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-red);
}

.no-data-message {
    color: var(--color-gray-dark);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .map-controls {
        top: 80px;
        right: 8px;
    }
    
    .scroll-indicator {
        bottom: 10px;
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .scroll-indicator span {
        display: none;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .metric-card {
        padding: 0.75rem;
    }
    
    .metric-count {
        font-size: 1.25rem;
    }
}

