/* ====== MODAL BUS MODIFY: HORIZONTAL RIGHT PANEL ====== */
#modalBusModify {
    position: fixed !important;
    inset: auto !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 420px !important;
    height: 100vh !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    gap: 0 !important;
    background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.4) 100%) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

#modalBusModify.hidden {
    transform: translateX(100%);
}

#modalBusModify.flex {
    animation: slideInFromRight 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

#modalBusModify:not(.flex) {
    animation: slideOutToRight 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#modalBusModify .bus-modify-shell {
    flex: 1;
    max-width: none;
    width: 100%;
    max-height: none;
    height: auto;
    border-radius: 0;
    padding: 1rem;
    overflow-y: auto;
    border: none;
    background: linear-gradient(160deg, rgba(17,24,39,0.98), rgba(15,23,42,0.97));
    border-left: 1px solid rgba(100,116,139,0.3);
}

#modalBusModify .bus-modify-grid {
    grid-template-columns: 1fr !important;
}
/* ====== MODAL BUS MODIFY END (HORIZONTAL PANEL) ====== */

.map-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .map-filter-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ── MOBİL MODAL İYİLEŞTİRMELERİ ── */
@media (max-width: 767px) {
    /* BusModify mobilde tam genişlik alttan açılır panel */
    #modalBusModify {
        width: 100% !important;
        top: auto !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        height: auto !important;
        max-height: 92vh !important;
    }
    #modalBusModify .bus-modify-shell {
        border-left: none !important;
        border-top: 1px solid rgba(100,116,139,0.3) !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
    }
    #modalBusModify.flex {
        animation: slideInFromBottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    }
    #modalBusModify:not(.flex) {
        animation: slideOutToBottom 0.28s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    /* Genel modaller — tam genişlik alttan */
    .modal:not(#modalBusModify) {
        padding: 0 !important;
        align-items: flex-end !important;
    }
    .modal:not(#modalBusModify) > div {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh !important;
        margin: 0 !important;
        padding: 20px 16px 24px !important;
    }
    /* Kaydırma tutamacı */
    .modal:not(#modalBusModify) > div::before {
        content: '';
        display: block;
        width: 44px; height: 5px;
        background: rgba(255,255,255,0.2);
        border-radius: 3px;
        margin: 0 auto 16px;
    }
    /* Modal içi butonlar — büyük dokunma hedefi */
    .modal button.w-full,
    .modal button[type="submit"],
    #btnRotaHemenBaslat, #btnRotaPlanla, #btnOtoSeferEkle {
        min-height: 52px !important;
        font-size: 16px !important;
        border-radius: 14px !important;
    }
    /* Modal tabları */
    .tab-btn { padding: 10px 14px !important; font-size: 13px !important; }

    /* Kaydırma görünürlüğü için ek boşluk */
    .modal .overflow-y-auto,
    .modal .custom-scrollbar { padding-bottom: 8px; }
}

@keyframes slideInFromBottom {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes slideOutToBottom {
    from { transform: translateY(0);    opacity: 1; }
    to   { transform: translateY(100%); opacity: 0; }
}
