/**
 * OpenRoute Services Harita Bileşeni Stilleri
 * Mobil-first responsive tasarım
 */

/* Temel harita container */
.openroute-maps-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Harita container */
.map-container {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Kontrol paneli */
.route-controls {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.route-controls h3 {
    margin: 0 0 1.5rem 0;
    color: #2E2E2E;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    justify-content: center;
}

/* Form grupları */
.form-group {
    position: relative;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.form-group input:focus {
    outline: none;
    border-color: #4CAF50;
    background: white;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

/* Adres önerileri */
.address-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
    color: #333;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Butonlar */
.route-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
    min-height: 48px; /* Mobil dokunma alanı */
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: #4CAF50;
    border: 2px solid #4CAF50;
}

.btn-secondary:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-2px);
}

.btn-clear {
    background: #f44336;
    color: white;
}

.btn-clear:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* Sonuçlar paneli */
.route-results {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.route-results-content {
    width: 100%;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-header h3 {
    margin: 0;
    color: #2E2E2E;
    font-size: 1.25rem;
    font-weight: 600;
}

.source-badge {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* İstatistikler */
.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.stat-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2E2E2E;
}

/* Aksiyon butonları */
.result-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-actions .btn {
    flex: 1;
    padding: 16px 24px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    text-transform: none !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
}

.result-actions .btn-primary {
    background: linear-gradient(135deg, #2E7D32, #4CAF50) !important;
    color: white !important;
    border: none !important;
}

.result-actions .btn-primary:hover {
    background: linear-gradient(135deg, #1B5E20, #388E3C) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.4) !important;
}

.result-actions .btn-secondary {
    background: linear-gradient(135deg, #1976D2, #2196F3) !important;
    color: white !important;
    border: none !important;
}

.result-actions .btn-secondary:hover {
    background: linear-gradient(135deg, #0D47A1, #1565C0) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(25, 118, 210, 0.4) !important;
}

.result-actions .btn:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.result-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.result-actions .btn:hover::before {
    left: 100%;
}

.result-note {
    background: #fff3cd;
    color: #856404;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border-left: 4px solid #ffc107;
}

/* Loading durumu */
.route-loading {
    display: none;
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hata mesajları */
.route-error {
    display: none;
    margin-bottom: 1rem;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #f44336;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.error-text {
    flex: 1;
    font-size: 0.9rem;
}

.error-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #c62828;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Leaflet harita özelleştirmeleri */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-size: 0.9rem;
}

.leaflet-control-zoom {
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.leaflet-control-zoom a {
    background: white;
    color: #333;
    border-radius: 4px;
    font-weight: bold;
}

.leaflet-control-zoom a:hover {
    background: #f5f5f5;
}

/* Tablet responsive */
@media (min-width: 768px) {
    .openroute-maps-wrapper {
        padding: 2rem;
        display: grid;
        grid-template-columns: 350px 1fr;
        gap: 2rem;
        align-items: start;
    }
    
    .route-controls {
        margin-bottom: 0;
    }
    
    .map-container {
        height: 500px;
        margin-bottom: 0;
    }
    
    .route-results {
        grid-column: 1 / -1;
        margin-top: 1rem;
    }
    
    .route-actions {
        flex-direction: row;
    }
    
    .result-actions {
        flex-direction: row;
    }
}

/* Desktop responsive */
@media (min-width: 1024px) {
    .openroute-maps-wrapper {
        padding: 3rem;
        grid-template-columns: 400px 1fr;
        gap: 3rem;
    }
    
    .map-container {
        height: 600px;
    }
    
    .route-controls {
        position: sticky;
        top: 2rem;
    }
    
    .result-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobil optimizasyonlar */
@media (max-width: 767px) {
    .openroute-maps-wrapper {
        padding: 1rem 0.5rem;
    }
    
    .route-controls,
    .route-results {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
        padding: 1rem;
    }
    
    .map-container {
        height: 300px;
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .route-actions,
    .result-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
}

/* Küçük mobil cihazlar */
@media (max-width: 480px) {
    .openroute-maps-wrapper {
        padding: 0.5rem 0.25rem;
    }
    
    .route-controls,
    .route-results {
        margin-left: 0.25rem;
        margin-right: 0.25rem;
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .map-container {
        height: 250px;
        margin-left: 0.25rem;
        margin-right: 0.25rem;
        border-radius: 8px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 16px; /* iOS zoom önleme */
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 44px;
    }
}

/* Beyaz tema - okunabilir renkler */
.route-controls,
.route-results {
    background: white !important;
    color: #1a1a1a !important;
    border: 1px solid #e0e0e0 !important;
}

.route-controls h3,
.result-header h3 {
    color: #1a1a1a !important;
    font-weight: 700 !important;
}

.stat-value {
    color: #000000 !important;
    font-weight: 700 !important;
    font-size: 1.3rem !important;
}

.form-group input {
    background: white !important;
    border: 2px solid #d0d0d0 !important;
    color: #1a1a1a !important;
    font-weight: 500 !important;
}

.form-group input:focus {
    background: white !important;
    border-color: #4CAF50 !important;
    color: #1a1a1a !important;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2) !important;
}

.stat-item {
    background: #f5f5f5 !important;
    color: #1a1a1a !important;
    border: 1px solid #e0e0e0 !important;
    border-left: 4px solid #4CAF50 !important;
}

.address-suggestions {
    background: white !important;
    border: 2px solid #d0d0d0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.suggestion-item {
    color: #1a1a1a !important;
    border-bottom: 1px solid #e0e0e0 !important;
    font-weight: 500 !important;
}

.suggestion-item:hover {
    background: #f0f0f0 !important;
    color: #000000 !important;
}

.form-group label {
    color: #333333 !important;
    font-weight: 600 !important;
}

.stat-label {
    color: #555555 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

.stat-icon {
    font-size: 1.8rem !important;
}

/* Popup içeriği */
.leaflet-popup-content {
    color: #1a1a1a !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
}


/* Print stilleri */
@media print {
    .route-controls,
    .route-actions,
    .result-actions {
        display: none;
    }
    
    .map-container {
        height: 400px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .route-results {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .leaflet-routing-container {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* Accessibility iyileştirmeleri */
.btn:focus,
.form-group input:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Reduced motion desteği */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .form-group input,
    .suggestion-item {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border: 2px solid #fff;
    }
    
    .btn-secondary {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
    
    .form-group input {
        border: 2px solid #000;
    }
}
