/* ============================================================
   Aluline TGV — Transit Mobile App CSS
   Design Reference: Metro Booking App (300Mind UI/UX @ Dribbble)
   Light Clean Mode
   v1.0.1 — 2026
   ============================================================ */

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

/* ── Variables ── */
:root {
    --tr-bg: #F0F3F7;
    --tr-bg-2: #FFFFFF;
    --tr-surface: #FFFFFF;
    --tr-surface-2: #F8FAFC;
    --tr-surface-3: #E2E8F0;
    --tr-glass: rgba(255, 255, 255, 0.95);
    --tr-border: #E2E8F0;
    --tr-border-strong: #CBD5E1;

    --tr-primary: #1A56DB;
    --tr-primary-light: #2563EB;
    --tr-primary-dark: #1E40AF;
    --tr-primary-glow: rgba(37, 99, 235, 0.2);
    
    --tr-accent: #FF4757;
    --tr-accent-glow: rgba(255, 71, 87, 0.2);
    --tr-green: #10B981;
    --tr-yellow: #F59E0B;
    --tr-red: #EF4444;

    --tr-text: #0F172A;
    --tr-text-2: #475569;
    --tr-text-muted: #94A3B8;
    
    /* Dark elements for hero section */
    --tr-dark-bg: #212529;
    --tr-dark-text: #FFFFFF;

    --tr-nav-height: 76px;
    --tr-header-height: 64px;
    --tr-radius: 24px;
    --tr-radius-sm: 16px;
    --tr-radius-xs: 8px;

    --tr-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --tr-shadow-card: 0 12px 24px rgba(0, 0, 0, 0.04);
    --tr-font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body.aluline-transit-body {
    font-family: var(--tr-font);
    background: var(--tr-bg);
    color: var(--tr-text);
    min-height: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* ── Global Background Decoration ── */
body.aluline-transit-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.03) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(255, 71, 87, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ── App Shell ── */
#tr-app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    z-index: 1;
    background: var(--tr-bg);
}

/* ── Header ── */
#tr-header {
    flex-shrink: 0;
    height: var(--tr-header-height);
    background: var(--tr-surface);
    border-bottom: 1px solid var(--tr-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    padding-top: env(safe-area-inset-top, 0px);
    position: relative;
    z-index: 100;
}

.tr-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tr-header-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: contain;
}

.tr-header-logo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--tr-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.tr-header-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tr-text);
    letter-spacing: -0.3px;
}

.tr-header-subtitle {
    font-size: 11px;
    color: var(--tr-text-2);
    font-weight: 500;
    margin-top: 1px;
}

.tr-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tr-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--tr-surface-2);
    border: 1px solid var(--tr-border);
    color: var(--tr-text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.tr-icon-btn:hover, .tr-icon-btn:active {
    background: var(--tr-surface-3);
    color: var(--tr-text);
}

/* ── Main Content Area ── */
#tr-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    position: relative;
    padding-bottom: calc(var(--tr-nav-height) + 16px);
}

#tr-content::-webkit-scrollbar {
    display: none;
}

/* ── Tab Panels ── */
.tr-panel {
    display: none;
    animation: trPanelIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100%;
}

.tr-panel.tr-active {
    display: block;
}

@keyframes trPanelIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Home Panel ── */
/* Mimicking Dribbble: Dark top hero section, then overlapping search card */
.tr-home-hero {
    background: var(--tr-dark-bg);
    color: var(--tr-dark-text);
    padding: 32px 20px 80px; /* Extra bottom padding for overlap */
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    position: relative;
}

.tr-home-greeting {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tr-home-greeting-name {
    font-size: 28px;
    font-weight: 800;
    color: var(--tr-dark-text);
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 24px;
}

.tr-home-greeting-name span {
    color: var(--tr-accent);
}

/* Quick Search Card on Home */
.tr-quick-search-card {
    background: var(--tr-surface);
    border-radius: var(--tr-radius);
    padding: 24px 20px;
    margin: -60px 20px 0; /* Pull up to overlap dark hero */
    position: relative;
    box-shadow: var(--tr-shadow-card);
    border: 1px solid var(--tr-border);
}

.tr-quick-search-label {
    display: none; /* Hide label to match clean dribbble look */
}

.tr-quick-search-inputs {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tr-quick-input-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent;
    border-radius: 0;
    padding: 16px 0;
    border-bottom: 1px dashed var(--tr-border);
    cursor: pointer;
    transition: all 0.2s;
}
.tr-quick-input-row:last-child {
    border-bottom: none;
}

.tr-quick-input-row:active {
    opacity: 0.7;
}

.tr-quick-input-row i {
    font-size: 18px;
    color: var(--tr-primary-light);
    flex-shrink: 0;
}

.tr-quick-input-row#tr-qs-origin-row i {
    color: var(--tr-accent);
}

.tr-quick-input-text {
    font-size: 16px;
    color: var(--tr-text);
    font-weight: 600;
    flex: 1;
}

.tr-quick-input-text.placeholder {
    color: var(--tr-text-muted);
    font-weight: 400;
}

.tr-quick-inputs-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.tr-quick-swap {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: var(--tr-surface);
    border: 1px solid var(--tr-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--tr-text-2);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.2s;
    z-index: 10;
}

.tr-divider-dot {
    display: none; /* Removed for clean look */
}

.tr-search-btn-quick {
    width: 100%;
    background: var(--tr-primary-light);
    color: #fff;
    border: none;
    border-radius: var(--tr-radius-sm);
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--tr-font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    -webkit-appearance: none;
    box-shadow: var(--tr-primary-glow);
}

.tr-search-btn-quick:active {
    transform: scale(0.98);
    background: var(--tr-primary);
}

/* Recent Searches Section */
.tr-section {
    padding: 24px 20px 0;
}

.tr-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tr-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tr-text);
    letter-spacing: -0.2px;
}

.tr-section-action {
    font-size: 14px;
    color: var(--tr-primary-light);
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--tr-font);
    padding: 0;
    transition: opacity 0.2s;
}

.tr-section-action:active {
    opacity: 0.7;
}

/* Recent Search Pills */
.tr-recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tr-recent-item {
    background: var(--tr-surface);
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--tr-shadow-card);
}

.tr-recent-item:active {
    background: var(--tr-surface-2);
    border-color: var(--tr-primary-light);
    transform: scale(0.99);
}

.tr-recent-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--tr-primary-light);
    flex-shrink: 0;
}

.tr-recent-info {
    flex: 1;
    min-width: 0;
}

.tr-recent-route {
    font-size: 15px;
    font-weight: 700;
    color: var(--tr-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tr-recent-meta {
    font-size: 13px;
    color: var(--tr-text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.tr-recent-arrow {
    color: var(--tr-text-muted);
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Search Panel ── */
.tr-search-header {
    padding: 24px 20px 16px;
}

.tr-search-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--tr-text);
    letter-spacing: -0.4px;
    margin-bottom: 4px;
}

.tr-search-subtitle {
    font-size: 14px;
    color: var(--tr-text-2);
    margin-bottom: 24px;
    font-weight: 500;
}

/* Station Input Cards */
.tr-search-form-card {
    background: var(--tr-surface);
    border: 1px solid var(--tr-border);
    border-radius: var(--tr-radius);
    padding: 8px;
    margin: 0 20px 16px;
    box-shadow: var(--tr-shadow-card);
}

.tr-station-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.tr-station-field:active {
    background: var(--tr-surface-2);
}

.tr-station-field-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.tr-station-field-icon.origin {
    background: rgba(255, 71, 87, 0.1);
    color: var(--tr-accent);
}

.tr-station-field-icon.dest {
    background: rgba(37, 99, 235, 0.1);
    color: var(--tr-primary-light);
}

.tr-station-field-body {
    flex: 1;
    min-width: 0;
}

.tr-station-field-label {
    font-size: 12px;
    color: var(--tr-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tr-station-field-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--tr-font);
    font-size: 16px;
    font-weight: 700;
    color: var(--tr-text);
    -webkit-appearance: none;
}

.tr-station-field-input::placeholder {
    color: var(--tr-text-muted);
    font-weight: 500;
}

.tr-field-divider {
    height: 1px;
    background: var(--tr-border);
    margin: 0 16px;
    position: relative;
}

.tr-swap-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--tr-surface);
    border: 1px solid var(--tr-border);
    color: var(--tr-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    z-index: 10;
}

/* Filters Row */
.tr-filters-row {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tr-filters-row::-webkit-scrollbar {
    display: none;
}

.tr-filter-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--tr-surface);
    border: 1px solid var(--tr-border);
    color: var(--tr-text-2);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tr-font);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.tr-filter-chip.active {
    background: var(--tr-primary-light);
    border-color: var(--tr-primary-light);
    color: #fff;
    box-shadow: var(--tr-primary-glow);
}

/* Advanced Filters Toggle */
.tr-advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--tr-primary-light);
    font-family: var(--tr-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.tr-advanced-toggle .caret {
    transition: transform 0.3s;
}

.tr-advanced-toggle.open .caret {
    transform: rotate(180deg);
}

.tr-advanced-filters {
    padding: 0 20px 20px;
    display: none;
    animation: fadeIn 0.3s;
}

.tr-advanced-filters.open {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tr-layover-wrap {
    margin-bottom: 20px;
}

.tr-layover-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.tr-layover-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--tr-text-2);
}

.tr-layover-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--tr-primary-light);
}

/* Range Slider styling */
.tr-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--tr-surface-3);
    border-radius: 3px;
    outline: none;
}

.tr-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--tr-primary-light);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Submit Button */
.tr-search-submit {
    margin: 0 20px 24px;
    width: calc(100% - 40px);
    background: var(--tr-primary-light);
    color: #fff;
    border: none;
    border-radius: var(--tr-radius-sm);
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--tr-font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: var(--tr-primary-glow);
}

.tr-search-submit:active {
    transform: scale(0.98);
}

/* Results Area */
#tr-results-area {
    padding: 0 16px;
}

.tr-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.tr-empty-icon {
    font-size: 48px;
    color: var(--tr-surface-3);
    margin-bottom: 16px;
}

.tr-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tr-text);
    margin-bottom: 8px;
}

.tr-empty-desc {
    font-size: 14px;
    color: var(--tr-text-2);
    line-height: 1.5;
}

/* Loader / Spinner */
.tr-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: trSpin 0.8s linear infinite;
    display: inline-block;
}

.tr-search-submit .tr-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
}

@keyframes trSpin {
    to { transform: rotate(360deg); }
}

/* Skeletons */
.tr-skeleton-card {
    background: var(--tr-surface);
    border-radius: var(--tr-radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--tr-border);
}

.tr-skeleton-line {
    height: 16px;
    background: var(--tr-surface-3);
    border-radius: 8px;
    margin-bottom: 8px;
    animation: trPulse 1.5s infinite ease-in-out;
}

.tr-skeleton-line.short { width: 40%; }
.tr-skeleton-line.medium { width: 70%; }
.tr-skeleton-line.long { width: 100%; }

@keyframes trPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Results Formatting */
.tr-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    margin-bottom: 12px;
}

.tr-results-count {
    font-size: 14px;
    color: var(--tr-text-muted);
    font-weight: 500;
}
.tr-results-count span {
    font-weight: 700;
    color: var(--tr-text);
}

.tr-sort-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tr-sort-bar::-webkit-scrollbar { display: none; }

.tr-sort-btn {
    padding: 6px 12px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid var(--tr-border);
    color: var(--tr-text-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: var(--tr-font);
}

.tr-sort-btn.active {
    background: var(--tr-surface-3);
    color: var(--tr-text);
    border-color: var(--tr-border-strong);
}

.tr-no-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--tr-surface);
    border-radius: var(--tr-radius-sm);
    border: 1px solid var(--tr-border);
}
.tr-no-results i {
    font-size: 40px;
    color: var(--tr-surface-3);
    margin-bottom: 12px;
}
.tr-no-results-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--tr-text-2);
}

/* Result Cards */
.tr-result-card {
    background: var(--tr-surface);
    border-radius: var(--tr-radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--tr-border);
    box-shadow: var(--tr-shadow-card);
    transition: all 0.2s;
    cursor: pointer;
}

.tr-result-card:active {
    transform: scale(0.99);
}

.tr-direct-badge, .tr-transit-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.tr-direct-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--tr-green);
}

.tr-transit-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--tr-yellow);
}

.tr-walk-badge {
    background: rgba(108, 99, 255, 0.1);
    color: var(--tr-primary-light);
}

.tr-card-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.tr-card-train-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--tr-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.tr-card-info {
    flex: 1;
    min-width: 0;
}

.tr-card-train-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--tr-text);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tr-card-times {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.tr-time {
    font-size: 18px;
    font-weight: 800;
    color: var(--tr-text);
    letter-spacing: -0.5px;
}

.tr-time-arrow-line {
    height: 2px;
    background: var(--tr-border-strong);
    width: 100%;
    position: relative;
}

.tr-time-arrow-icon {
    color: var(--tr-text-muted);
}

.tr-duration-pill {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tr-surface);
    font-size: 10px;
    font-weight: 600;
    color: var(--tr-text-muted);
    padding: 0 4px;
    white-space: nowrap;
}

.tr-overnight-tag {
    font-size: 10px;
    color: var(--tr-accent);
    vertical-align: super;
}

.tr-card-station-names {
    font-size: 12px;
    color: var(--tr-text-2);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tr-classes-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--tr-border);
}

.tr-class-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

/* Transit Legs Breakdown */
.tr-legs-section {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--tr-border);
}

.tr-result-card.expanded .tr-legs-section {
    display: block;
    animation: fadeIn 0.3s;
}

.tr-leg {
    display: flex;
    gap: 12px;
    position: relative;
    padding-bottom: 20px;
}

.tr-leg:last-child {
    padding-bottom: 0;
}

.tr-leg-timeline {
    width: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tr-leg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tr-primary-light);
    border: 2px solid var(--tr-surface);
    box-shadow: 0 0 0 1px var(--tr-primary-light);
    flex-shrink: 0;
    z-index: 2;
}
.tr-leg-dot.dest {
    background: var(--tr-accent);
    box-shadow: 0 0 0 1px var(--tr-accent);
}

.tr-leg-line {
    flex: 1;
    width: 2px;
    background: var(--tr-border-strong);
    margin-top: -2px;
    margin-bottom: -4px;
    z-index: 1;
}

.tr-leg-body {
    flex: 1;
    margin-top: -4px;
}

.tr-leg-train {
    font-size: 13px;
    font-weight: 700;
    color: var(--tr-text);
}

.tr-leg-stations {
    font-size: 12px;
    color: var(--tr-text-2);
    margin-top: 2px;
}
.tr-leg-stations span {
    font-weight: 600;
}

.tr-leg-times {
    font-size: 12px;
    color: var(--tr-text-muted);
    margin-top: 2px;
}

.tr-layover-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--tr-surface-2);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--tr-text-2);
    margin: -10px 0 10px 24px;
    border: 1px solid var(--tr-border);
}


/* ── Bottom Navigation ── */
#tr-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    height: var(--tr-nav-height);
    background: var(--tr-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--tr-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1000;
}

.tr-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--tr-text-muted);
    font-family: var(--tr-font);
    cursor: pointer;
    transition: all 0.2s;
    height: 100%;
    -webkit-appearance: none;
}

.tr-nav-item:active {
    opacity: 0.7;
}

.tr-nav-icon-wrap {
    font-size: 24px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tr-nav-label {
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s;
}

.tr-nav-item.active {
    color: var(--tr-primary-light);
}

.tr-nav-item.active .tr-nav-icon-wrap {
    transform: translateY(-2px);
}

.tr-nav-item.active .tr-nav-label {
    font-weight: 700;
}

/* ── Drawers (Station Picker) ── */
.tr-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.tr-overlay.open {
    opacity: 1;
    visibility: visible;
}

.tr-drawer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 430px;
    height: 90vh;
    background: var(--tr-bg);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 2001;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
}

.tr-drawer.open {
    transform: translateX(-50%) translateY(0);
}

.tr-drawer-handle {
    width: 40px;
    height: 4px;
    background: var(--tr-border-strong);
    border-radius: 2px;
    margin: 12px auto;
}

.tr-drawer-header {
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--tr-border);
}

.tr-drawer-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tr-text);
    margin-bottom: 16px;
    text-align: center;
}

.tr-drawer-search {
    position: relative;
}

.tr-drawer-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tr-text-muted);
    font-size: 18px;
}

.tr-drawer-search-input {
    width: 100%;
    background: var(--tr-surface);
    border: 1px solid var(--tr-border);
    border-radius: 12px;
    padding: 14px 14px 14px 44px;
    font-family: var(--tr-font);
    font-size: 15px;
    color: var(--tr-text);
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.tr-drawer-search-input:focus {
    border-color: var(--tr-primary-light);
    box-shadow: 0 0 0 3px var(--tr-primary-glow);
}

.tr-drawer-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.tr-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--tr-border);
    cursor: pointer;
    transition: background 0.2s;
}

.tr-drawer-item:last-child {
    border-bottom: none;
}

.tr-drawer-item:active {
    background: var(--tr-surface-2);
    border-radius: 12px;
}

.tr-drawer-item-code {
    width: 44px;
    height: 32px;
    background: var(--tr-surface-3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--tr-text-2);
}

.tr-drawer-city-item .tr-drawer-item-code {
    background: rgba(37, 99, 235, 0.1);
    color: var(--tr-primary-light);
    font-size: 16px;
}

.tr-drawer-item-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--tr-text);
}

.tr-drawer-item-city {
    font-size: 12px;
    color: var(--tr-text-muted);
    margin-top: 2px;
}

/* Info Panel Elements */
.tr-info-panel {
    padding: 32px 20px;
}

.tr-info-hero {
    text-align: center;
    margin-bottom: 32px;
}

.tr-info-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--tr-primary-light);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: var(--tr-shadow-card);
}
.tr-info-logo img {
    width: 100%; height: 100%; object-fit: contain; border-radius: 20px;
}

.tr-info-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--tr-text);
    margin-bottom: 8px;
}

.tr-info-desc {
    font-size: 14px;
    color: var(--tr-text-2);
    line-height: 1.5;
}

.tr-version-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--tr-surface-2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--tr-text-2);
    border: 1px solid var(--tr-border);
}

.tr-apk-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--tr-green);
    color: #fff;
    text-decoration: none;
    padding: 16px;
    border-radius: var(--tr-radius-sm);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 32px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    transition: all 0.2s;
}

.tr-apk-btn:active {
    transform: scale(0.98);
}
.tr-apk-btn i { font-size: 20px; }

.tr-info-card {
    background: var(--tr-surface);
    border-radius: var(--tr-radius-sm);
    border: 1px solid var(--tr-border);
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: var(--tr-shadow-card);
}

.tr-info-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--tr-border);
    transition: background 0.2s;
}
.tr-info-row:last-child { border-bottom: none; }
.tr-info-row:active { background: var(--tr-surface-2); }

.tr-info-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--tr-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--tr-primary-light);
}

.tr-info-row-body { flex: 1; }
.tr-info-row-label { font-size: 15px; font-weight: 700; color: var(--tr-text); margin-bottom: 2px; }
.tr-info-row-desc { font-size: 12px; color: var(--tr-text-muted); }
.tr-info-row-arrow { color: var(--tr-text-muted); font-size: 16px; }

/* Responsive Desktop Wrapper */
@media (min-width: 431px) {
    body.aluline-transit-body {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #E2E8F0;
    }
    #tr-app {
        height: 850px;
        max-height: 90vh;
        border-radius: 32px;
        box-shadow: 0 24px 64px rgba(0,0,0,0.1);
        border: 8px solid #0F172A;
    }
    #tr-bottom-nav {
        position: absolute;
        border-bottom-left-radius: 24px;
        border-bottom-right-radius: 24px;
    }
    .tr-drawer {
        position: absolute;
    }
    .tr-overlay {
        position: absolute;
        border-radius: 24px;
    }
}
