/**
 * Mobile Stylesheet
 * Responsive styles for mobile devices
 */

/* Mobile Navigation Tabs */
.mobile-nav-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.mobile-nav-tabs .nav-tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    color: rgba(255,255,255,0.7);
    background: none;
    border: none;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mobile-nav-tabs .nav-tab.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.mobile-nav-tabs .nav-tab i {
    font-size: 16px;
    margin-bottom: 2px;
}

/* Mobile Overlay Panels */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 60px;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px 15px 0 0;
    max-height: 70%;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-panel.show {
    transform: translateY(0);
}

.mobile-panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.mobile-panel-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.mobile-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
}

.mobile-panel-content {
    padding: 20px;
}

/* Enhanced Mobile Controls */
.mobile-control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.mobile-control-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.mobile-control-card h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 14px;
}

.mobile-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.mobile-quick-btn {
    padding: 12px 8px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-height: 60px;
    justify-content: center;
}

/* Mobile-optimized location items */
.mobile-location-item {
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.mobile-location-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.mobile-location-name {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-location-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.mobile-location-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12px;
    color: #7f8c8d;
}

.mobile-location-detail {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding-bottom: 60px;
    }
    
    .main-header h1 {
        font-size: 18px;
        gap: 8px;
    }
    
    .main-header .header-icon {
        padding: 8px;
        font-size: 16px;
    }
    
    .dashboard-container {
        flex-direction: column;
        height: calc(100vh - 130px);
        position: relative;
    }
    
    .left-sidebar, .right-sidebar {
        display: none;
    }
    
    .map-container {
        height: 100%;
        width: 100%;
    }
    
    .mobile-nav-tabs {
        display: flex;
    }
    
    /* Touch-friendly map controls */
    .leaflet-control-container {
        margin-right: 10px !important;
        margin-top: 10px !important;
    }
    
    .leaflet-control-zoom {
        border: none !important;
        border-radius: 8px !important;
        overflow: hidden;
    }
    
    .leaflet-control-zoom a {
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 18px !important;
        background: rgba(255,255,255,0.9) !important;
        border: 1px solid rgba(0,0,0,0.1) !important;
    }
    
    .leaflet-control-layers {
        border-radius: 8px !important;
        background: rgba(255,255,255,0.9) !important;
    }
    
    /* Mobile popup adjustments */
    .leaflet-popup-content {
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin: 12px 8px !important;
        min-width: 200px;
    }
    
    .popup-header {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }
    
    .popup-detail {
        margin: 8px 0 !important;
        font-size: 13px !important;
    }
    
    /* Enhanced touch targets */
    button {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    select, input {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .search-box {
        font-size: 16px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 12px 20px;
    }
    
    .main-header h1 {
        font-size: 16px;
    }
    
    .mobile-nav-tabs .nav-tab {
        padding: 10px 4px;
        font-size: 10px;
    }
    
    .mobile-nav-tabs .nav-tab i {
        font-size: 14px;
    }
    
    .mobile-control-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-quick-actions {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .mobile-quick-btn {
        padding: 10px 6px;
        min-height: 55px;
        font-size: 10px;
    }
}