.loader {
    border: 4px solid rgba(89, 112, 138, 0.5);
    border-top: 4px solid #14b8a6;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    transition: all 0.3s ease;
    transform: translateX(-100%);
    z-index: 50;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.28);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar.minimized {
    width: 80px;
    min-width: 80px;
}

.sidebar.minimized .sidebar-header-text,
.sidebar.minimized .sidebar-section-content,
.sidebar.minimized .sidebar-section-header span {
    display: none;
}

.sidebar.minimized .sidebar-section-header {
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.sidebar.minimized .sidebar-btn-main {
    width: auto;
    height: auto;
    padding: 0.75rem 0.5rem;
    justify-content: center;
}

.sidebar.minimized .sidebar-btn {
    width: auto;
    height: auto;
    padding: 0.75rem 0.5rem;
    justify-content: center;
}

.sidebar.minimized .sidebar-btn i {
    margin: 0 !important;
}

.sidebar.minimized .sidebar-btn span {
    display: none;
}

.sidebar h2 {
    letter-spacing: 0.12em;
}

.sidebar-btn {
    justify-content: flex-start;
    text-align: left;
    font-size: 0.72rem;
}

.sidebar-section-header {
    cursor: pointer;
    user-select: none;
    font-size: 0.72rem;
    color: #cbd5e1;
}

.sidebar-section-header:hover {
    background-color: rgba(71, 85, 105, 0.22) !important;
}

/* Collapsible Sidebar Sections */

.sidebar-section-header i:last-child {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-section-header[aria-expanded="true"] i:last-child {
    transform: rotate(180deg);
}

.sidebar-section-content {
    display: grid;
    gap: 0.5rem;
    max-height: 500px;
    overflow: hidden;
    padding-left: 0.5rem;
    margin-top: 0.5rem;
    padding-right: 0.5rem;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── HARİTA FİLTRE PANELİ ── */
#mapFilterBtn {
    position: absolute;
    bottom: 28px;
    left: 10px;
    z-index: 999;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(6, 14, 30, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.45);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    transition: all 0.15s;
}
#mapFilterBtn:hover,
#mapFilterBtn.active {
    background: rgba(99, 102, 241, 0.28);
    border-color: rgba(99, 102, 241, 0.75);
    color: #c7d2fe;
}

#mapFilterPanel {
    position: absolute;
    bottom: 70px;
    left: 10px;
    z-index: 999;
    background: rgba(6, 14, 30, 0.96);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 188px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.55);
    animation: slideDown 0.18s ease;
}
#mapFilterPanel.hidden { display: none; }

.mfp-title {
    font-size: 9.5px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(99,102,241,0.18);
}

.mfp-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 11.5px;
    color: #cbd5e1;
    user-select: none;
}
.mfp-row:hover { background: rgba(99,102,241,0.1); }
.mfp-row input[type="checkbox"] {
    width: 13px;
    height: 13px;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}
.mfp-row span { line-height: 1; }

.sidebar-section-content.collapsed {
    max-height: 0;
    padding: 0;
    margin: 0;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sidebar-btn-main {
    font-size: 0.95rem;
}

.sidebar-btn-main i {
    transition: all 0.3s ease;
}

.sidebar-btn-main:hover i {
    transform: scale(1.15) !important;
}

.live-map-fullscreen {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.live-map-fullscreen #liveTripMap {
    width: 100%;
    height: 100%;
    flex: 1;
}

.live-bus-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 32px;
    line-height: 1;
    letter-spacing: 0;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.9));
    animation: busGlowPulse 1.5s ease-in-out infinite;
}

@keyframes busGlowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.6)) drop-shadow(0 0 2px rgba(99, 102, 241, 0.3));
    }
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: rgba(13, 24, 40, 0.95);
    color: #e6edf5;
    border: 1px solid rgba(120, 154, 193, 0.25);
}

/* ══ GÖREV ZİNCİRİ ══ */
.mission-chain-widget {
    position: absolute;
    bottom: 28px;
    left: 56px;
    z-index: 20;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 10px;
    color: #fbbf24;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all 0.15s;
}
.mission-chain-widget:hover {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.7);
    transform: scale(1.08);
}
.mission-badge {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 18px; height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 10px; font-weight: 800;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.mission-badge.pulse {
    animation: missionPulse 1.5s ease-in-out infinite;
}
@keyframes missionPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.mission-chain-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 14px;
    padding: 16px 18px;
    transition: border-color 0.15s;
}
.mission-chain-card:hover {
    border-color: rgba(100, 116, 139, 0.4);
}

/* ══════════════════════════════════════════════
   SOL HARİTA PANELİ  (components.css — kesin yüklenir)
══════════════════════════════════════════════ */

/* Toggle butonu — mapFilterBtn ile aynı pattern, sol alt köşe */
#mapLeftPanelToggle {
    position: absolute;
    bottom: 72px;          /* mapFilterBtn (bottom:28px + 36px + 8px gap) üstünde */
    left: 10px;
    z-index: 999;
    height: 36px;
    min-width: 110px;
    padding: 0 10px;
    background: rgba(6, 14, 30, 0.92);
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: 9px;
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
#mapLeftPanelToggle:hover,
#mapLeftPanelToggle.mlp-open {
    background: rgba(99, 102, 241, 0.28);
    border-color: rgba(99, 102, 241, 0.75);
    color: #c7d2fe;
}

/* Panel — soldan sağa kayarak açılır, tam yükseklik */
#mapLeftPanel {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(28vw, 310px);
    min-width: 220px;
    overflow: hidden;
    z-index: 998;
    background: rgba(4, 8, 20, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid rgba(99, 102, 241, 0.35);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    /* Kapalı: sola gizli */
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
#mapLeftPanel.open {
    transform: translateX(0);
    pointer-events: auto;
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.6);
}

/* İç layout */
.mlp-header {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 10px 0; flex-shrink: 0;
}
.mlp-tabs { display: flex; flex: 1; gap: 4px; }
.mlp-tab {
    flex: 1;
    display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 7px 4px; font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: #4b5563; background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.12); border-radius: 6px;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.mlp-tab:hover  { color: #818cf8; background: rgba(99,102,241,0.14); }
.mlp-tab.active { color: #a5b4fc; background: rgba(99,102,241,0.22); border-color: rgba(99,102,241,0.42); }
.mlp-close-btn {
    background: rgba(239,68,68,0.10); border: 1px solid rgba(239,68,68,0.22);
    color: #f87171; border-radius: 6px; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.mlp-close-btn:hover { background: rgba(239,68,68,0.24); }
.mlp-content { display: flex; flex-direction: column; flex: 1; overflow: hidden; margin-top: 8px; }
.mlp-content.mlp-hidden { display: none !important; }
.mlp-scroll {
    flex: 1; overflow-y: auto; padding: 0 10px 10px;
    scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.30) transparent;
}
.mlp-scroll::-webkit-scrollbar { width: 4px; }
.mlp-scroll::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.30); border-radius: 2px; }
.mlp-banner {
    margin: 6px 10px 4px; padding: 8px 12px; border-radius: 8px;
    font-size: 11px; flex-shrink: 0; line-height: 1.5;
}
.mlp-banner.red    { background: rgba(239,68,68,0.16); border: 1px solid rgba(239,68,68,0.32); color: #fca5a5; }
.mlp-banner.yellow { background: rgba(234,179,8,0.14);  border: 1px solid rgba(234,179,8,0.28);  color: #fde68a; }
.mlp-route-row {
    display: flex; flex-direction: column; gap: 5px; padding: 8px 10px;
    background: rgba(99,102,241,0.05); border: 1px solid rgba(99,102,241,0.10);
    border-radius: 8px; cursor: pointer; margin-bottom: 6px;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.mlp-route-row:hover { background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.28); }
.mlp-route-row.mlp-selected {
    background: rgba(99,102,241,0.20); border-color: rgba(99,102,241,0.50);
    box-shadow: 0 0 0 1px rgba(99,102,241,0.25) inset;
}
.mlp-stat-card {
    background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.12);
    border-radius: 8px; padding: 10px 12px; margin-bottom: 6px;
}

@media (max-width: 767px) {
    #mapLeftPanelToggle { bottom: 76px; min-width: 90px; font-size: 9px; }
    #mapLeftPanel { width: min(72vw, 280px); }
}
