@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');

:root {
    --primary-color: #9E9E9E; /* Ana Renk (Gri) */
    --background-dark: #212121; /* Ana Arka Plan (Koyu Gri) */
    --background-light: #424242; /* İkincil Arka Plan (Açık Gri) */
    --card-background: #303030;   /* Kart Arka Planı (Orta Gri) */
    --text-color: #e3e3e3;
    --text-muted: #a9a9a9;
    --error-color: #ff4d4d;
    --success-color: #28a745;
}

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    color: var(--text-color);
    background-color: var(--background-dark); /* Fallback color */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Genel Sayfa Düzeni */
.page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
}

/* Login Sayfası Özel Stilleri */
.login-page-body {
    background-image: linear-gradient(rgba(33, 33, 33, 0.7), rgba(20, 20, 20, 0.9)), url('assets/login-bg.jpg');
    background-size: cover;
    background-position: center;
}

.card {
    background-color: rgba(48, 48, 48, 0.85); /* Gri Şeffaflık */
    backdrop-filter: blur(10px); /* Arka planı bulanıklaştır */
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Login Page Specific */
.login-container {
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background-color: var(--background-light);
    color: var(--text-color);
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #757575; /* Hover Rengi (Koyu Gri) */
}

.error-message {
    color: var(--error-color);
    text-align: center;
    min-height: 1.2em;
    font-size: 0.9em;
}

/* Admin Page Specific */
.admin-body {
    display: flex;
    height: 100vh;
    overflow: hidden;
    align-items: stretch; /* Stretch items to fill the container's height */
}

#form-container {
    width: 400px;
    padding: 20px;
    background: var(--card-background);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#map-container {
    flex-grow: 1;
    background: var(--background-dark);
}

#map {
    height: 100%;
}

#route-list-container {
    flex-grow: 1;
    overflow-y: auto;
}

.route-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.delete-btn {
    padding: 5px 10px;
    background: var(--error-color);
    color: white;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 5px;
}

/* Login Page Specific */
#route-form button {
    margin-top: 10px;
}

/* Logo Stilleri */
.logo-container {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container img {
    max-width: 180px;
    height: auto;
}

.logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 150px; /* Logonun genişliğini ayarlayabilirsiniz */
    height: auto;
    background-image: url('assets/logo.jpg'); /* DOSYA YOLU GÜNCELLENDİ */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 60px; /* Yüksekliği de ayarlayalım */
}

/* Footer Stilleri */
.footer {
    margin-top: auto; /* Flex container içinde dibe iter */
    padding: 20px 10px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-login {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-color);
    font-size: 0.9em;
}

.leaflet-control-geocoder-selected {
    background-color: #f0f0f0;
    font-weight: bold;
}

/* =================================
   Footer Styles
==================================== */

.sidebar-footer {
    padding: 20px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    padding: 12px;
    background-color: rgba(208, 2, 27, 0.5); /* Semi-transparent red */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s;
    margin-bottom: 20px;
    font-weight: 500;
}

.logout-btn i {
    margin-right: 8px;
}

.logout-btn:hover {
    background-color: #dc3545;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.contact-info a {
    color: #a9b3c1; /* Muted text color */
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-info a:hover {
    color: #4a90e2; /* --primary-color */
}

.contact-info a i {
    margin-right: 10px;
    width: 15px;
}

.copyright {
    font-size: 0.75rem;
    color: #7a828e; /* More muted */
    line-height: 1.4;
}

/* Footer for Login Page */
.page-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    text-align: center;
    background-color: transparent;
    z-index: 10;
}

.page-footer .contact-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.page-footer .contact-info a {
    color: #a9b3c1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    padding: 8px 12px;
    border-radius: 5px;
    background: rgba(255,255,255,0.05);
}

.page-footer .contact-info a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.page-footer .copyright {
    font-size: 0.75rem;
    color: #7a828e;
    line-height: 1.4;
    text-align: center;
    margin: 0;
}

/* =================================
   Minimalist Login Page Styles
==================================== */
.login-page-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to top right, #1e2024, #2d323e);
    overflow: hidden;
}

.login-wrapper {
    max-width: 420px;
    width: 100%;
    padding: 20px;
}

.login-form-container {
    background: var(--card-background);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-form-container .logo-container {
    margin-bottom: 20px;
}

.login-form-container .logo-container img {
    max-width: 180px;
}

.login-form-container h2 {
    margin-bottom: 10px;
    font-size: 1.8rem;
    color: #fff;
}

.login-form-container .login-subtitle {
    margin-bottom: 30px;
    color: #a9b3c1;
}

.login-form-container .input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.login-form-container .input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a9b3c1;
}

.login-form-container .input-group input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 1px solid #3c4452;
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--background-light);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.login-form-container .input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.login-form-container button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-form-container button:hover {
    background-color: #3a7ac8;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

/* Mobil responsive login */
@media (max-width: 768px) {
    .login-wrapper {
        padding: 10px;
        margin-bottom: 100px;
    }
    
    .login-form-container {
        padding: 30px 20px;
    }
    
    .login-form-container h2 {
        font-size: 1.5rem;
    }
    
    .page-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 15px;
        background: rgba(30, 32, 36, 0.9);
        backdrop-filter: blur(10px);
    }
    
    .page-footer .contact-info {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-footer .contact-info a {
        display: block;
        padding: 8px 10px;
        text-align: center;
        font-size: 12px;
        background: rgba(255,255,255,0.1);
        border-radius: 6px;
        margin: 0 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .page-footer .copyright {
        font-size: 11px;
        margin-top: 10px;
    }
}

.login-form-container .error-message {
    margin-top: 15px;
    color: var(--danger-color);
    font-weight: 500;
}

/* Ana İçerik Footer */
.main-footer {
    padding: 15px 20px;
    text-align: center;
    background-color: #2d323e; /* Koyu tema için uygun bir renk */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: #a9b3c1;
    font-style: italic;
    flex-shrink: 0; /* Küçülmesini engelle */
}

/* Leaflet Control Geocoder Custom Style - Modern Admin Panel Tasarımı */
.leaflet-control-geocoder {
    background: #fff !important;
    border: 1.5px solid #e3e6ea !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(60,72,88,0.10) !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 15px !important;
    min-width: 200px !important;
    max-width: 240px !important;
    padding: 0 !important;
    transition: box-shadow 0.2s, border 0.2s !important;
}

/* Basit arama kutusu için stil */
.leaflet-control input[type="text"] {
    background: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    color: #222 !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 15px !important;
    height: 32px !important;
    padding: 0 8px 0 6px !important;
    width: 170px !important;
    box-sizing: border-box !important;
    outline: none !important;
    margin-left: 6px !important;
    transition: box-shadow 0.2s !important;
}

.leaflet-control input[type="text"]:focus {
    background: #f7faff !important;
    box-shadow: 0 0 0 2px #4a90e2 !important;
}

.leaflet-control-geocoder-form {
    display: flex !important;
    align-items: center !important;
    padding: 0 10px 0 6px !important;
    height: 40px !important;
}

.leaflet-control-geocoder input {
    background: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    color: #222 !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 15px !important;
    height: 32px !important;
    padding: 0 8px 0 6px !important;
    width: 170px !important;
    box-sizing: border-box !important;
    outline: none !important;
    margin-left: 6px !important;
    transition: box-shadow 0.2s !important;
}

.leaflet-control-geocoder input:focus {
    background: #f7faff !important;
    box-shadow: 0 0 0 2px #4a90e2 !important;
}

.leaflet-control-geocoder-icon {
    background: transparent !important;
    border: none !important;
    border-radius: 50% !important;
    color: #4a90e2 !important;
    cursor: pointer !important;
    font-size: 18px !important;
    height: 32px !important;
    width: 32px !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 2px !important;
    transition: background 0.2s !important;
}

.leaflet-control-geocoder-icon:hover {
    background: #eaf3fb !important;
}

.leaflet-control-geocoder-icon i {
    font-size: 17px !important;
}

.leaflet-control-geocoder-alternatives {
    background: #fff !important;
    border: 1px solid #e3e6ea !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(60,72,88,0.13) !important;
    list-style: none !important;
    margin: 0 !important;
    max-height: 220px !important;
    overflow-y: auto !important;
    padding: 0 !important;
    position: absolute !important;
    top: 100% !important;
    width: 100% !important;
    z-index: 1000 !important;
}

.leaflet-control-geocoder-alternatives li {
    border-bottom: 1px solid #f0f2f5 !important;
    color: #222 !important;
    cursor: pointer !important;
    font-size: 14px !important;
    padding: 11px 16px !important;
    transition: background 0.18s !important;
}

.leaflet-control-geocoder-alternatives li:first-child {
    border-radius: 8px 8px 0 0 !important;
}

.leaflet-control-geocoder-alternatives li:last-child {
    border-bottom: none !important;
    border-radius: 0 0 8px 8px !important;
}

.leaflet-control-geocoder-alternatives li:hover {
    background: #eaf3fb !important;
    color: #1a4a7a !important;
}

/* Custom Arama Kutusu Stilleri */
.custom-search-control {
    background: #fff !important;
    border: 1.5px solid #e3e6ea !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(60,72,88,0.10) !important;
    padding: 4px !important;
    margin: 10px !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 15px !important;
    min-width: 200px !important;
    max-width: 240px !important;
    transition: box-shadow 0.2s, border 0.2s !important;
}

.custom-search-input {
    background: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    color: #222 !important;
    font-family: 'Roboto', sans-serif !important;
    font-size: 15px !important;
    height: 32px !important;
    padding: 0 8px 0 6px !important;
    width: 170px !important;
    box-sizing: border-box !important;
    outline: none !important;
    margin-left: 6px !important;
    transition: box-shadow 0.2s !important;
}

.custom-search-input:focus {
    background: #f7faff !important;
    box-shadow: 0 0 0 2px #4a90e2 !important;
}

/* Mobil için özel düzenlemeler */
@media (max-width: 768px) {
    /* Sidebar içeriği için z-index */
    #sidebar {
        position: relative;
        z-index: 200;
    }
    
    /* Tüm durakları göster butonu için z-index */
    #show-all-stops-btn,
    #hide-all-stops-btn {
        position: relative;
        z-index: 1000;
    }
    
    /* Mobil footer düzenlemeleri */
    .mobile-footer {
        position: relative !important;
        background: rgba(30, 32, 36, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        padding: 10px !important;
        margin-top: 150px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    .mobile-logout-btn {
        width: 50% !important;
        padding: 4px !important;
        background: #dc3545 !important;
        color: white !important;
        border: none !important;
        border-radius: 3px !important;
        font-size: 10px !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        margin: 100px auto 10px auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        max-width: 120px !important;
        min-width: 80px !important;
    }
    
    .mobile-contact-buttons {
        display: none; /* Mobilde gizle */
    }
    
    .mobile-contact-btn {
        flex: 1;
        padding: 10px;
        border: none;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    
    .whatsapp-btn {
        background: #25d366;
        color: white;
    }
    
    .email-btn {
        background: #007bff;
        color: white;
    }
    
    .mobile-copyright {
        font-size: 11px;
        color: #a9b3c1;
        text-align: center;
        margin: 0;
    }
    
    /* Sidebar'ın alt kısmında mobil footer için boşluk */
    #sidebar {
        padding-bottom: 20px;
        overflow-y: auto;
        height: 100vh;
    }
    
    /* Desktop footer'ı mobilde gizle */
    .sidebar-footer {
        display: none;
    }
}

/* Desktop'ta mobil footer'ı gizle */
@media (min-width: 769px) {
    .mobile-footer {
        display: none;
    }
}