/* Ori-MüVo PWA Styles - Dark Theme */

:root {
    --pwa-bg: #0f172a;
    --pwa-surface: #1e293b;
    --pwa-surface-hover: #334155;
    --pwa-border: #334155;
    --pwa-text: #f1f5f9;
    --pwa-text-muted: #94a3b8;
    --pwa-primary: #3b82f6;
    --pwa-primary-hover: #2563eb;
    --pwa-danger: #ef4444;
    --pwa-success: #22c55e;
    --pwa-tab-height: 65px;
    --pwa-header-height: 56px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);

    /* ── Bus-Widget Dark Theme (--bw-*) ── */
    --bw-bg-color: #0f172a;
    --bw-bg-secondary-color: #1e293b;
    --bw-text-color: #f1f5f9;
    --bw-text-muted-color: #94a3b8;
    --bw-border-color: #334155;
    --bw-primary-color: #3b82f6;
    --bw-primary-hover-color: #2563eb;
    --bw-success-color: #22c55e;
    --bw-danger-color: #ef4444;
    --bw-border-radius: 10px;
    --bw-bus-body-color: #1e293b;
    --bw-error-bg: rgba(239, 68, 68, 0.1);
    --bw-selected-bg: rgba(59, 130, 246, 0.15);

    /* ── Helfer-Widget Dark Theme (--hw-*) ── */
    --hw-bg-color: #0f172a;
    --hw-bg-secondary-color: #1e293b;
    --hw-text-color: #f1f5f9;
    --hw-text-muted-color: #94a3b8;
    --hw-border-color: #334155;
    --hw-primary-color: #3b82f6;
    --hw-primary-hover-color: #2563eb;
    --hw-success-color: #22c55e;
    --hw-success-hover-color: #16a34a;
    --hw-danger-color: #ef4444;
    --hw-danger-hover-color: #dc2626;
    --hw-border-radius: 10px;

    /* ── Kinderhaes-Widget Dark Theme (--kh-*) ── */
    --kh-bg-color: #0f172a;
    --kh-text-color: #f1f5f9;
    --kh-muted-color: #94a3b8;
    --kh-border-color: #334155;
    --kh-primary-color: #3b82f6;
    --kh-accent-color: #3b82f6;
    --kh-input-bg: #1e293b;
    --kh-input-border: #475569;
    --kh-placeholder-color: #64748b;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    overflow: hidden;
    background: var(--pwa-bg);
}

body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--pwa-bg);
    color: var(--pwa-text);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: contain;
    -webkit-touch-callout: none;
}

/* ── Splash Screen ── */

#splash-screen {
    position: fixed;
    inset: 0;
    background: var(--pwa-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#splash-screen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    width: 200px;
    height: auto;
    animation: splash-pop 0.6s ease-out;
}

@keyframes splash-pop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes splash-fade {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ── Login Screen ── */

#login-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    background: var(--pwa-bg);
    padding: 24px;
    padding-top: calc(24px + var(--safe-top));
    padding-bottom: calc(24px + var(--safe-bottom));
}

.login-card {
    background: var(--pwa-surface);
    border-radius: 16px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-logo {
    width: 160px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

.login-subtitle {
    font-size: 14px;
    color: var(--pwa-text-muted);
    margin-bottom: 24px;
}

.login-field {
    text-align: left;
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--pwa-text-muted);
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--pwa-bg);
    border: 1px solid var(--pwa-border);
    border-radius: 10px;
    color: var(--pwa-text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.login-field input:focus {
    border-color: var(--pwa-primary);
}

.login-field input::placeholder {
    color: var(--pwa-text-muted);
    opacity: 0.6;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--pwa-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.login-btn:hover {
    background: var(--pwa-primary-hover);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-error {
    color: var(--pwa-danger);
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

/* ── App Shell ── */

#app-shell {
    display: none;
    flex-direction: column;
    position: fixed;
    inset: 0;
    overflow: hidden;
}

#app-shell.active {
    display: flex;
}

/* ── Header ── */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--pwa-header-height);
    padding: 0 12px;
    padding-top: var(--safe-top);
    background: var(--pwa-surface);
    border-bottom: 1px solid var(--pwa-border);
    flex-shrink: 0;
}

.app-header h1 {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.header-menu-btn,
.header-profile-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--pwa-text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.header-menu-btn svg,
.header-profile-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-menu-btn:hover,
.header-profile-btn:hover {
    color: var(--pwa-text);
    background: var(--pwa-surface-hover);
}

.header-profile-btn.active {
    color: var(--pwa-primary);
}

/* ── Header Dropdown Menu ── */

.header-menu {
    position: absolute;
    top: var(--pwa-header-height);
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.header-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: var(--pwa-surface);
    border: none;
    border-bottom: 1px solid var(--pwa-border);
    color: var(--pwa-text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.header-menu-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--pwa-text-muted);
}

.header-menu-item:hover {
    background: var(--pwa-surface-hover);
}

/* ── Tab Content ── */

.tab-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--pwa-bg);
}

.tab-panel {
    display: none;
    height: 100%;
}

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

/* Widget Container */
.tab-panel bus-widget,
.tab-panel helpers-widget,
.tab-panel kinderhaes-widget,
.tab-panel events-widget {
    display: block;
    width: 100%;
    min-height: 100%;
    padding: 12px 16px;
}

.tab-panel bus-widget[headless] {
    display: none;
}

/* ── Profil-Tab ── */

.profile-content {
    padding: 24px 16px;
}

.profile-card {
    background: var(--pwa-surface);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.profile-card h2 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--pwa-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--pwa-border);
    font-size: 15px;
}

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

.profile-info-label {
    color: var(--pwa-text-muted);
}

.profile-info-value {
    font-weight: 500;
}

.profile-btn {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-btn-push {
    background: var(--pwa-primary);
    color: #fff;
}

.profile-btn-push:hover {
    background: var(--pwa-primary-hover);
}

.profile-btn-push.subscribed {
    background: var(--pwa-surface-hover);
    color: var(--pwa-text);
}

.profile-btn-push:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-btn-logout {
    background: transparent;
    color: var(--pwa-danger);
    border: 1px solid var(--pwa-danger);
    margin-top: 24px;
}

.profile-btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.push-status {
    font-size: 13px;
    color: var(--pwa-text-muted);
    text-align: center;
    margin-top: 8px;
}

.push-status.active {
    color: var(--pwa-success);
}

/* ── Dashboard ── */

.dashboard-content {
    padding: 24px 16px;
}

.dash-greeting {
    margin-bottom: 28px;
}

.dash-hello {
    font-size: 24px;
    font-weight: 700;
}

.dash-sub {
    font-size: 14px;
    color: var(--pwa-text-muted);
    margin-top: 4px;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dash-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--pwa-surface);
    border: 1px solid var(--pwa-border);
    border-radius: 14px;
    padding: 24px 16px;
    color: var(--pwa-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.dash-card svg {
    width: 32px;
    height: 32px;
    stroke: var(--pwa-primary);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dash-card:hover {
    background: var(--pwa-surface-hover);
    border-color: var(--pwa-primary);
}

/* ── Bottom Tab Bar ── */

.tab-bar {
    display: flex;
    align-items: flex-end;
    background: var(--pwa-surface);
    border-top: 1px solid var(--pwa-border);
    min-height: var(--pwa-tab-height);
    padding-bottom: 8px;
    flex-shrink: 0;
    position: relative;
}

.tab-bar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 100px;
    background: inherit;
}

.tab-bar-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--pwa-text-muted);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    padding: 8px 0;
    height: 100%;
    -webkit-tap-highlight-color: transparent;
}

.tab-bar-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tab-bar-btn:hover {
    color: var(--pwa-text);
}

/* ── Home Button (erhoeht, rund, mittig) ── */

.tab-bar-home {
    position: relative;
    justify-content: flex-start;
    padding: 0;
}

.tab-home-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #03004f;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 -2px 12px rgba(3, 0, 79, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.tab-home-circle svg {
    width: 28px;
    height: 28px;
    stroke: #94a3b8;
    stroke-width: 2;
    transition: stroke 0.2s;
}

.tab-bar-home.active .tab-home-circle svg {
    stroke: #ffd500;
}

.tab-bar-btn.active {
    color: #ffd500;
}

.tab-bar-home.active .tab-home-circle {
    box-shadow: none;
}

.tab-bar-home:hover .tab-home-circle {
    transform: translateX(-50%) scale(1.05);
}

/* ── Toast ── */

.pwa-toast {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 47px));
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--pwa-surface);
    color: var(--pwa-text);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    z-index: 9999;
    max-width: calc(100% - 32px);
    text-align: center;
    border: 1px solid var(--pwa-border);
}

.pwa-toast.show {
    transform: translateX(-50%) translateY(0);
}

.pwa-toast.error {
    border-color: var(--pwa-danger);
}

.pwa-toast.success {
    border-color: var(--pwa-success);
}

/* ── Responsive Desktop ── */

@media (min-width: 600px) {
    #login-screen,
    #app-shell {
        max-width: 430px;
        margin: 0 auto;
        border-left: 1px solid var(--pwa-border);
        border-right: 1px solid var(--pwa-border);
    }
}

/* ── Splash / Loading ── */

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

.loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--pwa-border);
    border-top-color: var(--pwa-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ── Confirm Dialog Overlay ── */

.pwa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
}

.pwa-dialog {
    background: var(--pwa-surface);
    border-radius: 14px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}

.pwa-dialog h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}

.pwa-dialog p {
    font-size: 14px;
    color: var(--pwa-text-muted);
    margin-bottom: 20px;
    line-height: 1.4;
}

.pwa-dialog-actions {
    display: flex;
    gap: 12px;
}

.pwa-dialog-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.pwa-dialog-cancel {
    background: var(--pwa-surface-hover);
    color: var(--pwa-text);
}

.pwa-dialog-confirm {
    background: var(--pwa-danger);
    color: #fff;
}

/* ── Install Banner ── */

.install-banner {
    position: fixed;
    bottom: calc(var(--pwa-tab-height) + var(--safe-bottom) + 8px);
    left: 0;
    right: 0;
    z-index: 9000;
    padding: 0 12px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.install-banner.show {
    transform: translateY(0);
    pointer-events: auto;
}

.install-banner-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--pwa-surface);
    border: 1px solid var(--pwa-border);
    border-radius: 16px;
    padding: 14px 16px;
    padding-right: 32px;
    max-width: 430px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.install-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    color: var(--pwa-text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    -webkit-tap-highlight-color: transparent;
}

.install-icon {
    flex-shrink: 0;
}

.install-icon img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.install-text {
    flex: 1;
    min-width: 0;
}

.install-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--pwa-text);
    margin-bottom: 2px;
}

.install-desc {
    font-size: 13px;
    color: var(--pwa-text-muted);
    line-height: 1.4;
}

.install-desc strong {
    color: var(--pwa-text);
}

.install-share-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    stroke: var(--pwa-primary);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.install-btn {
    flex-shrink: 0;
    background: var(--pwa-primary);
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s;
}

.install-btn:hover {
    opacity: 0.85;
}

@media (min-width: 600px) {
    .install-banner {
        padding-left: calc(50% - 215px);
        padding-right: calc(50% - 215px);
    }
}

/* ── Offline Banner ── */

.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc2626;
    color: #fff;
    padding: 8px 16px;
    padding-top: calc(8px + var(--safe-top));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9500;
}

.offline-banner svg {
    flex-shrink: 0;
}

/* ── Bus Tab (Headless Widget UI) ── */

.bus-content {
    padding: 12px 16px;
}

/* Loading / Empty / Error */
.bus-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.bus-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--pwa-text-muted);
    font-size: 14px;
}

.bus-error-box {
    text-align: center;
    padding: 2rem 1rem;
}

.bus-error-box p {
    color: var(--pwa-danger);
    margin-bottom: 1rem;
    font-size: 14px;
}

/* Buttons */
.bus-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.bus-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bus-btn-primary {
    background: var(--pwa-primary);
    color: #fff;
}

.bus-btn-primary:hover:not(:disabled) {
    background: var(--pwa-primary-hover);
}

.bus-btn-full {
    width: 100%;
}

.bus-spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* Trip Grid (Overview) */
.bus-trip-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.bus-trip-card {
    background: var(--pwa-surface);
    border: 1px solid var(--pwa-border);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.bus-trip-card:hover {
    border-color: var(--pwa-primary);
}

.bus-trip-card:active {
    background: var(--pwa-surface-hover);
}

.bus-trip-card.bus-trip-booked {
    border-left: 3px solid var(--pwa-primary);
}

.bus-trip-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.bus-trip-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--pwa-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.bus-trip-header h3 .bus-icon {
    color: var(--pwa-primary);
}

.bus-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--pwa-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.bus-trip-info {
    font-size: 13px;
    color: var(--pwa-text-muted);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bus-trip-stops {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bus-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    color: var(--pwa-text-muted);
}

.bus-icon svg {
    display: block;
}

.bus-trip-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bus-seats {
    flex: 1;
}

.bus-seats-text {
    font-size: 11px;
    color: var(--pwa-text-muted);
}

.bus-progress {
    height: 5px;
    background: var(--pwa-border);
    border-radius: 3px;
    margin-bottom: 3px;
    overflow: hidden;
}

.bus-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
    background: var(--pwa-primary);
    opacity: 0.6;
}

.bus-booked-badge {
    font-size: 12px;
    color: var(--pwa-primary);
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.bus-closed-badge {
    font-size: 11px;
    color: var(--pwa-text-muted);
    white-space: nowrap;
}

.bus-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 4px;
}

.bus-divider::before,
.bus-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--pwa-border);
}

.bus-divider span {
    font-size: 11px;
    font-weight: 500;
    color: var(--pwa-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.bus-trip-card.bus-trip-past {
    opacity: 0.5;
}

/* Detail View */
.bus-back-btn {
    background: none;
    border: none;
    color: var(--pwa-primary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
    margin-bottom: 10px;
    -webkit-tap-highlight-color: transparent;
}

.bus-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.bus-detail-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.bus-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
    align-items: stretch;
}

@media (max-width: 520px) {
    .bus-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* My Bookings (Cart) */
.bus-my-bookings {
    background: var(--pwa-surface);
    border: 1px solid var(--pwa-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bus-cart-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--pwa-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--pwa-text);
}

.bus-cart-header .bus-icon {
    color: var(--pwa-success);
}

.bus-cart-count {
    background: var(--pwa-success);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    margin-left: auto;
}

.bus-cart-items {
    flex: 1;
}

.bus-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--pwa-border);
}

.bus-cart-item:last-child {
    border-bottom: none;
}

.bus-cart-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.bus-cart-item-left .bus-icon {
    color: var(--pwa-success);
}

.bus-cart-item-name {
    font-size: 14px;
    color: var(--pwa-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bus-cart-item-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--pwa-text);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.bus-cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--pwa-surface-hover);
    border-top: 1px solid var(--pwa-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--pwa-text);
}

.bus-cart-footer-total {
    font-size: 16px;
    color: var(--pwa-primary);
    font-variant-numeric: tabular-nums;
}

/* Info Card */
.bus-info-card {
    background: var(--pwa-surface);
    border: 1px solid var(--pwa-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bus-detail-grid .bus-info-card {
    height: 100%;
}

.bus-info-card-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pwa-text-muted);
    padding: 10px 14px 6px;
}

.bus-info-card-body {
    padding: 0 14px 12px;
}

.bus-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--pwa-text);
}

.bus-info-text {
    font-size: 12px;
    margin-top: 8px;
    padding: 8px;
    background: var(--pwa-bg);
    border-radius: 8px;
    color: var(--pwa-text-muted);
    line-height: 1.4;
}

/* Stops */
.bus-stops-compact {
    border-top: 1px solid var(--pwa-border);
    padding: 10px 14px 12px;
}

.bus-stops-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pwa-text-muted);
    margin-bottom: 8px;
}

.bus-stop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.bus-stop-timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 12px;
    flex-shrink: 0;
}

.bus-stop-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pwa-text-muted);
    flex-shrink: 0;
    z-index: 1;
}

.bus-stop-dot.bus-stop-first {
    background: var(--pwa-success);
    width: 10px;
    height: 10px;
}

.bus-stop-dot.bus-stop-last {
    background: var(--pwa-primary);
    width: 10px;
    height: 10px;
}

.bus-stop-line {
    width: 2px;
    height: 16px;
    background: var(--pwa-border);
}

.bus-stop-name {
    flex: 1;
    font-weight: 500;
    color: var(--pwa-text);
}

.bus-stop-time {
    color: var(--pwa-text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* Booking Area (Passenger Select + Payment) */
.bus-booking-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
}

@media (max-width: 520px) {
    .bus-booking-area {
        grid-template-columns: 1fr;
    }
}

.bus-booking-left {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.bus-booking-right {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.bus-passenger-select {
    background: var(--pwa-surface);
    border: 1px solid var(--pwa-border);
    border-radius: 12px;
    padding: 14px;
    flex: 1;
}

.bus-passenger-select h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--pwa-text);
}

.bus-help {
    font-size: 13px;
    color: var(--pwa-text-muted);
    margin-bottom: 10px;
}

.bus-passenger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--pwa-border);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--pwa-text);
    transition: background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.bus-passenger:hover {
    background: var(--pwa-surface-hover);
}

.bus-passenger.bus-selected {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--pwa-primary);
}

.bus-passenger.bus-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bus-passenger.bus-blocked {
    border-color: #ea580c;
    background: rgba(234, 88, 12, 0.08);
}

.bus-blocked-hint {
    font-size: 11px;
    color: #ea580c;
    font-weight: 500;
    white-space: nowrap;
}

.bus-passenger input[type="checkbox"] {
    accent-color: var(--pwa-primary);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.bus-passenger-name {
    flex: 1;
}

.bus-passenger-price {
    font-weight: 600;
    font-size: 13px;
    color: var(--pwa-text-muted);
    white-space: nowrap;
}

.bus-passenger.bus-selected .bus-passenger-price {
    color: var(--pwa-primary);
}

.bus-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 2px solid var(--pwa-border);
    color: var(--pwa-text);
}

.bus-cart-total-price {
    font-size: 17px;
    color: var(--pwa-primary);
}

@media (max-width: 520px) {
    .bus-cart-total {
        display: none;
    }
}

/* Payment Card */
.bus-payment-card {
    background: var(--pwa-surface);
    border: 1px solid var(--pwa-border);
    border-radius: 12px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bus-payment-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.bus-payment-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pwa-border);
    color: var(--pwa-text);
}

.bus-payment-total {
    font-weight: 700;
    font-size: 17px;
    color: var(--pwa-primary);
}

.bus-paypal-container {
    min-height: 50px;
}

/* Closed Info */
.bus-closed-info {
    text-align: center;
    padding: 14px;
    color: var(--pwa-text-muted);
    font-size: 14px;
    background: var(--pwa-surface);
    border-radius: 12px;
    margin-bottom: 14px;
    border: 1px solid var(--pwa-border);
}

/* Bus Seat Visualization */
.bus-seat-section {
    margin-top: 20px;
    margin-bottom: 14px;
}

.bus-seat-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--pwa-text);
    margin-bottom: 10px;
}

.bus-bus-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--pwa-text);
    margin: 14px 0 8px;
    text-align: center;
}

.bus-bus {
    max-width: 380px;
    margin: 0 auto 14px;
    position: relative;
    padding: 0 8px;
}

.bus-wheel {
    position: absolute;
    width: 10px;
    height: 90px;
    background: #555;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.bus-wh-fl { left: -1px; top: 150px; }
.bus-wh-fr { right: -1px; top: 150px; }
.bus-wh-rl1 { left: -1px; bottom: 180px; }
.bus-wh-rr1 { right: -1px; bottom: 180px; }
.bus-wh-rl2 { left: -1px; bottom: 75px; }
.bus-wh-rr2 { right: -1px; bottom: 75px; }

.bus-bus-windshield {
    background: linear-gradient(180deg, #1a3a4a 0%, #243e4f 100%);
    border-radius: 2.5rem 2.5rem 0 0;
    padding: 12px 24px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #334155;
    border-bottom: none;
    position: relative;
}

.bus-bus-type-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pwa-text-muted);
}

.bus-headlight {
    width: 14px;
    height: 8px;
    border-radius: 3px;
    background: linear-gradient(180deg, #fff9c4 0%, #ffeb3b 100%);
    border: 1px solid #c9a800;
    box-shadow: 0 0 4px rgba(255, 235, 59, 0.4);
    position: absolute;
    bottom: 4px;
}

.bus-hl-l { left: 12px; }
.bus-hl-r { right: 12px; }

.bus-bus-driver-row {
    display: flex;
    position: relative;
    padding: 0 0 6px;
    margin-bottom: 6px;
    border-bottom: 1px dashed #475569;
}

.bus-driver-seat {
    width: calc((100% - 18px - 15px) / 4);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bus-driver-wheel {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pwa-text-muted);
    padding: 4px;
}

.bus-driver-wheel svg {
    width: 100%;
    height: 100%;
    stroke-width: 2.5;
}

.bus-driver-seatback {
    width: 80%;
    height: 20px;
    background: #475569;
    border-radius: 2px 2px 6px 6px;
    opacity: 0.5;
    margin-top: -4px;
}

.bus-stairwell {
    position: absolute;
    right: 0;
    top: 6px;
    bottom: 10px;
    width: calc((100% - 18px) / 4 + 5px);
    border: 1px solid #475569;
    border-right: none;
    border-radius: 3px 0 0 3px;
    display: flex;
    gap: 0;
    background: rgba(51, 65, 85, 0.5);
}

.bus-stair-step {
    flex: 1;
    border-right: 1px solid #475569;
}

.bus-stair-step:last-child {
    border-right: none;
}

.bus-bus-body {
    background: var(--pwa-surface);
    border-left: 2px solid #334155;
    border-right: 2px solid #334155;
    padding: 8px 10px;
}

.bus-bus-rear {
    background: #334155;
    border-radius: 0 0 0.75rem 0.75rem;
    height: 14px;
    border: 2px solid #334155;
    border-top: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.bus-taillight {
    width: 14px;
    height: 6px;
    border-radius: 2px;
    background: linear-gradient(180deg, #ef5350 0%, #c62828 100%);
    border: 1px solid #a11;
    box-shadow: 0 0 3px rgba(239, 83, 80, 0.4);
}

.bus-bus-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 18px 1fr 1fr;
    gap: 5px;
}

.bus-bus-aisle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bus-bus-aisle span {
    font-size: 8px;
    color: var(--pwa-text-muted);
    font-weight: 600;
    opacity: 0.4;
}

.bus-bus-lastrow {
    display: grid;
    gap: 5px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #475569;
}

.bus-seat {
    aspect-ratio: 1;
    border-radius: 6px 6px 4px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3px 2px;
    cursor: default;
    text-align: center;
    overflow: hidden;
    position: relative;
    border-top: 3px solid transparent;
}

.bus-seat-taken {
    background: #3b5998;
    color: #fff;
    border-top-color: #2d4373;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.bus-seat-free {
    background: #334155;
    border-top-color: #475569;
}

.bus-seat-needs-helper {
    background: #ea580c !important;
    border-top-color: #c2410c !important;
}

.bus-seat-empty {
    visibility: hidden;
    aspect-ratio: 1;
}

.bus-seat-num {
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.4;
}

.bus-seat-taken .bus-seat-num {
    opacity: 0.5;
}

.bus-seat-free .bus-seat-num {
    font-size: 14px;
    font-weight: 700;
    opacity: 0.3;
    color: var(--pwa-text-muted);
}

.bus-seat-first {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.bus-seat-last {
    font-size: 9px;
    font-weight: 500;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    opacity: 0.85;
}

/* Helper Duty Legend */
.bus-helper-legend {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--pwa-border);
    border-radius: 12px;
    background: var(--pwa-surface);
}

.bus-helper-legend-bar {
    height: 8px;
    border-radius: 4px;
}

.bus-helper-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--pwa-text-muted);
    margin-top: 3px;
    font-weight: 500;
}

.bus-helper-legend-text {
    font-size: 11px;
    color: var(--pwa-text-muted);
    margin-top: 6px;
    line-height: 1.35;
}

/* Success View */
.bus-success {
    text-align: center;
    padding: 2rem 1rem;
}

.bus-success-icon {
    margin-bottom: 8px;
    color: var(--pwa-success);
}

.bus-success h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--pwa-text);
}

.bus-success p {
    color: var(--pwa-text-muted);
    margin-bottom: 16px;
    font-size: 14px;
}

.bus-success-list {
    background: var(--pwa-surface);
    border: 1px solid var(--pwa-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    text-align: left;
}

.bus-booking-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--pwa-text);
}

.bus-booking-item + .bus-booking-item {
    border-top: 1px solid var(--pwa-border);
}

