/* 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: calc(100vh - 55px);
}

/* 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,
.map-container:-webkit-full-screen,
.map-container:-moz-full-screen,
.map-container:-ms-fullscreen {
    display: flex;
    flex-direction: column;
    width: 100vw !important;
    height: 100vh !important;
}

.map-container:fullscreen #map,
.map-container:-webkit-full-screen #map,
.map-container:-moz-full-screen #map,
.map-container:-ms-fullscreen #map {
    height: calc(100vh - 55px) !important;
    flex: 1;
}

.container.fullscreen-mode #map {
    height: calc(100vh - 55px);
}

.container.fullscreen-mode .map-container {
    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;
}

/* Header Center - Logo ve Yön Filtresi */
.map-header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* Tablet - Header Center */
@media (max-width: 1024px) {
    .map-header-center {
        gap: 6px;
    }
}

/* Küçük Tablet - Header Center */
@media (max-width: 768px) {
    .map-header-center {
        gap: 4px;
    }
}

/* Mobil - Header Center */
@media (max-width: 480px) {
    .map-header-center {
        gap: 2px;
        flex-shrink: 1;
    }
}

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

/* Tablet - Responsive Header */
@media (max-width: 1024px) {
    .map-header {
        padding: 5px 10px;
        gap: 8px;
    }
}

/* Küçük Tablet - Responsive Header */
@media (max-width: 768px) {
    .map-header {
        padding: 4px 8px;
        gap: 6px;
    }
}

/* Mobil - Responsive Header */
@media (max-width: 480px) {
    .map-header {
        padding: 3px 6px;
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.map-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

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

/* Tablet - Header Başlık */
@media (max-width: 1024px) {
    .map-header-title {
        font-size: 11px;
        gap: 4px;
        min-width: 100px;
    }
    
    .map-header-title div:last-child {
        font-size: 10px;
    }
}

/* Küçük Tablet - Header Başlık */
@media (max-width: 768px) {
    .map-header-title {
        font-size: 10px;
        gap: 3px;
        min-width: 90px;
    }
    
    .map-header-title div:last-child {
        font-size: 9px;
        display: none;
    }
}

/* Mobil - Header Başlık */
@media (max-width: 480px) {
    .map-header-title {
        font-size: 9px;
        gap: 2px;
        min-width: 70px;
    }
    
    .map-header-title div:last-child {
        display: none;
    }
}

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

/* Tablet - Map Controls */
@media (max-width: 1024px) {
    .map-controls {
        gap: 4px;
    }
}

/* Küçük Tablet - Map Controls */
@media (max-width: 768px) {
    .map-controls {
        gap: 3px;
    }
}

/* Mobil - Map Controls */
@media (max-width: 480px) {
    .map-controls {
        gap: 2px;
    }
}

/* Yenileme süresi dropdown */
.refresh-select {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    height: 36px;
    min-width: 65px;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

/* Tablet - Refresh Select */
@media (max-width: 1024px) {
    .refresh-select {
        padding: 6px 10px;
        font-size: 11px;
        height: 32px;
        min-width: 60px;
        padding-right: 20px;
    }
}

/* Küçük Tablet - Refresh Select */
@media (max-width: 768px) {
    .refresh-select {
        padding: 5px 8px;
        font-size: 10px;
        height: 30px;
        min-width: 55px;
        padding-right: 18px;
    }
}

/* Mobil - Refresh Select */
@media (max-width: 480px) {
    .refresh-select {
        padding: 4px 6px;
        font-size: 9px;
        height: 28px;
        min-width: 50px;
        padding-right: 16px;
        border-radius: 4px;
    }
}

.refresh-select:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.refresh-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.refresh-select option {
    background: white;
    color: #333;
    font-weight: 500;
}

.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;
}

/* Tablet - Icon Buttons */
@media (max-width: 1024px) {
    .icon-btn {
        padding: 6px 8px;
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

/* Küçük Tablet - Icon Buttons */
@media (max-width: 768px) {
    .icon-btn {
        padding: 5px 7px;
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Mobil - Icon Buttons */
@media (max-width: 480px) {
    .icon-btn {
        padding: 4px 6px;
        min-width: 28px;
        height: 28px;
        font-size: 11px;
        border-radius: 4px;
    }
}

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

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

/* Header Logo - Responsive */
.header-logo {
    height: 36px;
    width: auto;
    transition: height 0.3s ease;
    border-radius: 6px;
}

/* Tablet - Header Logo */
@media (max-width: 1024px) {
    .header-logo {
        height: 32px;
    }
}

/* Küçük Tablet - Header Logo */
@media (max-width: 768px) {
    .header-logo {
        height: 28px;
    }
}

/* Mobil - Header Logo */
@media (max-width: 480px) {
    .header-logo {
        height: 24px;
    }
}

/* Yön Filtre Butonları - Responsive */
.direction-filter-btns {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dir-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Tablet - Yön Filtre Butonları */
@media (max-width: 1024px) {
    .direction-filter-btns {
        gap: 3px;
        padding: 3px;
    }
    
    .dir-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* Küçük Tablet - Yön Filtre Butonları */
@media (max-width: 768px) {
    .direction-filter-btns {
        gap: 2px;
        padding: 2px;
    }
    
    .dir-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Mobil - Yön Filtre Butonları */
@media (max-width: 480px) {
    .direction-filter-btns {
        gap: 2px;
        padding: 2px;
        border-radius: 6px;
    }
    
    .dir-btn {
        padding: 3px 6px;
        font-size: 9px;
        border-radius: 4px;
    }
}

.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;
}

/* Tablet - Dropdown Menu */
@media (max-width: 1024px) {
    .dropdown-menu {
        min-width: 200px;
        border-radius: 6px;
    }
}

/* Küçük Tablet - Dropdown Menu */
@media (max-width: 768px) {
    .dropdown-menu {
        min-width: 180px;
        border-radius: 6px;
    }
}

/* Mobil - Dropdown Menu */
@media (max-width: 480px) {
    .dropdown-menu {
        min-width: 160px;
        border-radius: 4px;
        margin-top: 3px;
    }
}

.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;
}

/* Tablet - Dropdown Item */
@media (max-width: 1024px) {
    .dropdown-item {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Küçük Tablet - Dropdown Item */
@media (max-width: 768px) {
    .dropdown-item {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* Mobil - Dropdown Item */
@media (max-width: 480px) {
    .dropdown-item {
        padding: 6px 8px;
        font-size: 10px;
    }
}

.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;
}

/* Tablet - Basemap Buttons */
@media (max-width: 1024px) {
    .basemap-selector {
        padding: 10px;
        gap: 5px;
    }
    
    .basemap-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Küçük Tablet - Basemap Buttons */
@media (max-width: 768px) {
    .basemap-selector {
        padding: 8px;
        gap: 4px;
    }
    
    .basemap-btn {
        padding: 3px 6px;
        font-size: 9px;
        border-radius: 3px;
    }
}

/* Mobil - Basemap Buttons */
@media (max-width: 480px) {
    .basemap-selector {
        padding: 6px;
        gap: 3px;
    }
    
    .basemap-btn {
        padding: 2px 4px;
        font-size: 8px;
        border-radius: 2px;
    }
}

/* Dropdown Content */
.dropdown-content {
    padding: 10px 15px;
}

.dropdown-header {
    font-size: 11px;
    color: #999;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.basemap-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Tablet - Dropdown Content */
@media (max-width: 1024px) {
    .dropdown-content {
        padding: 8px 12px;
    }
    
    .dropdown-header {
        font-size: 10px;
        margin-bottom: 8px;
    }
    
    .basemap-buttons {
        gap: 4px;
    }
}

/* Küçük Tablet - Dropdown Content */
@media (max-width: 768px) {
    .dropdown-content {
        padding: 6px 10px;
    }
    
    .dropdown-header {
        font-size: 9px;
        margin-bottom: 6px;
    }
    
    .basemap-buttons {
        gap: 3px;
    }
}

/* Mobil - Dropdown Content */
@media (max-width: 480px) {
    .dropdown-content {
        padding: 4px 8px;
    }
    
    .dropdown-header {
        font-size: 8px;
        margin-bottom: 4px;
    }
    
    .basemap-buttons {
        gap: 2px;
    }
}

.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; }
}

/* 🚌 Araç Geçiş Animasyonları */
@keyframes vehicleSlide {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes vehiclePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

@keyframes vehicleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(40, 167, 69, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(40, 167, 69, 0.8));
    }
}

@keyframes parkedGlow {
    0%, 100% {
        filter: drop-shadow(0 0 2px rgba(158, 158, 158, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 6px rgba(158, 158, 158, 0.6));
    }
}

@keyframes speedAlertGlow {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(255, 193, 7, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.8));
    }
}

/* Marker Sınıfları için Animasyonlar */
.vehicle-marker-new {
    animation: vehicleSlide 0.6s ease-out forwards;
}

.vehicle-marker-speed-alert {
    animation: vehiclePulse 1.5s infinite, speedAlertGlow 1.5s infinite;
}

.vehicle-marker-normal {
    animation: vehicleGlow 2s infinite;
}

.vehicle-marker-parked {
    animation: parkedGlow 2.5s infinite;
}

/* Leaflet Marker İçin Wrapper */
.leaflet-marker-icon.vehicle-animated {
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 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;
    }
}
