.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
body::-webkit-scrollbar { display: none; }
body { -ms-overflow-style: none; scrollbar-width: none; }
.in-iframe * { transition: none !important; }

#brand-bar {
    max-height: 66px;
    opacity: 1;
    transition: max-height 0.35s ease, opacity 0.3s ease;
}
#brand-bar.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}
#about-modal,
#route-info-modal,
#route-map-overlay { backdrop-filter: blur(3px); z-index: 9999 !important; }

.panel-inner { display: grid; }
.panel-front, .panel-back { grid-area: 1 / 1; width: 100%; transition: opacity 0.25s ease; }
.panel-back { opacity: 0; pointer-events: none; }
.panel-inner.show-stops .panel-front { opacity: 0; pointer-events: none; }
.panel-inner.show-stops .panel-back { opacity: 1; pointer-events: auto; }
#dest-suggestions::-webkit-scrollbar { width: 4px; }
#dest-suggestions::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 2px; }
#origin-suggestions::-webkit-scrollbar { width: 4px; }
#origin-suggestions::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 2px; }

.dark .dm-bg-slate-900 { background-color: #0f172a; }
.dark .dm-bg-slate-800 { background-color: #1e293b; }
.dark .dm-bg-slate-800\/60 { background-color: rgb(30 41 59 / 0.6); }
.dark .dm-bg-slate-700 { background-color: #334155; }
.dark .dm-bg-emerald-800 { background-color: #065f46; }
.dark .dm-bg-emerald-500 { background-color: #10b981; }
.dark .dm-bg-emerald-950\/50 { background-color: rgb(2 44 34 / 0.5); }
.dark .dm-bg-emerald-950\/40 { background-color: rgb(2 44 34 / 0.4); }
.dark .dm-bg-rose-950\/50 { background-color: rgb(76 5 25 / 0.5); }
.dark .dm-bg-rose-950\/40 { background-color: rgb(76 5 25 / 0.4); }
.dark .dm-bg-amber-950\/30 { background-color: rgb(69 26 3 / 0.3); }
.dark .dm-text-slate-100 { color: #f1f5f9; }
.dark .dm-text-slate-200 { color: #e2e8f0; }
.dark .dm-text-slate-300 { color: #cbd5e1; }
.dark .dm-text-slate-400 { color: #94a3b8; }
.dark .dm-text-slate-500 { color: #64748b; }
.dark .dm-text-white { color: #ffffff; }
.dark .dm-text-emerald-300 { color: #6ee7b7; }
.dark .dm-text-emerald-400 { color: #34d399; }
.dark .dm-text-rose-300 { color: #fda4af; }
.dark .dm-text-rose-400 { color: #fb7185; }
.dark .dm-text-amber-400 { color: #fbbf24; }
.dark .dm-border-slate-700 { border-color: #334155; }
.dark .dm-border-slate-700\/50 { border-color: rgb(51 65 85 / 0.5); }
.dark .dm-border-slate-800 { border-color: #1e293b; }
.dark .dm-border-emerald-800 { border-color: #065f46; }
.dark .dm-hover-bg-slate-700:hover { background-color: #334155; }
.dark .dm-hover-bg-slate-600:hover { background-color: #475569; }
.dark .dm-hover-bg-emerald-900:hover { background-color: #064e3b; }
.dark .dm-hover-border-slate-600:hover { border-color: #475569; }
.dark .dm-translate-x-\[18px\] { transform: translateX(18px); }

#grid-ida, #grid-vuelta { transition: opacity 0.25s ease; }
#grid-ida.fade-out, #grid-vuelta.fade-out { opacity: 0; }

#line-tabs { transition: opacity 0.2s ease; }
#line-tabs.tab-filtering { opacity: 0.6; }

.line-tab {
    transition: opacity 0.25s ease, max-width 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    max-width: 340px;
}
.line-tab.tab-hide {
    opacity: 0;
    max-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    pointer-events: none;
}

#map-view {
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    padding: 12px 12px 0;
    background: #f8fafc;
    position: relative;
}
.dark #map-view {
    background: #0f172a;
}
#map-view.map-active {
    display: flex;
    flex: 1;
}

#map-container {
    flex: 1;
    border-radius: 16px;
    overflow: hidden;
    min-height: 400px;
    position: relative;
}

#map-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1000;
    background: white;
    border: none;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    color: #475569;
}
#map-close:hover {
    background: #f1f5f9;
}
.dark #map-close {
    background: #1e293b;
    color: #cbd5e1;
}
.dark #map-close:hover {
    background: #334155;
}

.dark #map-container .leaflet-tile-pane {
    filter: brightness(1.15) contrast(1.1);
}

.map-pin {
    position: relative;
    padding: 5px 11px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.28);
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: -0.3px;
}
.map-pin:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.pin-point {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid;
}

.leaflet-popup-content-wrapper {
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.leaflet-popup-content {
    margin: 14px 18px;
    font-size: 14px;
    line-height: 1.5;
}
.popup-btn {
    display: block;
    margin-top: 10px;
    text-align: center;
    background: #059669;
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: background 0.2s;
}
.popup-btn:hover {
    background: #047857;
}

.route-tooltip {
    background: #1e293b;
    color: #f1f5f9;
    font-weight: 600;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.route-tooltip::before {
    border-top-color: #1e293b;
}
.dark .route-tooltip {
    background: #f1f5f9;
    color: #0f172a;
}
.dark .route-tooltip::before {
    border-top-color: #f1f5f9;
}

@media (max-width: 640px) {
    .map-pin {
        padding: 3px 8px;
        font-size: 8px;
        border-width: 1.5px;
    }
    .pin-point {
        bottom: -6px;
        border-left-width: 4px;
        border-right-width: 4px;
        border-top-width: 5px;
    }
    #map-container {
        min-height: 300px;
    }
    #map-overlay-container {
        min-height: 250px;
    }
    #map-view {
        padding: 8px 8px 0;
    }
}
