/* === HARİTA SAYFASI CSS === */

/* Harita Container */
#map {
    width: 100%;
    height: 100vh;
    z-index: 1;
}

/* Harita Kontrolleri */
.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-control-btn {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    color: #333;
}

.map-control-btn:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.map-control-btn.active {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Yenile butonu özel stili */
#refreshBtn {
    background: linear-gradient(135deg, #FF9800, #F57C00) !important;
    color: white !important;
    border-color: #FF9800 !important;
}

#refreshBtn:hover {
    background: linear-gradient(135deg, #F57C00, #E65100) !important;
    transform: translateY(-1px) rotate(180deg) !important;
    transition: all 0.3s ease !important;
}

#refreshBtn i.fa-spin {
    animation: spin 1s linear infinite !important;
}

/* Kullanıcı Bilgi Paneli */
.user-info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 280px;
    border: 1px solid #e0e0e0;
    backdrop-filter: blur(5px);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4CAF50;
}

.panel-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.close-panel-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.close-panel-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.user-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.user-info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.user-info-icon {
    width: 18px;
    margin-right: 8px;
    color: #4CAF50;
}

.user-info-text {
    flex: 1;
    font-size: 13px;
    color: #666;
}

.user-info-value {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}



/* Harita Popup Stilleri */
.leaflet-popup-content {
    margin: 0;
    padding: 0;
    min-width: 280px;
}

.user-popup {
    padding: 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    backdrop-filter: blur(5px);
}

.user-popup-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4CAF50;
}

.user-popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-popup-header h3 i {
    color: #4CAF50;
}

.user-popup-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.user-popup-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.user-popup-icon {
    width: 18px;
    margin-right: 8px;
    color: #4CAF50;
}

.user-popup-text {
    flex: 1;
    font-size: 13px;
    color: #666;
}

.user-popup-value {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.user-popup-actions {
    display: flex;
    gap: 5px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.user-popup-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.user-popup-btn.primary {
    background: #4CAF50;
    color: white;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.user-popup-btn.secondary {
    background: #2196F3;
    color: white;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.user-popup-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-popup-btn.primary:hover {
    background: #45a049;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.user-popup-btn.secondary:hover {
    background: #1976D2;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}



/* Buton Stilleri */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3);
}

.btn:hover {
    background: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* Sohbet Butonu */
.chat-btn {
    background: #FF6B6B !important;
    color: white !important;
    border-color: #FF6B6B !important;
    text-decoration: none;
}

.chat-btn:hover {
    background: #FF5252 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    color: white !important;
    text-decoration: none;
}

/* Loading Overlay */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.map-loading-content {
    text-align: center;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

/* Harita Marker Animasyonları */
.leaflet-marker-icon {
    transition: all 0.2s ease;
}

.leaflet-marker-icon:hover {
    transform: scale(1.1);
}

.user-marker {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .user-info-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 12px;
    }
    
    .map-controls {
        top: 10px;
        right: 10px;
    }
    
    .map-control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .chat-link {
        bottom: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* User Marker Stilleri */
.user-marker {
    background: transparent !important;
    border: none !important;
    z-index: 9999 !important;
}

.user-marker div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: linear-gradient(45deg, #4CAF50, #45a049) !important;
    border-radius: 50% !important;
    color: white !important;
    font-weight: bold !important;
    font-size: 14px !important;
    border: 3px solid white !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
    cursor: pointer !important;
    z-index: 9999 !important;
    position: relative !important;
}

/* Araç Marka Marker Stilleri */
.car-brand-marker {
    transition: all 0.3s ease !important;
}

.car-brand-marker:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4) !important;
}

.car-brand-marker img {
    transition: all 0.3s ease !important;
}

.car-brand-marker:hover img {
    transform: scale(1.05) !important;
}

.fallback-text {
    font-family: 'Arial', sans-serif !important;
    font-weight: 700 !important;
    color: #333 !important;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8) !important;
}

/* Leaflet marker z-index override */
.leaflet-marker-icon {
    z-index: 9999 !important;
}

.leaflet-marker {
    z-index: 9999 !important;
}

/* Kullanıcı Listesi Paneli */
.user-list-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 0;
    min-width: 350px;
    max-width: 500px;
    max-height: 80vh;
    font-family: inherit;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: modalPop 0.3s cubic-bezier(.4,2,.6,1) 1;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.user-list-panel:hover {
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
    transform: translate(-50%, -50%) scale(1.02);
}

.user-list-header {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 20px 24px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-list-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-list-header h3 i {
    font-size: 18px;
}

.user-list-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.user-list-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.user-list-content {
    padding: 24px;
}

.user-count {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.user-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.user-list::-webkit-scrollbar {
    width: 6px;
}

.user-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.user-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.user-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.user-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #4CAF50;
}

.user-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border-radius: 0 2px 2px 0;
}

.user-item.self::before {
    background: linear-gradient(45deg, #2196F3, #1976D2);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 16px;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.status-dot.status-green {
    background: #4CAF50;
}

.status-dot.status-red {
    background: #f44336;
}

.status-dot.status-blue {
    background: #2196F3;
}

.status-dot.status-gray {
    background: #9E9E9E;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
}

.user-details span {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    white-space: nowrap;
}

.last-update-time {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
    border-color: #c8e6c9 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}

.user-distance {
    background: #e3f2fd !important;
    color: #1976d2 !important;
    border-color: #bbdefb !important;
    font-weight: 600;
}

/* Modal animasyonu */
@keyframes modalPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Mobil uyumluluk */
@media (max-width: 768px) {
    .user-list-panel {
        min-width: 90vw;
        max-width: 95vw;
        max-height: 90vh;
        margin: 20px;
    }
    
    .user-list-header {
        padding: 16px 20px;
    }
    
    .user-list-header h3 {
        font-size: 18px;
    }
    
    .user-list-content {
        padding: 20px;
    }
    
    .user-item {
        padding: 14px;
    }
    
    .user-details {
        gap: 8px;
    }
}
