/* Phola Village Admin System Styles */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-weight: 400;
    overflow: hidden;
    background: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent text selection on mobile for better UX */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

#map-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#map {
    width: 100%;
    height: 100%;
}

/* Custom Marker Styles */
.mapboxgl-marker {
    cursor: pointer;
    /* Mapbox applies transforms to this element for positioning */
    /* Do not override transforms here - Mapbox needs them */
}

/* Marker container div - our custom element inside the marker */
/* Mapbox positions the .mapboxgl-marker, this div should not have transforms */
.mapboxgl-marker > div {
    /* No transforms on container - only inner dot should transform */
    transform: none !important;
    /* Ensure container doesn't interfere with Mapbox positioning */
    position: relative;
}

.mapboxgl-marker .custom-marker-icon {
    position: relative;
    display: block;
    will-change: transform;
    transform-origin: center bottom;
    /* Only the icon scales on hover, container stays fixed */
}

.mapboxgl-marker .custom-marker-dot {
    position: relative;
    display: block;
    will-change: transform;
    transform-origin: center center;
    /* Only the inner dot scales on hover, container stays fixed */
}

/* Hover Tooltip */
#hover-tooltip,
.marker-hover-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.85) 100%);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2000;
    transform: translate(-50%, -100%);
    margin-top: -12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    will-change: opacity, transform;
}

#hover-tooltip.visible,
.marker-hover-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(-4px);
}

#hover-tooltip::after,
.marker-hover-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

#hover-tooltip .tooltip-title,
.marker-hover-tooltip .tooltip-title {
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
    color: #fff;
    letter-spacing: 0.3px;
}

#hover-tooltip .tooltip-info,
.marker-hover-tooltip .tooltip-info {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
    line-height: 1.4;
}

/* Top Toolbar */
#toolbar {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 300px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

#toolbar h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 400;
    color: #333;
}

#search-box {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    background: #fafafa;
}

#search-box:focus {
    outline: none;
    border-color: #2ecc71;
    background: white;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

#filter-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 14px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 400;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-btn:hover {
    background: #f8f8f8;
    border-color: #ccc;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.filter-btn.active {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border-color: #2ecc71;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

#toolbar-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(46, 204, 113, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
}

/* Statistics Panel */
#stats-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

#stats-panel h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 400;
    color: #333;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
    border-radius: 6px;
    padding-left: 8px;
    padding-right: 8px;
    margin: 0 -8px;
}

.stat-item:hover {
    background: #f8f9fa;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 6px;
    min-width: 50px;
    text-align: center;
}

/* Info Panel */
#info-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-height: 450px;
    background: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 1000;
    overflow: hidden;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    animation: slideUp 0.3s ease;
}

#info-panel.minimized {
    max-height: 50px;
}

#info-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    background: #f8f9fa;
}

#info-panel .panel-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

#info-panel.minimized .panel-content {
    display: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#info-panel.active {
    display: block;
}

#info-panel::-webkit-scrollbar {
    width: 6px;
}

#info-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#info-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#info-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

#info-panel h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 400;
    color: #333;
}

#stand-details {
    font-size: 14px;
}

.detail-row {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: padding 0.2s ease;
}

.detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-row:hover {
    padding-left: 4px;
}

.detail-label {
    color: #666;
    font-size: 11px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.detail-value {
    color: #333;
    font-size: 15px;
    line-height: 1.5;
}

.owners-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.owners-list li {
    padding: 8px 0;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.owners-list li:last-child {
    border-bottom: none;
}

.owners-list li strong {
    display: block;
    margin-bottom: 4px;
    color: #2c3e50;
}

.owners-list li span {
    display: block;
    margin-top: 2px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-green {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-yellow {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-red {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#info-panel-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Form Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 400;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2ecc71;
    background: white;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.owner-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.owner-input-group input {
    flex: 1;
}

.remove-owner-btn {
    padding: 8px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.add-owner-btn {
    padding: 8px 12px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 15px;
}

/* Legend */
.legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: white;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.legend.minimized {
    max-height: 50px;
}

.legend .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    background: #f8f9fa;
}

.legend .panel-content {
    padding: 16px;
}

.legend.minimized .panel-content {
    display: none;
}

.legend h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
}

/* Panel Header Styles */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.panel-header h3,
.panel-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.minimize-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.minimize-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.panel-minimized .minimize-btn::before {
    content: '+';
}

.panel-minimized .minimize-btn {
    transform: rotate(180deg);
}

/* Map Controls Minimize */
#map-controls.minimized .panel-content {
    display: none !important;
}

#map-controls.minimized {
    padding: 8px 12px !important;
}

#map-controls.minimized .panel-header {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 6px 0;
    gap: 10px;
    transition: all 0.2s ease;
}

.legend-item.clickable {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    margin-left: -8px;
    margin-right: -8px;
}

.legend-item.clickable:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.legend-item.clickable.active {
    background: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.legend-item:hover .legend-color {
    transform: scale(1.2);
}

.legend-color.green { 
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}
.legend-color.yellow { 
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}
.legend-color.red { 
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.legend-label {
    font-size: 13px;
    color: #333;
    flex: 1;
}

.legend-count {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    padding: 3px 10px;
    border-radius: 12px;
    min-width: 28px;
    text-align: center;
}

.legend-item.active .legend-count {
    background: rgba(0, 0, 0, 0.1);
    font-weight: 700;
    color: #000;
}

/* Responsive */
/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Base adjustments */
    body {
        font-size: 14px;
    }
    
    /* Map container */
    #map-container {
        width: 100vw;
        height: 100vh;
        position: relative;
        overflow: hidden;
    }
    
    /* Ensure map is visible */
    #map {
        width: 100% !important;
        height: 100% !important;
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
    }
    
    /* Info Panel - Mobile */
    #info-panel {
        width: calc(100% - 20px) !important;
        max-width: none !important;
        max-height: 50vh !important;
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
        border-radius: 8px;
        z-index: 1000 !important;
        position: fixed !important;
    }
    
    #info-panel .panel-header {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    #info-panel .panel-content {
        padding: 12px;
        max-height: calc(50vh - 45px);
        font-size: 12px;
    }
    
    #info-panel h3 {
        font-size: 14px;
    }
    
    /* Map Controls - Mobile - Compact and positioned */
    #map-controls {
        width: auto !important;
        max-width: calc(100% - 20px) !important;
        min-width: 200px;
        bottom: auto !important;
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
        padding: 8px !important;
        border-radius: 8px;
        z-index: 1000 !important;
        position: fixed !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
    }
    
    /* Ensure map controls don't cover entire screen */
    #map-controls:not(.minimized) {
        max-width: 280px;
    }
    
    #map-controls.minimized {
        width: auto !important;
        padding: 6px 10px !important;
        min-width: 120px;
    }
    
    #map-controls .panel-header {
        padding: 6px 8px;
        margin-bottom: 6px;
        font-size: 12px;
    }
    
    #map-controls .panel-content {
        gap: 4px;
    }
    
    #map-controls .btn {
        font-size: 11px;
        padding: 8px 10px;
        min-height: 40px;
    }
    
    /* Legend - Mobile - Compact and positioned */
    .legend {
        width: auto !important;
        max-width: calc(100% - 20px) !important;
        min-width: 180px;
        bottom: auto !important;
        top: 10px !important;
        left: 10px !important;
        right: auto !important;
        border-radius: 8px;
        z-index: 1000 !important;
        position: fixed !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0,0,0,0.15) !important;
    }
    
    /* Ensure legend doesn't cover entire screen */
    .legend:not(.minimized) {
        max-width: 250px;
    }
    
    .legend.minimized {
        max-height: 40px !important;
    }
    
    .legend .panel-header {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .legend .panel-content {
        padding: 10px;
    }
    
    .legend h4 {
        font-size: 12px;
        margin: 0;
    }
    
    .legend-item {
        padding: 6px 4px;
        margin: 3px 0;
    }
    
    .legend-label {
        font-size: 11px;
    }
    
    .legend-count {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    /* Buttons - Mobile */
    .btn {
        font-size: 14px;
        padding: 12px 16px;
        min-height: 44px;
        touch-action: manipulation; /* Prevent double-tap zoom */
    }
    
    /* Detail rows - Mobile */
    .detail-row {
        padding: 12px 0;
        margin-bottom: 12px;
    }
    
    .detail-label {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .detail-value {
        font-size: 14px;
    }
    
    /* Owners list - Mobile */
    .owners-list li {
        padding: 10px 0;
        font-size: 13px;
    }
    
    .owners-list li strong {
        font-size: 14px;
    }
    
    .owners-list li span {
        font-size: 11px;
    }
    
    /* Minimize button - Mobile */
    .minimize-btn {
        width: 32px;
        height: 32px;
        font-size: 24px;
    }
    
    /* Modal - Mobile */
    .modal-content {
        width: 95%;
        max-width: none;
        padding: 20px 15px;
        margin: 10px;
        border-radius: 8px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    /* Hover tooltip - Mobile (less prominent) */
    #hover-tooltip {
        font-size: 11px;
        padding: 8px 10px;
        max-width: 250px;
    }
    
    /* Popup - Mobile */
    .mapboxgl-popup-content {
        font-size: 13px;
        padding: 12px;
    }
    
    .mapboxgl-popup-content h4 {
        font-size: 15px;
    }
    
    .mapboxgl-popup-content p {
        font-size: 12px;
        margin: 4px 0;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    /* Even smaller adjustments */
    #info-panel {
        max-height: 55vh !important;
        bottom: 5px !important;
        right: 5px !important;
        left: 5px !important;
        width: calc(100% - 10px) !important;
    }
    
    #map-controls {
        top: 5px !important;
        right: 5px !important;
        left: auto !important;
        width: auto !important;
        max-width: calc(100% - 10px) !important;
        min-width: 160px;
        padding: 6px !important;
    }
    
    .legend {
        top: 5px !important;
        left: 5px !important;
        right: auto !important;
        width: auto !important;
        max-width: calc(100% - 10px) !important;
        min-width: 150px;
    }
    
    .btn {
        font-size: 11px;
        padding: 8px 10px;
    }
    
    #info-panel .panel-content {
        padding: 10px;
        font-size: 11px;
    }
    
    .detail-value {
        font-size: 12px;
    }
    
    .legend-item {
        padding: 5px 3px;
    }
    
    .legend-label {
        font-size: 10px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #info-panel {
        max-height: 85vh !important;
        width: 40% !important;
        right: 10px !important;
        left: auto !important;
        bottom: 10px !important;
        position: fixed !important;
    }
    
    #map-controls {
        top: 10px !important;
        right: calc(40% + 20px) !important;
        left: auto !important;
        width: 180px !important;
        position: fixed !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }
    
    .legend {
        top: 10px !important;
        left: 10px !important;
        right: auto !important;
        width: 180px !important;
        position: fixed !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 48px;
        padding: 14px 18px;
    }
    
    .legend-item.clickable {
        padding: 12px 8px;
        min-height: 44px;
    }
    
    .minimize-btn {
        width: 36px;
        height: 36px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover::before {
        display: none;
    }
    
    .legend-item:hover {
        transform: none;
    }
    
    /* Make markers easier to tap */
    .mapboxgl-marker {
        cursor: pointer;
        touch-action: manipulation;
    }
    
    .mapboxgl-marker .custom-marker-dot {
        width: 24px;
        height: 24px;
    }
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state p {
    margin: 10px 0;
}

