/* OTA-Style Modern CSS for Aluline TGV Frontend */
:root {
    --alu-primary: #0194f3;
    --alu-primary-hover: #007ce8;
    --alu-bg: #f2f3f7;
    --alu-surface: #ffffff;
    --alu-text: #212121;
    --alu-text-muted: #687176;
    --alu-border: #e4e7ea;
    --alu-radius: 12px;
    --alu-radius-lg: 16px;
    --alu-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --alu-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.aluline-frontend-body {
    margin: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--alu-bg);
    color: var(--alu-text);
    -webkit-font-smoothing: antialiased;
}

.aluline-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.aluline-navbar {
    background: var(--alu-surface);
    border-bottom: 1px solid var(--alu-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.aluline-navbar .aluline-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.aluline-nav-brand img {
    height: 35px;
    display: block;
}
.aluline-nav-brand h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--alu-primary);
}
.aluline-nav-menu ul.aluline-main-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 24px;
}
.aluline-nav-menu ul.aluline-main-menu li a {
    text-decoration: none;
    color: var(--alu-text);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}
.aluline-nav-menu ul.aluline-main-menu li a:hover {
    color: var(--alu-primary);
}
.aluline-nav-user {
    position: relative;
    cursor: pointer;
}
.aluline-user-avatar i {
    font-size: 28px;
    color: #96a0a5;
    transition: color 0.2s;
}
.aluline-user-avatar:hover i {
    color: var(--alu-primary);
}
.aluline-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background: var(--alu-surface);
    border: 1px solid var(--alu-border);
    border-radius: var(--alu-radius);
    box-shadow: var(--alu-shadow);
    min-width: 180px;
    overflow: hidden;
}
.aluline-nav-user:hover .aluline-user-dropdown {
    display: block;
}
.aluline-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.aluline-dropdown-menu li a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--alu-text);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}
.aluline-dropdown-menu li a:hover {
    background: #f7f9fa;
    color: var(--alu-primary);
}

/* Hero Section */
.aluline-hero {
    background: linear-gradient(135deg, #0194f3 0%, #0056a8 100%);
    color: white;
    padding: 80px 20px 120px;
    text-align: center;
    position: relative;
}
.aluline-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 50px;
    background: var(--alu-bg);
    border-radius: 40px 40px 0 0;
}
.aluline-hero h1 {
    margin: 0 0 12px;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.aluline-hero p {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

/* Search Box (Floating) */
.aluline-search-box {
    background: var(--alu-surface);
    border-radius: var(--alu-radius-lg);
    box-shadow: var(--alu-shadow);
    padding: 24px;
    max-width: 800px;
    margin: -80px auto 40px;
    position: relative;
    z-index: 10;
}
.aluline-search-form {
    display: flex;
    gap: 16px;
    align-items: center;
}
.aluline-search-input-group {
    flex: 1;
    position: relative;
}
.aluline-search-input-group i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--alu-text-muted);
    font-size: 18px;
}
.aluline-search-input-group input {
    width: 100%;
    padding: 16px 16px 16px 44px;
    border: 1px solid var(--alu-border);
    border-radius: var(--alu-radius);
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.aluline-search-input-group input:focus {
    outline: none;
    border-color: var(--alu-primary);
    box-shadow: 0 0 0 3px rgba(1, 148, 243, 0.15);
}
.aluline-search-btn {
    background: #ff5e1f; /* Traveloka Orange Accent */
    color: white;
    border: none;
    border-radius: var(--alu-radius);
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}
.aluline-search-btn:hover {
    background: #e04b12;
}

/* OTA Cards / Result Lists */
.aluline-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.aluline-list-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}
.aluline-results-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.aluline-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.alu-card, .aluline-card {
    background: var(--alu-surface);
    border-radius: var(--alu-radius);
    box-shadow: var(--alu-shadow-sm);
    padding: 20px;
    border: 1px solid var(--alu-border);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
}
.alu-card:hover, .aluline-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--alu-shadow);
    border-color: var(--alu-primary);
}
.alu-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(1, 148, 243, 0.1);
    color: var(--alu-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.alu-card-content {
    flex: 1;
}
.alu-card-content h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--alu-text);
}
.alu-card-meta {
    margin: 0;
    font-size: 13px;
    color: var(--alu-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}
.alu-badge, .aluline-badge {
    background: #e6f4ff;
    color: var(--alu-primary);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-top: 8px;
}
.dark-theme .alu-card-icon {
    background: rgba(255, 255, 255, 0.05);
}
.dark-theme .alu-badge {
    background: rgba(1, 148, 243, 0.2);
}

/* Specific to Schedules (Flight-like UI) */
.schedule-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.schedule-point {
    text-align: center;
    flex: 1;
}
.schedule-time {
    font-size: 20px;
    font-weight: 700;
    display: block;
}
.schedule-station {
    font-size: 13px;
    color: var(--alu-text-muted);
}
.schedule-divider {
    flex: 0 0 60px;
    text-align: center;
    color: #cbd4da;
    font-size: 12px;
    position: relative;
}
.schedule-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    border-top: 1px dashed #cbd4da;
    z-index: 1;
}
.schedule-divider i {
    position: relative;
    z-index: 2;
    background: var(--alu-surface);
    padding: 0 4px;
    color: var(--alu-text-muted);
}

.aluline-footer {
    background: var(--alu-surface);
    border-top: 1px solid var(--alu-border);
    padding: 30px 0;
    text-align: center;
    color: var(--alu-text-muted);
    margin-top: 60px;
    font-size: 14px;
}

/* Pagination */
.aluline-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.aluline-pagination a, .aluline-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--alu-surface);
    border: 1px solid var(--alu-border);
    color: var(--alu-text);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.aluline-pagination a:hover {
    background: #f7f9fa;
}
.aluline-pagination .current {
    background: var(--alu-primary);
    color: white;
    border-color: var(--alu-primary);
}

@media (max-width: 768px) {
    .aluline-search-form {
        flex-direction: column;
    }
    .aluline-search-input-group {
        width: 100%;
    }
    .aluline-search-btn {
        width: 100%;
        justify-content: center;
    }
    .aluline-hero {
        padding: 60px 20px 100px;
    }
    .aluline-search-box {
        margin: -60px 16px 30px;
        padding: 16px;
    }
    .schedule-time {
        font-size: 18px;
    }
    .aluline-nav-actions {
        gap: 8px;
    }
    .alu-lang-switcher, .alu-theme-switcher {
        width: 50px;
    }
    .alu-lang-checkbox:checked + .alu-lang-label .alu-lang-slider,
    .alu-theme-checkbox:checked + .alu-theme-label .alu-theme-slider {
        transform: translateX(20px);
    }
}

/* --- Dark Theme Variables --- */
body.dark-theme {
    --alu-bg: #121212;
    --alu-surface: #1e1e1e;
    --alu-text: #e0e0e0;
    --alu-text-muted: #9e9e9e;
    --alu-border: #333333;
    --alu-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --alu-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* --- Dark Theme Explicit Overrides ---
   Force all dynamically-rendered cards to respect dark surface.
   WP theme CSS can override inline styles via higher specificity,
   so we use body.dark-theme explicit rules as a safety net. */
body.dark-theme .aluline-ota-list-item,
body.dark-theme .alu-transit-card,
body.dark-theme .aluline-ota-result-card,
body.dark-theme .alu-schedule-modal-content,
body.dark-theme .alu-modal-content,
body.dark-theme .alu-no-results,
body.dark-theme .alu-ota-results-wrapper {
    background: var(--alu-surface) !important;
    color: var(--alu-text) !important;
    border-color: var(--alu-border) !important;
}
body.dark-theme .alu-transit-legs,
body.dark-theme .alu-timetable-container,
body.dark-theme .alu-schedule-detail-box {
    background: var(--alu-bg) !important;
}
body.dark-theme .aluline-dropdown-menu,
body.dark-theme .aluline-dropdown-menu li a {
    background: var(--alu-surface) !important;
    color: var(--alu-text) !important;
}
body.dark-theme .aluline-dropdown-menu li a:hover {
    background: var(--alu-bg) !important;
}
/* Class pills: keep their own colors in dark mode but ensure contrast */
body.dark-theme .class-pill {
    opacity: 0.92;
}
/* Ensure search box / form inputs are dark */
body.dark-theme .alu-search-box,
body.dark-theme .alu-input-wrap input,
body.dark-theme .alu-station-input,
body.dark-theme .aluline-search-form {
    background: var(--alu-surface) !important;
    color: var(--alu-text) !important;
    border-color: var(--alu-border) !important;
}
/* Langsung / transit pill in arrow */
body.dark-theme .alu-ota-time-arrow span {
    background: var(--alu-bg) !important;
    color: var(--alu-text-muted) !important;
}

/* --- Loader & No Results --- */
.aluline-loader, .aluline-no-results {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: var(--alu-text-muted);
    grid-column: 1 / -1;
}
.aluline-loader i {
    font-size: 24px;
    margin-right: 8px;
    color: var(--alu-primary);
    display: inline-block;
}
.aluline-no-results i {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    color: var(--alu-border);
}
@keyframes ph-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.ph-spin { animation: ph-spin 1s linear infinite; }

/* --- Nav Actions (Switchers) --- */
.aluline-nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Language Switcher */
.alu-lang-switcher {
    position: relative;
    width: 60px;
    height: 30px;
}
.alu-lang-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.alu-lang-label {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--alu-border);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--alu-text-muted);
}
.alu-lang-slider {
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: var(--alu-surface);
    border-radius: 50%;
    transition: 0.4s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}
.alu-lang-id, .alu-lang-en {
    z-index: 1;
}
.alu-lang-checkbox:checked + .alu-lang-label .alu-lang-slider {
    transform: translateX(30px);
}
.alu-lang-checkbox:checked + .alu-lang-label .alu-lang-en {
    color: var(--alu-primary);
}
.alu-lang-checkbox:not(:checked) + .alu-lang-label .alu-lang-id {
    color: var(--alu-primary);
}

/* Theme Switcher */
.alu-theme-switcher {
    position: relative;
    width: 60px;
    height: 30px;
}
.alu-theme-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.alu-theme-label {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--alu-border);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    color: var(--alu-text-muted);
}
.alu-theme-slider {
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: var(--alu-surface);
    border-radius: 50%;
    transition: 0.4s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.alu-theme-checkbox:checked + .alu-theme-label {
    background-color: var(--alu-primary);
}
.alu-theme-checkbox:checked + .alu-theme-label i.ph-moon {
    color: white;
}
.alu-theme-checkbox:checked + .alu-theme-label .alu-theme-slider {
    transform: translateX(30px);
}

/* --- Modals (90% width & height) --- */
body.alu-modal-open {
    overflow: hidden; /* Prevent background scrolling */
}
.alu-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}
.alu-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.alu-modal-container {
    position: fixed;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    background: var(--alu-surface);
    z-index: 9999;
    border-radius: var(--alu-radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.alu-modal-container.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}
/* Nested modal sits on top */
.alu-modal-container.nested {
    z-index: 10000;
    transform: translateX(20px);
}
.alu-modal-container.nested.active {
    transform: translateX(0);
}
.alu-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--alu-border);
}
.alu-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--alu-text);
}
.alu-modal-close, .alu-nested-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--alu-text-muted);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alu-modal-close:hover, .alu-nested-modal-close:hover {
    color: var(--alu-primary);
}
.alu-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.alu-modal-section {
    margin-bottom: 30px;
}
.alu-modal-section h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--alu-primary);
}
/* Re-use cards in modal */
.alu-modal-body .alu-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
/* Map Container in Modal */
.alu-modal-map {
    width: 100%;
    height: 300px;
    border-radius: var(--alu-radius);
    background: #e9ecef;
    margin-bottom: 16px;
    overflow: hidden;
}
/* Action Buttons */
.alu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--alu-primary);
    color: white !important;
    text-decoration: none;
    border-radius: var(--alu-radius);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.alu-btn:hover {
    background: var(--alu-primary-hover);
}
.alu-btn-outline {
    background: transparent;
    color: var(--alu-primary) !important;
    border: 1px solid var(--alu-primary);
}
.alu-btn-outline:hover {
    background: rgba(1, 148, 243, 0.1);
}
/* Timetable Table */
.alu-timetable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}
.alu-timetable th, .alu-timetable td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--alu-border);
    text-align: left;
}
.alu-timetable th {
    background: rgba(0,0,0,0.02);
    font-weight: 600;
    color: var(--alu-text-muted);
}
.dark-theme .alu-timetable th {
    background: rgba(255,255,255,0.02);
}

/* OTA Search Page Styles */
.aluline-hero-search {
    padding: 100px 20px 160px;
}
.aluline-hero-search h1 {
    font-size: 42px;
}
.aluline-ota-search-box {
    background: var(--alu-surface);
    border-radius: var(--alu-radius-lg);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    padding: 32px;
    max-width: 900px;
    margin: 40px auto -140px;
    position: relative;
    z-index: 10;
    text-align: left;
}
.aluline-ota-search-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    position: relative;
}
.aluline-ota-input-wrapper {
    flex: 1;
}
.aluline-ota-input-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--alu-text);
    font-size: 14px;
}
.aluline-ota-input-wrapper .aluline-search-input-group input {
    padding: 18px 16px 18px 48px;
    font-size: 16px;
    border: 2px solid var(--alu-border);
}
.aluline-ota-input-wrapper .aluline-search-input-group i {
    font-size: 20px;
    left: 18px;
    color: var(--alu-primary);
}
.aluline-ota-input-wrapper .aluline-search-input-group input:focus {
    border-color: var(--alu-primary);
}

.aluline-ota-swap-btn {
    padding-bottom: 18px; /* Align with inputs */
}
.aluline-ota-swap-btn button {
    background: #f2f3f7;
    border: 1px solid var(--alu-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--alu-text-muted);
    transition: all 0.2s;
}
.aluline-ota-swap-btn button:hover {
    background: #e4e7ea;
    color: var(--alu-primary);
    transform: rotate(180deg);
}

.aluline-ota-btn-wrapper {
    flex: 0 0 auto;
}
.aluline-btn-primary {
    background: #ff5e1f; /* Traveloka Orange Accent */
    color: white;
    border: none;
    border-radius: var(--alu-radius);
    padding: 18px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}
.aluline-btn-primary:hover {
    background: #e04a11;
}

.aluline-search-info-container {
    margin-top: 180px;
    padding-bottom: 60px;
}
.aluline-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.aluline-info-card {
    background: var(--alu-surface);
    padding: 24px;
    border-radius: var(--alu-radius-lg);
    box-shadow: var(--alu-shadow-sm);
    text-align: center;
    border: 1px solid var(--alu-border);
}
.aluline-info-card i {
    font-size: 40px;
    color: var(--alu-primary);
    margin-bottom: 16px;
}
.aluline-info-card h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: var(--alu-text);
}
.aluline-info-card p {
    margin: 0;
    color: var(--alu-text-muted);
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .aluline-ota-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .aluline-ota-swap-btn {
        padding-bottom: 0;
        align-self: center;
        margin: -8px 0;
        z-index: 2;
    }
    .aluline-ota-btn-wrapper {
        margin-top: 16px;
    }
    .aluline-btn-primary {
        width: 100%;
        justify-content: center;
    }
    .aluline-info-grid {
        grid-template-columns: 1fr;
    }
    .aluline-hero-search {
        padding: 60px 20px 100px;
    }
    .aluline-search-info-container {
        margin-top: 120px;
    }
}

/* Autocomplete Suggestions */
.alu-suggestions-box {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--alu-surface);
    border: 1px solid var(--alu-border);
    border-radius: var(--alu-radius);
    box-shadow: var(--alu-shadow);
    margin-top: 4px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
}
.alu-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: var(--alu-text);
    border-bottom: 1px solid var(--alu-border);
}
.alu-suggestion-item:last-child {
    border-bottom: none;
}
.alu-suggestion-item:hover {
    background: #f7f9fa;
    color: var(--alu-primary);
}
.alu-suggestion-item strong {
    color: var(--alu-primary);
}
.alu-suggestion-city {
    font-weight: 600;
    color: #687176;
    background: #f1f3f5;
}
.alu-suggestion-city:hover {
    background: #e9ecef;
}

/* OTA List View Results */
.aluline-ota-results-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 24px;
    background: var(--alu-surface);
    border-radius: var(--alu-radius-lg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.alu-ota-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.alu-ota-list-item {
    border: 1px solid var(--alu-border);
    border-radius: var(--alu-radius);
    padding: 20px;
    background: var(--alu-surface);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.alu-ota-list-item:hover {
    box-shadow: var(--alu-shadow-sm);
    border-color: var(--alu-primary);
}
.alu-ota-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alu-ota-train-info {
    flex: 1;
}
.alu-ota-train-name {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--alu-text);
}
.alu-ota-train-number {
    font-size: 14px;
    color: var(--alu-text-muted);
}
.alu-ota-times {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 2;
    justify-content: flex-end;
}
.alu-ota-time-block {
    text-align: center;
}
.alu-ota-time {
    font-size: 20px;
    font-weight: 700;
    color: var(--alu-text);
}
.alu-ota-station {
    font-size: 14px;
    color: var(--alu-text-muted);
    margin-top: 4px;
}
.alu-ota-time-arrow {
    color: var(--alu-primary);
    font-size: 24px;
}

@media (max-width: 768px) {
    .alu-ota-item-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .alu-ota-times {
        width: 100%;
        justify-content: space-between;
        gap: 16px;
    }
}

/* Toggle Switch Styles */
.alu-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .alu-slider {
    background-color: var(--alu-primary);
}
input:checked + .alu-slider:before {
    transform: translateX(20px);
}

/* --- Filter Button Styles --- */
.alu-time-filter-btn, .alu-train-filter-btn, .alu-cargo-filter-btn, .alu-transit-filter-btn {
    background: var(--alu-surface);
    color: var(--alu-text);
    border: 1px solid var(--alu-border);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: var(--alu-shadow-sm);
}

.alu-train-filter-btn {
    padding: 4px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.alu-time-filter-btn:hover, .alu-train-filter-btn:hover, .alu-cargo-filter-btn:hover, .alu-transit-filter-btn:hover {
    background: var(--alu-bg);
    border-color: var(--alu-text-muted);
}

.alu-time-filter-btn.alu-filter-active, .alu-train-filter-btn.alu-filter-active, .alu-cargo-filter-btn.alu-filter-active, .alu-transit-filter-btn.alu-filter-active {
    background: var(--alu-primary);
    color: #ffffff;
    border-color: var(--alu-primary);
}

.alu-time-filter-btn.alu-filter-active:hover, .alu-train-filter-btn.alu-filter-active:hover, .alu-cargo-filter-btn.alu-filter-active:hover, .alu-transit-filter-btn.alu-filter-active:hover {
    background: var(--alu-primary-hover);
    border-color: var(--alu-primary-hover);
}

/* Floating Search Box (Elegant & Attached to Header) */
.aluline-ota-search-box.alu-floating-search {
    position: fixed;
    top: 70px; /* Attach exactly below the 70px header */
    left: 0;
    width: 100%;
    max-width: 100%;
    z-index: 990;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 12px 0;
    border-radius: 0 0 24px 24px;
    animation: aluSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.aluline-ota-search-box.alu-floating-search .aluline-ota-search-form {
    gap: 12px;
    flex-wrap: nowrap;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    justify-content: center;
}

.aluline-ota-search-box.alu-floating-search .aluline-ota-input-wrapper label {
    display: none;
}

.aluline-ota-search-box.alu-floating-search input {
    height: 40px;
    font-size: 14px;
}

.aluline-ota-search-box.alu-floating-search .aluline-search-submit-btn {
    height: 40px;
    font-size: 14px;
    padding: 0 16px;
}

.aluline-ota-search-box.alu-floating-search .aluline-ota-swap-btn {
    margin-top: 0;
}

/* Hide filters when floating */
.aluline-ota-search-box.alu-floating-search #alu-recent-searches-wrapper,
.aluline-ota-search-box.alu-floating-search #alu-search-options,
.aluline-ota-search-box.alu-floating-search #alu-filters-container {
    display: none !important;
}

/* FAB Go Up */
#alu-fab-up {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--alu-primary);
    color: #fff;
    border: none;
    box-shadow: var(--alu-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    background: var(--alu-surface);
    transition: box-shadow 0.2s, border-color 0.2s;
}
.alu-ota-list-item:hover {
    box-shadow: var(--alu-shadow-sm);
    border-color: var(--alu-primary);
}
.alu-ota-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.alu-ota-train-info {
    flex: 1;
}
.alu-ota-train-name {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--alu-text);
}
.alu-ota-train-number {
    font-size: 14px;
    color: var(--alu-text-muted);
}
.alu-ota-times {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 2;
    justify-content: flex-end;
}
.alu-ota-time-block {
    text-align: center;
}
.alu-ota-time {
    font-size: 20px;
    font-weight: 700;
    color: var(--alu-text);
}
.alu-ota-station {
    font-size: 14px;
    color: var(--alu-text-muted);
    margin-top: 4px;
}
.alu-ota-time-arrow {
    color: var(--alu-primary);
    font-size: 24px;
}

@media (max-width: 768px) {
    .alu-ota-item-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .alu-ota-times {
        width: 100%;
        justify-content: space-between;
        gap: 16px;
    }
}

/* Toggle Switch Styles */
.alu-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .alu-slider {
    background-color: var(--alu-primary);
}
input:checked + .alu-slider:before {
    transform: translateX(20px);
}

/* --- Filter Button Styles --- */
.alu-time-filter-btn, .alu-train-filter-btn, .alu-cargo-filter-btn, .alu-transit-filter-btn {
    background: var(--alu-surface);
    color: var(--alu-text);
    border: 1px solid var(--alu-border);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: var(--alu-shadow-sm);
}

.alu-train-filter-btn {
    padding: 4px 12px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.alu-time-filter-btn:hover, .alu-train-filter-btn:hover, .alu-cargo-filter-btn:hover, .alu-transit-filter-btn:hover {
    background: var(--alu-bg);
    border-color: var(--alu-text-muted);
}

.alu-time-filter-btn.alu-filter-active, .alu-train-filter-btn.alu-filter-active, .alu-cargo-filter-btn.alu-filter-active, .alu-transit-filter-btn.alu-filter-active {
    background: var(--alu-primary);
    color: #ffffff;
    border-color: var(--alu-primary);
}
.alu-time-filter-btn.alu-filter-active:hover, .alu-train-filter-btn.alu-filter-active:hover, .alu-cargo-filter-btn.alu-filter-active:hover, .alu-transit-filter-btn.alu-filter-active:hover {
    background: var(--alu-primary-hover);
    border-color: var(--alu-primary-hover);
}

/* Floating Search Box (Elegant & Attached to Header) */
.aluline-ota-search-box.alu-floating-search {
    position: fixed;
    top: 70px; /* Attach exactly below the 70px header */
    left: 0;
    width: 100%;
    max-width: 100%;
    z-index: 990;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 12px 0;
    border-radius: 0 0 24px 24px;
    animation: aluSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.aluline-ota-search-box.alu-floating-search .aluline-ota-search-form {
    gap: 12px;
    flex-wrap: nowrap;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    justify-content: center;
}

.aluline-ota-search-box.alu-floating-search .aluline-ota-input-wrapper label {
    display: none;
}

.aluline-ota-search-box.alu-floating-search input {
    height: 40px;
    font-size: 14px;
}

.aluline-ota-search-box.alu-floating-search .aluline-search-submit-btn {
    height: 40px;
    font-size: 14px;
    padding: 0 16px;
}

.aluline-ota-search-box.alu-floating-search .aluline-ota-swap-btn {
    margin-top: 0;
}

/* Hide recent searches when floating */
.aluline-ota-search-box.alu-floating-search #alu-recent-searches-wrapper {
    display: none !important;
}

/* FAB Go Up */
#alu-fab-up {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--alu-primary);
    color: #fff;
    border: none;
    box-shadow: var(--alu-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#alu-fab-up.alu-fab-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#alu-fab-up:hover {
    background: var(--alu-primary-hover);
    transform: translateY(-3px);
}

#alu-fab-search {
    position: fixed;
    bottom: 84px; /* Above the scroll-up FAB */
    right: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--alu-primary);
    color: #fff;
    border: none;
    box-shadow: var(--alu-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#alu-fab-search.alu-fab-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#alu-fab-search:hover {
    background: var(--alu-primary-hover);
    transform: translateY(-3px) scale(1.05);
}

/* Range Slider Styling */
input[type=range]#alu-layover-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]#alu-layover-slider:focus {
    outline: none;
}
input[type=range]#alu-layover-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--alu-border);
    border-radius: 4px;
}
input[type=range]#alu-layover-slider::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--alu-primary);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
input[type=range]#alu-layover-slider:focus::-webkit-slider-runnable-track {
    background: var(--alu-border);
}
input[type=range]#alu-layover-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--alu-border);
    border-radius: 4px;
}
input[type=range]#alu-layover-slider::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--alu-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Collapsible Toggle */
#alu-toggle-advanced-filters:hover {
    background: rgba(0,0,0,0.05);
}
html[data-theme="dark"] #alu-toggle-advanced-filters:hover {
    background: rgba(255,255,255,0.05);
}
.alu-advanced-caret {
    transition: transform 0.3s ease;
}

/* Mobile & Tablet Optimization */
@media (max-width: 991px) {
    /* Hide header elements, only show logo container */
    .aluline-navbar {
        background: transparent !important;
        border-bottom: none !important;
        box-shadow: none !important;
        pointer-events: none !important;
    }
    .aluline-navbar .aluline-container {
        justify-content: flex-start !important;
        padding: 10px 20px !important;
        height: auto !important;
    }
    .aluline-nav-brand {
        background: var(--alu-surface) !important;
        padding: 8px 16px !important;
        border-radius: 20px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
        pointer-events: auto !important;
        display: inline-block !important;
        border: 1px solid rgba(0,0,0,0.05) !important;
    }
    .aluline-nav-menu, 
    .aluline-nav-actions,
    #alu-desktop-nav-menu,
    #alu-desktop-nav-actions {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* Mobile Switchers */
    .alu-mobile-header-actions {
        display: flex;
        gap: 8px;
        margin-left: auto;
        align-items: center;
        margin-right: 15px; /* space before the hamburger menu */
    }
    .alu-minimal-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 1px solid var(--alu-border);
        background: var(--alu-surface);
        color: var(--alu-text);
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        font-weight: 600;
        transition: all 0.2s ease;
        pointer-events: auto !important;
    }
    .alu-minimal-btn:hover, .alu-minimal-btn:active {
        background: var(--hover-bg);
    }
    .alu-minimal-btn i {
        font-size: 16px;
        pointer-events: none; /* Prevent icon from capturing click */
    }

    /* Force Mobile Menu Items to show in Modal */
    .alu-mobile-menu-body {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 0 10px;
    }
    .alu-mobile-menu-body .dropdown-item {
        display: flex !important;
        align-items: center;
        gap: 12px;
        padding: 12px 20px !important;
        color: var(--alu-text) !important;
        text-decoration: none !important;
        font-weight: 500;
        font-size: 15px;
        border-radius: 8px;
        transition: background 0.2s ease;
    }
    .alu-mobile-menu-body .dropdown-item:hover,
    .alu-mobile-menu-body .dropdown-item:active {
        background: var(--alu-hover) !important;
        color: var(--alu-primary) !important;
    }
    .alu-mobile-menu-body .aluline-nav-menu,
    .alu-mobile-menu-body .aluline-nav-actions {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: 100% !important;
        height: auto !important;
        flex-direction: column !important;
    }
    .alu-mobile-menu-body #alu-desktop-nav-menu ul {
        flex-direction: column !important;
    }

    /* Adjust floating search to sit BELOW the logo on mobile, full width */
    .aluline-ota-search-box.alu-floating-search {
        top: 65px !important; /* Below header */
        left: 10px !important; 
        right: 10px !important;
        width: auto !important;
        margin: 0 !important; /* Reset inherited margins */
        border-radius: 16px !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
        background: var(--alu-surface) !important;
        z-index: 999 !important;
        transition: all 0.4s ease-in-out !important;
    }
    
    .aluline-ota-search-box.alu-floating-search.alu-search-collapsed {
        opacity: 0 !important;
        pointer-events: none !important;
        transform: scale(0.1) translate(40vw, 50vh) !important;
        visibility: hidden !important;
    }
    
    /* Fix form layout on mobile (stacked) */
    .aluline-ota-search-form {
        flex-direction: column !important;
        gap: 12px !important;
    }
    .aluline-ota-input-wrapper {
        width: 100% !important;
    }
    
    /* Compact layout for floating search */
    .aluline-ota-search-box.alu-floating-search .aluline-ota-search-form {
        flex-direction: row !important;
        gap: 6px !important;
        padding: 0 !important;
        align-items: center;
    }
    .aluline-ota-search-box.alu-floating-search .aluline-ota-input-wrapper label {
        display: none !important;
    }
    .aluline-ota-search-box.alu-floating-search .aluline-ota-input-wrapper {
        width: auto !important;
        flex: 1 !important;
    }
    .aluline-ota-search-box.alu-floating-search input {
        font-size: 14px !important;
        padding: 6px 8px !important;
        height: 36px !important;
        border-radius: 12px !important;
        text-align: center;
        background: var(--bg-body) !important;
        border: 1px solid var(--border-color) !important;
    }
    .aluline-ota-search-box.alu-floating-search .aluline-search-input-group i {
        display: none !important; /* Hide input icons to save space */
    }
    .aluline-ota-search-box.alu-floating-search .aluline-ota-swap-btn button {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
        margin: 0 !important;
        transform: rotate(0deg) !important;
    }
    .aluline-ota-search-box.alu-floating-search .aluline-ota-btn-wrapper {
        width: auto !important;
        flex: 0 0 auto !important;
    }
    .aluline-ota-search-box.alu-floating-search .aluline-search-submit-btn {
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: row !important;
    }
    .aluline-ota-search-box.alu-floating-search .aluline-search-submit-btn span {
        display: none !important;
    }

    /* COMPACT MOBILE RESULT CARDS (Overrides inline styles) */
    .aluline-ota-list-item.alu-transit-card {
        padding: 12px !important; /* Reduce main padding */
    }
    .alu-transit-header {
        padding-bottom: 8px !important;
        margin-bottom: 12px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    .alu-transit-header > div {
        flex-wrap: wrap !important;
    }
    .alu-transit-header span {
        font-size: 12px !important;
    }
    .alu-ota-times {
        margin-bottom: 12px !important;
    }
    .alu-ota-time-block .alu-ota-time {
        font-size: 18px !important;
    }
    .alu-ota-time-block .alu-ota-station {
        font-size: 11px !important;
        line-height: 1.2 !important;
    }
    .alu-ota-time-arrow {
        padding: 0 10px !important;
    }
    .alu-ota-time-arrow span {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }
    .alu-transit-legs {
        padding: 10px !important; /* Reduce inner background padding */
    }
    .alu-transit-legs > div > div > div {
        font-size: 12px !important; /* Force smaller font for leg details */
    }
    .alu-transit-legs .alu-card-clickable {
        font-size: 12px !important;
    }
    .alu-transit-legs .alu-btn {
        padding: 4px 8px !important;
        font-size: 12px !important;
    }
}

/* --- Mobile Menu Modal Styles --- */
.alu-mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    backdrop-filter: blur(4px);
}
.alu-mobile-menu-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    background: var(--alu-surface);
    border-radius: 0;
    box-shadow: none;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.alu-mobile-menu-overlay.alu-modal-active .alu-mobile-menu-content {
    transform: translateY(0);
}
.alu-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--alu-border);
}
.alu-mobile-menu-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
/* Style the copied menus inside modal */
#alu-mobile-menu-placeholder ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
#alu-mobile-menu-placeholder li {
    margin-bottom: 16px;
}
#alu-mobile-menu-placeholder a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    display: block;
    padding: 8px 0;
}
#alu-mobile-actions-placeholder {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-top: 1px solid var(--alu-border);
    padding-top: 20px;
}

/* Classes Collapsible - Mobile Only */
.alu-classes-toggle { display: none; font-size: 11px; color: var(--alu-primary); font-weight: 600; align-items: center; gap: 4px; cursor: pointer; margin-top: 4px; }
.alu-classes-toggle .alu-caret { transition: transform 0.2s; }
.alu-classes-collapsible.alu-expanded .alu-classes-toggle .alu-caret { transform: rotate(180deg); }
@media (max-width: 991px) { .alu-classes-toggle { display: inline-flex; } .alu-classes-content { display: none; padding-top: 6px; } .alu-classes-collapsible.alu-expanded .alu-classes-content { display: flex; } }
