/* 
 * CTP Arad Modern Design System & Traveler UI
 * Vanilla CSS implementation featuring premium glassmorphism, responsive mobile layout,
 * interactive micro-animations, and distinct color themes for Trams vs Buses.
 */

:root {
    /* Color Palette - Cheerful Pastel Light & Vibrant Defaults */
    --bg-base: #fcfcfd;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f0f7ff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(226, 232, 240, 0.9);
    --shadow-sm: 0 4px 15px rgba(148, 163, 184, 0.12);
    --shadow-md: 0 12px 28px -4px rgba(148, 163, 184, 0.22);
    --shadow-glow-tram: 0 10px 25px -3px rgba(16, 185, 129, 0.30);
    --shadow-glow-bus:  0 10px 25px -3px rgba(220, 38,  38, 0.28);

    /* Transit Theme Tokens — Tram: green (Imperios/Tatra); Bus: red (CTP fleet) */
    --tram-accent: #059669;
    --tram-hover:  #10b981;
    --tram-glow:   rgba(5, 150, 105, 0.25);
    --tram-bg:     #ecfdf5;
    --tram-border: #a7f3d0;

    --bus-accent: #dc2626;
    --bus-hover:  #ef4444;
    --bus-glow:   rgba(220, 38, 38, 0.25);
    --bus-bg:     #fef2f2;
    --bus-border: #fecaca;

    /* UI Accents */
    --primary: #8b5cf6;
    --primary-light: #7c3aed;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Dimensions & Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --max-width: 1300px;
    --border-radius: 16px;
    --card-radius: 20px;
    --transition-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-theme,
.ctp-widget-wrapper.dark-theme {
    --bg-base: #080c14;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(17, 24, 39, 0.85);
    --glass-border: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 16px 32px -8px rgba(0, 0, 0, 0.45);
    --tram-bg:     rgba(16, 185, 129, 0.12);
    --tram-border: rgba(16, 185, 129, 0.25);
    --bus-bg:      rgba(220, 38,  38, 0.12);
    --bus-border:  rgba(220, 38,  38, 0.25);
}

/* Base Reset & Typography localized strictly to CTP module */
.ctp-widget-wrapper,
.ctp-widget-wrapper *,
.modal-overlay,
.modal-overlay *,
body.standalone-ctp-app,
body.standalone-ctp-app * {
    box-sizing: border-box;
}

.ctp-widget-wrapper h1,
.ctp-widget-wrapper h2,
.ctp-widget-wrapper h3,
.ctp-widget-wrapper p,
.ctp-widget-wrapper ul,
.modal-overlay h1,
.modal-overlay h2,
.modal-overlay h3,
.modal-overlay p,
.modal-overlay ul,
body.standalone-ctp-app h1,
body.standalone-ctp-app h2,
body.standalone-ctp-app h3,
body.standalone-ctp-app p,
body.standalone-ctp-app ul {
    margin: 0;
    padding: 0;
}

body.standalone-ctp-app,
.ctp-widget-wrapper {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

body.standalone-ctp-app {
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

/* Ambient Floating Background Glows (Joyful Pastel Aura) */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.55;
    pointer-events: none;
}

.glow-tram {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.40) 0%, rgba(167, 243, 208, 0.22) 40%, rgba(255,255,255,0) 70%);
    top: -120px;
    right: -80px;
    animation: floatGlow 16s ease-in-out infinite alternate;
}

.glow-bus {
    width: 750px;
    height: 750px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.38) 0%, rgba(254, 202, 202, 0.22) 40%, rgba(255,255,255,0) 70%);
    bottom: -180px;
    left: -140px;
    animation: floatGlow 20s ease-in-out infinite alternate-reverse;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-40px, 60px) scale(1.1);
    }
}

/* Header Section (Centered Clean Clock) */
.ctp-clock-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem 2rem 0.75rem 2rem;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    box-sizing: border-box;
}

.clock-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--bg-surface-elevated);
    padding: 0.65rem 1.6rem;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.clock-badge-large:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-clock-large {
    width: 22px;
    height: 22px;
    color: var(--success);
    flex-shrink: 0;
}

.date-badge-large {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--bg-surface-elevated);
    padding: 0.65rem 1.6rem;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-main);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.25px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.date-badge-large:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.icon-date-large {
    width: 20px;
    height: 20px;
    color: #6366f1;
    flex-shrink: 0;
}

.icon-circular-route {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

/* Main Content Area */
.main-container {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.ctp-mod-search-wrapper {
    width: 100%;
}

.ctp-mod-search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.ctp-mod-search-container:focus-within {
    border-color: var(--bus-accent);
    box-shadow: 0 0 0 4px var(--bus-glow);
}

.ctp-mod-search-icon {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
    margin-left: 1.25rem;
    flex-shrink: 0;
}

#search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 0.75rem;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1rem;
    font-family: var(--font-body);
}

#search-input::placeholder {
    color: var(--text-muted);
}

.btn-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    padding: 0 1rem;
    cursor: pointer;
    line-height: 1;
}

.btn-clear:hover {
    color: var(--text-main);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover {
    color: var(--text-main);
    transform: translateY(-2px);
    background: var(--bg-surface-elevated);
}

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    border-color: #8b5cf6;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.tab-tram.active {
    background: linear-gradient(135deg, #34d399, #059669);
    border-color: #10b981;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

.tab-bus.active {
    background: linear-gradient(135deg, #f87171, #dc2626);
    border-color: #ef4444;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tram-dot {
    background-color: var(--tram-accent);
}

.bus-dot {
    background-color: var(--bus-accent);
}

.tab-btn.active .dot {
    background-color: white;
}

.badge-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Lines Grid & Card Design */
.lines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.5rem;
}

.line-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 300ms cubic-bezier(0.1, 0.9, 0.2, 1), box-shadow 300ms ease, border-color 300ms ease;
    box-shadow: var(--shadow-sm);
}

.line-card[data-type="tramvai"] {
    background: linear-gradient(150deg, var(--bg-surface) 60%, var(--tram-bg) 100%);
    border-color: var(--tram-border);
}

.line-card[data-type="autobuz"] {
    background: linear-gradient(150deg, var(--bg-surface) 60%, var(--bus-bg) 100%);
    border-color: var(--bus-border);
}

.line-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    transition: width var(--transition-smooth);
}

.line-card[data-type="tramvai"]::before {
    background: var(--tram-accent);
}

.line-card[data-type="autobuz"]::before {
    background: var(--bus-accent);
}

.line-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.line-card[data-type="tramvai"]:hover {
    border-color: var(--tram-accent);
    box-shadow: var(--shadow-glow-tram);
}

.line-card[data-type="autobuz"]:hover {
    border-color: var(--bus-accent);
    box-shadow: var(--shadow-glow-bus);
}

.card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.badge-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.line-badge {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    padding: 0.35rem 0.85rem;
    border-radius: 12px;
    color: white;
    letter-spacing: -0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    min-width: 62px;
    text-align: center;
}

.tram-badge {
    background: var(--tram-accent) !important;
    color: #ffffff !important;
}

.bus-badge {
    background: var(--bus-accent) !important;
    color: #ffffff !important;
}

.transit-type-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.tram-tag {
    color: var(--tram-accent);
    background: var(--tram-bg);
}

.bus-tag {
    color: var(--bus-accent);
    background: var(--bus-bg);
}

.line-destination {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.stops-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.btn-view-schedule {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.45rem 0.95rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

.line-card:hover .btn-view-schedule {
    background: var(--text-main);
    color: var(--bg-surface);
}

/* Loading & Empty States */
.loading-state,
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    max-width: 500px;
    margin: 2rem auto;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--tram-accent);
    border-right-color: var(--bus-accent);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 1.25rem;
}

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

.empty-icon-circle {
    width: 64px;
    height: 64px;
    background: var(--bg-surface-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--text-muted);
}

.icon-empty {
    width: 32px;
    height: 32px;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    transition: transform var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
}

/* Slide-Over Schedule Drawer Modal */
/* Centered Schedule Modal Window (High Z-Index above WP Headers) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1.5rem 1.5rem;
    opacity: 1;
    transition: opacity 300ms ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.schedule-drawer {
    width: 100%;
    max-width: 1150px;
    height: 82vh;
    max-height: 820px;
    margin-top: 1rem;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    transform: scale(1) translateY(0);
    opacity: 1;
    transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1), opacity 280ms ease;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.15);
    overflow: hidden;
    position: relative;
}

.modal-overlay.hidden .schedule-drawer {
    transform: scale(0.92) translateY(20px);
    opacity: 0;
}

.drawer-header {
    background: var(--bg-surface);
    padding: 1rem 4.5rem 0.85rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    position: relative;
}

.drawer-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.drawer-title-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.line-badge-large {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    padding: 0.5rem 1.25rem;
    border-radius: 16px;
    background: var(--primary);
    /* Safe default fallback against white container */
    color: #ffffff !important;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.drawer-headings h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.drawer-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-close {
    position: absolute;
    top: 1.5rem;
    right: 1.75rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: background-color var(--transition-smooth), transform var(--transition-smooth), color var(--transition-smooth);
}

.btn-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg) scale(1.08);
}

/* Direction and Day Category Tabs in Drawer */
.direction-switcher-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.switcher-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.direction-tabs,
.day-category-tabs {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: center;
}

.dir-tab-btn,
.day-tab-btn {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.38rem 0.75rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dir-tab-btn:hover,
.day-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.dir-tab-btn.active,
.day-tab-btn.active {
    background: var(--text-main);
    color: var(--bg-surface);
    border-color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-reset-dir {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.38rem 0.75rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-reset-dir:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* Drawer Body Columns (1/3 vs 2/3 Side-by-Side Layout) */
.drawer-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    height: 100%;
}

.drawer-col {
    overflow-y: auto;
    height: 100%;
}

.timeline-col {
    flex: 0 0 33%;
    max-width: 33%;
    padding: 0.85rem 0.65rem;
    border-right: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
}

.timetable-col {
    flex: 1;
    max-width: 67%;
    padding: 0.85rem;
    background: var(--bg-base);
}

.col-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
}

.col-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-main);
}

.hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Station Timeline Track */
.station-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

.timeline-node {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    background: transparent;
    border: 1px solid transparent;
}

.timeline-node:hover {
    background: rgba(255, 255, 255, 0.04);
}

.timeline-node.active {
    background: var(--bg-surface);
    border-color: var(--border-color);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.node-bullet {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    background: var(--bg-surface);
    z-index: 2;
    transition: all var(--transition-smooth);
}

.timeline-node.active .node-bullet {
    border-color: var(--success);
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }
}

.timeline-node::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 14px;
    width: 2px;
    height: calc(100% - 6px);
    background: var(--border-color);
    z-index: 1;
}

.timeline-node:last-child::after {
    display: none;
}

.node-text {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-main);
    line-height: 1.25;
    word-break: break-word;
}

.timeline-node.active .node-text {
    color: var(--success);
    font-weight: 700;
}

/* Timetable Card & Grid (Compact Font & Padding) */
.timetable-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 100%;
}

.timetable-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.station-tag {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.selected-station-info h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 0.2rem;
}

.next-departure-box {
    background: var(--bg-surface-elevated);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.4rem 0.85rem;
    border-radius: 10px;
    text-align: right;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.08);
}

.next-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    text-transform: uppercase;
    font-weight: 700;
}

.next-val {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--success);
}

/* Departures Legend Header ("ORA" / "MINUTUL") */
.timetable-legend-header {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.4rem;
    margin-bottom: 0.25rem;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--tram-accent);
}

.legend-ora {
    flex: 0 0 46px;
    text-align: center;
    margin-right: 0.65rem;
}

.legend-minutul {
    flex: 1;
}

/* Departures Grid Layout */
.timetable-grid {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.hour-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.hour-row:last-child {
    border-bottom: none;
}

.hour-badge {
    flex: 0 0 46px;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    background: var(--bg-surface-elevated);
    padding: 0.25rem;
    border-radius: 8px;
    margin-right: 0.65rem;
}

.hour-row.active-hour .hour-badge {
    background: var(--primary);
    color: white;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.minutes-list {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    flex: 1;
}

.min-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.65rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.84rem;
    color: var(--text-main);
    box-shadow: 0 1px 4px rgba(148, 163, 184, 0.1);
    transition: all var(--transition-smooth);
}

.min-pill:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(124, 58, 237, 0.18);
}

.min-pill.upcoming {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-color: #10b981;
    color: #065f46;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.min-pill.upcoming.next-vehicle {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #047857;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.45);
    animation: pulseNextVehicle 2s infinite;
}

@keyframes pulseNextVehicle {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
    }

    50% {
        transform: scale(1.07);
        box-shadow: 0 0 22px rgba(16, 185, 129, 0.75);
    }
}

.min-pill.upcoming-soon {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #059669;
    font-weight: 700;
}

body.dark-theme .min-pill.upcoming-soon,
.ctp-widget-wrapper.dark-theme .min-pill.upcoming-soon {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

@keyframes pulseGentle {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }
}

.min-pill.past {
    opacity: 0.4;
    text-decoration: line-through;
}

/* Stilizare specială pentru rândul orei cu o cursă apropiată (next-departure-row) */
.hour-row.next-departure-row {
    background: rgba(16, 185, 129, 0.07);
    border-left: 4px solid var(--success, #10b981);
    border-radius: 8px;
    padding: 0.55rem 0.65rem;
    margin: 0.25rem 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.08);
    transition: all var(--transition-smooth, 0.3s ease);
}

.hour-row.next-departure-row .hour-badge {
    background: var(--success, #10b981);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

body.dark-theme .hour-row.next-departure-row,
.ctp-widget-wrapper.dark-theme .hour-row.next-departure-row {
    background: rgba(16, 185, 129, 0.14);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.18);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

/* Animație dinamică la aducerea în focus după selectarea stației */
.hour-row.highlight-pulse {
    animation: rowFocusPulse 2.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes rowFocusPulse {
    0% {
        transform: scale(0.98);
        box-shadow: 0 0 0 rgba(16, 185, 129, 0);
        background: rgba(16, 185, 129, 0.05);
    }

    25% {
        transform: scale(1.02);
        box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
        background: rgba(16, 185, 129, 0.25);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.08);
    }
}

/* Footer */
.main-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4rem;
}

/* Mobile Quick Navigation Elements */
.mobile-only-btn {
    display: none;
}

/* Responsive Media Queries */
@media (max-width: 950px) {
    .modal-overlay {
        padding: 0;
    }

    .schedule-drawer {
        max-width: 100vw;
        height: 100vh;
        max-height: none;
        margin-top: 0;
        border-radius: 0;
        border: none;
    }

    .btn-close {
        top: 1.25rem;
        right: 1.25rem;
        width: 38px;
        height: 38px;
    }

    .drawer-body {
        flex-direction: row;
        overflow: hidden;
        height: 100%;
        padding-bottom: 0;
    }

    .timeline-col {
        flex: 0 0 35%;
        max-width: 35%;
        max-height: none;
        border-right: 1px solid var(--border-color);
        border-bottom: none;
        box-shadow: none;
        padding: 0.5rem 0.4rem;
    }

    .timetable-col {
        flex: 1;
        max-width: 65%;
        padding: 0.5rem;
    }

    .mobile-only-btn {
        display: inline-flex;
        align-items: center;
        background: var(--bg-surface-elevated);
        color: var(--primary-light);
        border: 1px solid var(--primary);
        border-radius: 999px;
        padding: 0.35rem 0.85rem;
        font-size: 0.8rem;
        font-weight: 700;
        cursor: pointer;
        transition: all var(--transition-smooth);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .mobile-only-btn:active,
    .mobile-only-btn:hover {
        background: var(--primary);
        color: white;
        transform: translateY(-1px);
    }
}

@media (max-width: 600px) {
    /* Stack header: chips row on top, button below */
    .header-clock-planner-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .ctp-clock-header {
        padding: 1rem 1rem 0.65rem 1rem;
    }

    .header-chips-left {
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .clock-badge-large,
    .date-badge-large {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        flex: 1;
        justify-content: center;
    }

    .btn-planner-hero {
        width: 100%;
        justify-content: center;
    }

    .filter-tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
    }

    .lines-grid {
        grid-template-columns: 1fr;
    }

    .drawer-header {
        padding: 1rem 1.25rem;
    }

    .drawer-title-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .timetable-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .next-departure-box {
        width: 100%;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

/* ==========================================================================
   10. CTP ARAD JOURNEY PLANNER (ROUTE FINDER / GOOGLE FLIGHTS STYLE)
   ========================================================================== */

.header-clock-planner-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1.25rem;
}

/* Date + clock chips cluster — stays left */
.header-chips-left {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-planner-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: linear-gradient(135deg, var(--primary, #6366f1), var(--accent, #8b5cf6), #ec4899);
    background-size: 200% 200%;
    padding: 0.65rem 1.6rem;
    border-radius: 999px;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradientShiftHero 6s ease infinite;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-planner-hero:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.55);
    border-color: rgba(255, 255, 255, 0.6);
}

.icon-planner {
    width: 22px;
    height: 22px;
    color: #ffffff;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes gradientShiftHero {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Planner Modal Dialog (Center Screen / Large Drawer) */
.planner-modal-dialog {
    background: var(--bg-main, #ffffff);
    width: 95%;
    max-width: 920px;
    max-height: 90vh;
    margin: auto;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    animation: plannerModalZoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-theme .planner-modal-dialog,
.ctp-widget-wrapper.dark-theme .planner-modal-dialog {
    background: var(--bg-main, #0f172a);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
}

@keyframes plannerModalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.planner-modal-header {
    padding: 1.5rem 2rem;
    background: var(--bg-surface-elevated, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.planner-header-title {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.planner-icon-badge {
    font-size: 2.5rem;
    background: var(--bg-surface);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.planner-header-title h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.25rem 0;
}

.planner-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.planner-modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Controls & Inputs Form Grid */
.planner-controls-card {
    background: var(--bg-surface, #f1f5f9);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.planner-form-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: end;
}

.planner-time-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.3fr;
    gap: 1rem;
    align-items: start;
}

.planner-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.planner-input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.2px;
}

.invisible-label {
    visibility: hidden;
    height: 0;
    margin: 0;
}

.autocomplete-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 5;
}

.planner-text-input {
    width: 100% !important;
    padding: 0.75rem 2.5rem 0.75rem 3.2rem !important;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-main, #ffffff);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.planner-date-input,
.planner-time-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 1rem !important;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-main, #ffffff);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.planner-text-input:focus,
.planner-date-input:focus,
.planner-time-input:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-clear-input {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 6px;
    z-index: 5;
}

.btn-clear-input:hover {
    color: var(--text-main);
    background: var(--bg-surface);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-main, #ffffff);
    border: 2px solid var(--primary, #6366f1);
    border-radius: 12px;
    margin-top: 6px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    list-style: none;
    padding: 0.5rem 0;
}

.autocomplete-item {
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.15s ease;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary, #6366f1);
    font-weight: 700;
}

.planner-swap-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 4px;
}

.btn-swap {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: var(--bg-main, #ffffff) !important;
    border: 2px solid var(--border-color, #cbd5e1) !important;
    color: var(--primary, #6366f1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.12)) !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 10;
}

.btn-swap svg {
    width: 24px !important;
    height: 24px !important;
    fill: var(--primary, #6366f1) !important;
    color: var(--primary, #6366f1) !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.btn-swap:hover {
    transform: rotate(180deg) scale(1.1);
    border-color: var(--primary, #6366f1) !important;
    color: var(--primary, #6366f1) !important;
    background: var(--bg-surface, #f8fafc) !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3) !important;
}

.date-input-wrapper,
.time-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.day-type-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    width: fit-content;
}

.tag-weekday {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success, #10b981);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-holiday {
    background: rgba(245, 158, 11, 0.18);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

body.dark-theme .tag-holiday {
    color: #fbbf24;
}

.time-input-wrapper {
    flex-direction: row;
    align-items: center;
}

.btn-now {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: var(--bg-main);
    border: 2px solid var(--accent, #8b5cf6);
    color: var(--accent, #8b5cf6);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-now:hover {
    background: var(--accent, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.btn-search-routes {
    width: 100%;
    margin-top: 5px;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, var(--primary, #6366f1), var(--accent, #8b5cf6));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transition: all 0.25s ease;
}

.btn-search-routes:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

.btn-search-routes .search-icon {
    width: 20px;
    height: 20px;
}

/* Route Results Area (Google Flights & Apple Transit style) */
.planner-results-wrapper {
    min-height: 260px;
    display: flex;
    flex-direction: column;
}

.planner-empty-message,
.planner-loading-message,
.planner-error-message {
    text-align: center;
    padding: 3rem 1.5rem;
    margin: auto;
    color: var(--text-muted);
    max-width: 480px;
}

.planner-illustration,
.error-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: floatGlow 4s ease-in-out infinite alternate;
}

.planner-empty-message h3,
.planner-error-message h3 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
}

.planner-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.results-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: rgba(99, 102, 241, 0.08);
    border-left: 4px solid var(--primary, #6366f1);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Route Card (Google Flights Timeline Architecture) */
.route-card {
    background: var(--bg-surface, #f8fafc);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.route-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--primary, #6366f1);
}

body.dark-theme .route-card:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.route-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px dashed var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.route-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.route-badge.direct-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.route-badge.transfer-badge {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

.route-time-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-heading);
}

.total-duration {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.35rem 0.85rem;
    border-radius: 10px;
}

.est-arrival {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Timeline flow (Google Flights style) */
.route-timeline-flow {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 1rem;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    padding-bottom: 1.25rem;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-bullet {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 4px solid var(--primary, #6366f1);
    z-index: 2;
    flex-shrink: 0;
    margin-top: 2px;
}

.timeline-step.step-origin .timeline-bullet {
    border-color: var(--success, #10b981);
}

.timeline-step.step-transfer .timeline-bullet {
    border-color: #f59e0b;
}

.timeline-step.step-dest .timeline-bullet {
    border-color: #ec4899;
}

.timeline-line-connector {
    position: absolute;
    top: 20px;
    left: 8px;
    bottom: -2px;
    width: 3px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 2px;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.step-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.step-time {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main);
}

.step-location {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Transit Leg Pill (Vehicle badge in the timeline) */
.transit-leg-box {
    background: var(--bg-main, #ffffff);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary, #6366f1);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.transit-vehicle-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.95rem;
    color: white;
}

.transit-vehicle-pill.pill-tram {
    background: var(--tram-accent);
}

.transit-vehicle-pill.pill-bus {
    background: var(--bus-accent);
}

.leg-details {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Layover Alert Box (Escala de transfer) */
.layover-alert-box {
    background: rgba(245, 158, 11, 0.12);
    border: 1px dashed rgba(245, 158, 11, 0.6);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #d97706;
    font-weight: 700;
    font-size: 0.9rem;
}

body.dark-theme .layover-alert-box {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

@media (max-width: 768px) {

    .planner-form-grid,
    .planner-time-grid {
        grid-template-columns: 1fr;
    }

    .planner-swap-container {
        transform: rotate(90deg);
        margin: -0.5rem 0;
    }

    .planner-modal-dialog {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .route-card-header,
    .transit-leg-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

.hidden {
    display: none !important;
}