/* Harita Konteyner */
.map-container {
    background: #f8f9fa;
    border-left: 1px solid #e0e0e0;
    position: relative;
    pointer-events: auto;
}

/* Leaflet zoom kontrollerinin z-index'ini düşür */
.leaflet-control-zoom {
    z-index: 500 !important;
}

.leaflet-control-container {
    z-index: 500 !important;
}

.leaflet-top, .leaflet-bottom {
    z-index: 500 !important;
}

/* Tam ekran modunda leaflet kontrollerini daha da düşür */
.map-container:fullscreen .leaflet-control-zoom,
.map-container:-webkit-full-screen .leaflet-control-zoom,
.map-container:-moz-full-screen .leaflet-control-zoom,
:fullscreen .leaflet-control-zoom,
:-webkit-full-screen .leaflet-control-zoom,
:-moz-full-screen .leaflet-control-zoom {
    z-index: 100 !important;
}

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

/* Leaflet container'ın hamburger butonunu engellemesini önle */
.leaflet-container {
    pointer-events: auto;
}

/* Tam ekran modunda leaflet'in pointer-events'ini düzenle */
.map-container:fullscreen .leaflet-container,
.map-container:-webkit-full-screen .leaflet-container,
.map-container:-moz-full-screen .leaflet-container {
    pointer-events: auto;
}

/* Leaflet pane ve tile'ların pointer-events'i */
.leaflet-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-shadow-pane,
.leaflet-marker-pane,
.leaflet-tooltip-pane,
.leaflet-popup-pane {
    pointer-events: auto;
}

/* Fullscreen stilleri - map-container için */
.map-container:fullscreen {
    display: flex;
    flex-direction: column;
}

.map-container:-webkit-full-screen {
    display: flex;
    flex-direction: column;
}

.map-container:-moz-full-screen {
    display: flex;
    flex-direction: column;
}

.map-container:-ms-fullscreen {
    display: flex;
    flex-direction: column;
}

.map-container:fullscreen #map {
    height: calc(100vh - 90px) !important;
    flex: 1;
}

.map-container:-webkit-full-screen #map {
    height: calc(100vh - 90px) !important;
    flex: 1;
}

.map-container:-moz-full-screen #map {
    height: calc(100vh - 90px) !important;
    flex: 1;
}

.map-container:-ms-fullscreen #map {
    height: calc(100vh - 90px) !important;
    flex: 1;
}

.container.fullscreen-mode #map {
    height: 100vh;
}

/* Fullscreen butonu gizle - kendi butonumuzu kullanacağız */
.leaflet-control-fullscreen {
    display: none !important;
}

/* Fullscreen modunda paneller butonunu gizle */
.leaflet-fullscreen-on #panelsBtn {
    display: none !important;
}

.map-header {
    background: white;
    padding: 12px 15px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.map-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    font-weight: 600;
    font-size: 14px;
}

.map-header-title div:last-child {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.4;
    font-weight: 400;
}

.map-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.icon-btn {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #e0e0e0;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.icon-btn:hover {
    background: #e0e0e0;
    transform: scale(1.08);
}

.icon-btn:active {
    transform: scale(0.95);
}

.toggle-btn {
    position: relative;
}

.toggle-btn.active {
    background: #28a745;
    color: white;
    border-color: #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.toggle-btn.active:hover {
    background: #20c997;
    border-color: #20c997;
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.7);
}

.toggle-btn.active::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    bottom: -2px;
    right: -2px;
}

.map-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.map-btn:hover {
    background: #5568d3;
}

/* Açılır Menü */
.menu-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    min-width: 220px;
    margin-top: 5px;
    margin-right: 0;
    margin-left: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    pointer-events: none;
    max-height: 80vh;
    overflow-y: auto;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: #333;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item.active {
    background: #e8eaf6;
    color: #667eea;
    font-weight: 600;
}

.dropdown-separator {
    height: 1px;
    background: #e0e0e0;
    margin: 5px 0;
}

/* Harita Katmanı Seçicisi */
.basemap-selector {
    background: white;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.basemap-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
}

.basemap-btn:hover {
    border-color: #667eea;
    background: #e8eaf6;
}

.basemap-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Harita Açılır */
.leaflet-popup-content {
    font-family: 'Segoe UI', sans-serif;
    min-width: 200px;
}

.popup-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.popup-info {
    font-size: 12px;
    line-height: 1.8;
    color: #666;
}

.popup-info strong {
    color: #333;
}

/* Harita Efsanesi */
.map-legend {
    background: white;
    padding: 8px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Durum Göstergesi */
.vehicle-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mobil Uyumlu Stiller */
@media (max-width: 768px) {
    .map-header {
        padding: 12px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* Mobil menü butonu */
    .mobile-menu-btn {
        background: #667eea !important;
        color: white !important;
        border: none !important;
        font-weight: 700 !important;
        font-size: 20px !important;
        box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3) !important;
    }
    
    .mobile-menu-btn:active {
        transform: scale(0.95);
        background: #5568d3 !important;
    }

    .map-header-title {
        min-width: auto;
        font-size: 13px;
        order: 2;
    }

    .map-header-title div:last-child {
        font-size: 12px;
    }

    .map-controls {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
        order: 3;
    }

    .icon-btn {
        min-width: 44px;
        height: 44px;
        padding: 10px;
        font-size: 16px;
        border-radius: 8px;
    }

    .map-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
        border-radius: 8px;
    }

    #map {
        height: calc(100vh - 140px);
    }

    .map-legend {
        flex-wrap: wrap;
        gap: 12px;
        padding: 10px 12px;
        font-size: 11px;
    }

    .legend-item {
        gap: 6px;
    }

    .menu-dropdown {
        position: relative;
    }

    .dropdown-menu {
        min-width: 200px;
        right: 0;
        left: auto;
        max-width: calc(100vw - 40px);
    }

    .dropdown-item {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 48px;
    }

    .basemap-btn {
        padding: 10px 14px;
        font-size: 12px;
        min-height: 40px;
        border-radius: 6px;
    }
    
    .leaflet-popup-content-wrapper {
        border-radius: 12px;
    }
    
    .leaflet-popup-content {
        margin: 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .map-header {
        padding: 10px;
        gap: 8px;
    }

    .map-header-title {
        font-size: 12px;
    }

    .map-header-title div:last-child {
        font-size: 11px;
    }

    .map-controls {
        gap: 6px;
    }

    .icon-btn {
        min-width: 44px;
        height: 44px;
        padding: 10px;
        font-size: 15px;
        border-radius: 8px;
    }

    .map-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 44px;
    }

    #map {
        height: calc(100vh - 140px);
    }

    .map-legend {
        padding: 8px 10px;
        font-size: 10px;
        gap: 10px;
    }

    .popup-title {
        font-size: 14px;
    }

    .popup-info {
        font-size: 13px;
    }

    .dropdown-menu {
        min-width: 180px;
        right: 0;
        left: auto;
        max-width: calc(100vw - 30px);
    }

    .dropdown-item {
        padding: 14px 12px;
        font-size: 13px;
        min-height: 48px;
    }

    .basemap-btn {
        padding: 10px 12px;
        font-size: 11px;
        min-height: 40px;
    }
    
    .toggle-btn {
        font-size: 10px;
        font-weight: 700;
        min-width: 44px;
    }
}
