/**
 * ÖPNV Navigator PWA Styles
 *
 * Standalone app styles with custom navigation
 * (not using GenussBikeTemplate)
 *
 * @version 1.0
 */

/* CSS Variables */
:root {
    --app-primary: #FFD500;
    --app-primary-dark: #e6c000;
    --app-dark: #1a1a2e;
    --app-dark-light: #16213e;
    --app-text: #333;
    --app-text-light: #666;
    --app-bg: #f5f5f5;
    --app-white: #ffffff;
    --app-border: #e0e0e0;
    --app-tram: #FFD500;
    --app-sbahn: #006F35;
    --app-train: #C4151C;
    --app-bus: #9C27B0;
    --app-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --app-bar-height: 56px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
    overflow: hidden;
    height: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* App Bar */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--app-bar-height) + var(--safe-area-top));
    padding-top: var(--safe-area-top);
    background: var(--app-dark);
    display: flex;
    align-items: center;
    padding-left: 8px;
    padding-right: 8px;
    z-index: 1000;
    box-shadow: var(--app-shadow);
}

.menu-toggle,
.location-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.menu-toggle:hover,
.location-btn:hover {
    background: rgba(255,255,255,0.1);
}

.location-btn.locating {
    animation: pulse 1.5s infinite;
}

.app-title {
    flex: 1;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    text-align: center;
}

.app-title i {
    color: var(--app-primary);
    margin-right: 0.5rem;
}

/* App Bar Actions (right side buttons) */
.app-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.app-bar-actions .routing-btn,
.app-bar-actions .location-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.app-bar-actions .routing-btn:hover,
.app-bar-actions .location-btn:hover {
    background: rgba(255,255,255,0.1);
}

.app-bar-actions .routing-btn {
    color: var(--app-primary);
}

/* Navigation Drawer */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--app-white);
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-area-top);
    overflow: hidden; /* Prevent drawer from scrolling as whole */
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--app-dark);
    color: white;
    gap: 0.75rem;
    flex-shrink: 0; /* Don't shrink header */
}

.drawer-logo {
    height: 32px;
    width: auto;
}

.drawer-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
}

.drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Important: allows flex item to shrink and scroll */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.drawer-menu li a {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--app-text);
    text-decoration: none;
    transition: background-color 0.2s;
    gap: 0.75rem;
}

.drawer-menu li a:hover {
    background: var(--app-bg);
}

.drawer-menu li a i {
    width: 24px;
    text-align: center;
    color: var(--app-text-light);
}

.drawer-menu .external-icon {
    margin-left: auto;
    font-size: 0.75rem;
    opacity: 0.5;
}

.drawer-menu .divider {
    height: 1px;
    background: var(--app-border);
    margin: 0.5rem 0;
}

.drawer-menu .menu-section {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--app-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.drawer-menu .badge {
    font-size: 0.65rem;
    background: var(--app-primary);
    color: var(--app-dark);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto;
}

.drawer-footer {
    padding: 0.75rem 1rem;
    text-align: center;
    color: var(--app-text-light);
    border-top: 1px solid var(--app-border);
    flex-shrink: 0; /* Don't shrink footer */
    font-size: 0.75rem;
}

/* Small screens: compact drawer menu items */
@media (max-height: 600px) {
    .drawer-header {
        padding: 0.5rem 0.75rem;
    }

    .drawer-logo {
        height: 24px;
    }

    .drawer-title {
        font-size: 0.9rem;
    }

    .drawer-menu li a {
        padding: 0.65rem 0.875rem;
        font-size: 0.9rem;
    }

    .drawer-menu .divider {
        margin: 0.25rem 0;
    }

    .drawer-menu .menu-section {
        padding: 0.35rem 0.875rem;
        font-size: 0.7rem;
    }

    .drawer-footer {
        padding: 0.5rem 0.75rem;
        font-size: 0.7rem;
    }
}

/* Very small screens: even more compact */
@media (max-height: 500px) {
    .drawer-header {
        padding: 0.4rem 0.75rem;
    }

    .drawer-menu li a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .drawer-menu .menu-section {
        padding: 0.25rem 0.75rem;
    }

    .drawer-footer {
        padding: 0.35rem 0.5rem;
    }
}

/* Main Content */
.app-main {
    position: fixed;
    top: calc(var(--app-bar-height) + var(--safe-area-top));
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Controls Bar */
.controls-bar {
    background: var(--app-white);
    padding: 0.75rem 1rem;
    box-shadow: var(--app-shadow);
    z-index: 500;
    position: relative;
}

/* Filter Toggle Button (integrated in search bar) */
.filter-toggle-btn {
    position: absolute;
    right: 8px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--app-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-light);
    font-size: 0.9rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-toggle-btn:hover {
    background: var(--app-border);
    color: var(--app-text);
}

.filter-toggle-btn.active {
    background: var(--app-primary);
    color: var(--app-dark);
}

/* Filter Dropdown */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--app-white);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    z-index: 1200;
    animation: dropdownSlide 0.2s ease-out;
}

.filter-dropdown[hidden] {
    display: none;
}

@keyframes dropdownSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.filter-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--app-border);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--app-text);
}

.filter-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--app-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-light);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.filter-close-btn:hover {
    background: var(--app-border);
    color: var(--app-text);
}

.filter-dropdown-body {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-dropdown-body .radius-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-dropdown-body .category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.radius-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radius-control label {
    font-weight: 500;
    color: var(--app-text-light);
    font-size: 0.875rem;
}

.form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--app-white);
    cursor: pointer;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 0.75rem;
    z-index: 1100;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--app-text-light);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 5.5rem 0.7rem 2.5rem;
    border: 1px solid var(--app-border);
    border-radius: 25px;
    font-size: 0.95rem;
    background: var(--app-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.2);
}

.search-input::placeholder {
    color: #999;
}

.search-clear {
    position: absolute;
    right: 50px; /* Positioned before filter button */
    width: 28px;
    height: 28px;
    border: none;
    background: var(--app-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-light);
    transition: background-color 0.2s;
}

.search-clear:hover {
    background: var(--app-border);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--app-white);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    max-height: 60vh;
    overflow-y: auto;
    z-index: 9999;
    margin-top: 4px;
}

.search-results[hidden] {
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid var(--app-bg);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--app-bg);
}

.search-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.search-result-icon.tram {
    background: #fff3cd;
    color: #B8860B;
}

.search-result-icon.sbahn {
    background: #e8f5e9;
    color: var(--app-sbahn);
}

.search-result-icon.train {
    background: #ffe5e5;
    color: var(--app-train);
}

.search-result-icon.bus {
    background: #f3e5f5;
    color: var(--app-bus);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-category {
    font-size: 0.75rem;
    color: var(--app-text-light);
    margin-top: 2px;
}

.search-result-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.2rem;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--app-text-light);
}

.search-loading {
    padding: 1rem;
    text-align: center;
    color: var(--app-text-light);
}

.category-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 20px;
    border: 1px solid var(--app-border);
    transition: all 0.2s;
    font-size: 0.8rem;
}

.filter-checkbox:hover {
    background: var(--app-bg);
}

.filter-checkbox input {
    display: none;
}

.filter-checkbox .checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid var(--app-border);
    border-radius: 3px;
    position: relative;
    transition: all 0.2s;
}

.filter-checkbox input:checked + .checkmark.tram {
    background: #B8860B;
    border-color: #B8860B;
}

.filter-checkbox input:checked + .checkmark.sbahn {
    background: var(--app-sbahn);
    border-color: var(--app-sbahn);
}

.filter-checkbox input:checked + .checkmark.train {
    background: var(--app-train);
    border-color: var(--app-train);
}

.filter-checkbox input:checked + .checkmark.bus {
    background: var(--app-bus);
    border-color: var(--app-bus);
}

.filter-checkbox input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox i.fa-train-tram { color: #B8860B; }
.filter-checkbox i.fa-train-subway { color: var(--app-sbahn); }
.filter-checkbox i.fa-train { color: var(--app-train); }

.filter-label {
    display: none;
}

@media (min-width: 400px) {
    .filter-label {
        display: inline;
    }
}

/* Status Message */
.status-message {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    display: none;
}

.status-message.info {
    display: block;
    background: #e3f2fd;
    color: #1565c0;
}

.status-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
}

.status-message.error {
    display: block;
    background: #ffebee;
    color: #c62828;
}

/* Map */
#navigator-map {
    flex: 1;
    min-height: 200px;
}

/* Stops Panel */
.stops-panel {
    position: absolute;
    bottom: var(--safe-area-bottom);
    left: 0;
    right: 0;
    background: var(--app-white);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    max-height: 55vh;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.3s ease;
    z-index: 500;
}

.stops-panel.expanded {
    transform: translateY(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
}

.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.btn-toggle {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--app-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.stops-panel.expanded .btn-toggle {
    transform: rotate(180deg);
}

.stops-list {
    padding: 0 1rem 1rem;
    max-height: calc(55vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.placeholder-text {
    text-align: center;
    color: var(--app-text-light);
    padding: 2rem 1rem;
    line-height: 1.6;
}

.placeholder-text > i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    opacity: 0.5;
}

.placeholder-text p {
    margin: 0.5rem 0;
}

.placeholder-hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Main Locate Button */
.btn-locate-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--app-primary);
    color: #333;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin: 1rem 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(255, 213, 0, 0.3);
}

.btn-locate-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 213, 0, 0.4);
}

.btn-locate-main:active {
    transform: translateY(0);
}

.btn-locate-main i {
    font-size: 1.1rem;
}

/* Stop Cards */
.stop-card {
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: var(--app-bg);
    overflow: hidden;
    transition: all 0.2s;
}

.stop-card.expanded {
    background: var(--app-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stop-card-header {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
}

.stop-card.expanded .stop-card-header {
    border-bottom: 1px solid var(--app-border);
}

.stop-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1rem;
}

.stop-icon.tram {
    background: #fff3cd;
    color: #B8860B;
}

.stop-icon.sbahn {
    background: #e8f5e9;
    color: var(--app-sbahn);
}

.stop-icon.train {
    background: #ffe5e5;
    color: var(--app-train);
}

.stop-icon.bus {
    background: #f3e5f5;
    color: var(--app-bus);
}

.stop-info {
    flex: 1;
    min-width: 0;
}

.stop-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stop-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.line-badge {
    display: inline-block;
    background: #f5f5f5;
    border: 2px solid var(--app-primary);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--app-text);
}

.line-badge.tram {
    border-color: #B8860B;
    background: #fff3cd;
    color: #B8860B;
}

.line-badge.sbahn {
    border-color: var(--app-sbahn);
    background: #e8f5e9;
    color: var(--app-sbahn);
}

.line-badge.train {
    border-color: var(--app-train);
    background: #ffe5e5;
    color: var(--app-train);
}

.line-badge.bus {
    border-color: var(--app-bus);
    background: #f3e5f5;
    color: var(--app-bus);
}

.stop-distance {
    font-size: 0.8rem;
    color: var(--app-text-light);
    font-weight: 500;
    margin-left: 0.25rem;
    white-space: nowrap;
}

.stop-departures-label {
    font-size: 0.85rem;
    color: var(--app-text-light);
    margin-left: auto;
    margin-right: 0.35rem;
    white-space: nowrap;
}

.stop-expand-icon {
    color: var(--app-text-light);
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.stop-card.expanded .stop-expand-icon {
    transform: rotate(180deg);
}

/* Departures */
.stop-departures {
    display: none;
    padding: 0.75rem;
    background: var(--app-white);
}

.stop-card.expanded .stop-departures {
    display: block;
}

.departures-loading {
    text-align: center;
    padding: 1rem;
    color: var(--app-text-light);
}

.departures-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.departure-row {
    display: flex;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--app-bg);
}

.departure-row:last-child {
    border-bottom: none;
}

.departure-line {
    min-width: 40px;
    text-align: center;
}

.departure-destination {
    flex: 1;
    font-size: 0.85rem;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.departure-scheduled {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

.departure-scheduled .delay-indicator {
    color: #dc3545;
    font-weight: 600;
}

.departure-scheduled .delay-indicator.early {
    color: #28a745;
}

.departure-time {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

.departure-time.soon { color: #dc3545; }
.departure-time.arriving {
    color: #28a745;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.departures-empty,
.departures-error {
    text-align: center;
    padding: 0.75rem;
    font-size: 0.85rem;
    color: var(--app-text-light);
}

.departures-error {
    color: #dc3545;
    background: #fff5f5;
    border-radius: 4px;
}

.stop-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--app-border);
}

.stop-action-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--app-border);
    border-radius: 6px;
    background: transparent;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--app-text);
    transition: all 0.2s;
}

.stop-action-btn:hover {
    background: var(--app-bg);
}

.stop-action-btn.favorite.active {
    background: #fff3cd;
    border-color: var(--app-primary);
    color: var(--app-tram);
}

.stop-action-btn.favorite.active i {
    color: var(--app-primary);
}

/* POI Modal */
.poi-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.poi-modal[hidden] {
    display: none;
}

.poi-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.poi-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    background: var(--app-white);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.poi-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--app-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.poi-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 85vh;
}

/* POI Modal Content */
.poi-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.poi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.poi-icon.tram {
    background: #fff3cd;
    color: #B8860B;
}

.poi-icon.sbahn {
    background: #e8f5e9;
    color: var(--app-sbahn);
}

.poi-icon.train {
    background: #ffe5e5;
    color: var(--app-train);
}

.poi-title h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.poi-category {
    font-size: 0.85rem;
    color: var(--app-text-light);
}

.poi-region {
    font-size: 0.75rem;
    color: var(--app-text-light);
    display: block;
    margin-top: 0.25rem;
}

.poi-departures {
    background: var(--app-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.poi-departures h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.departures-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.departure-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--app-white);
    border-radius: 8px;
}

.departure-row .departure-line {
    flex-shrink: 0;
}

.departure-row .departure-direction {
    flex: 1;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.departure-row .departure-time {
    font-weight: 600;
    white-space: nowrap;
}

.departure-row .departure-time.delayed {
    color: #dc3545;
}

.departure-row .departure-time .delay {
    font-size: 0.75rem;
    margin-left: 0.25rem;
    color: #dc3545;
}

.departures-loading,
.departures-empty,
.departures-error {
    text-align: center;
    padding: 1rem;
    color: var(--app-text-light);
}

.departures-error {
    color: #dc3545;
}

.poi-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.poi-action-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-white);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.poi-action-btn.primary {
    background: var(--app-primary);
    border-color: var(--app-primary);
    font-weight: 600;
}

.poi-routing-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.poi-routing-actions .poi-action-btn {
    flex: 1;
}

.poi-rating-section {
    background: var(--app-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.poi-rating-section h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rating-display .stars {
    color: #ffc107;
}

.rating-display .rating-value {
    font-weight: 600;
}

.rating-display .rating-count {
    color: var(--app-text-light);
    font-size: 0.85rem;
}

.no-rating {
    color: var(--app-text-light);
    font-style: italic;
    margin: 0 0 0.75rem 0;
}

.poi-rating-form {
    background: var(--app-white);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.poi-rating-form h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
}

.star-rating {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #ddd;
    padding: 0;
}

.star-btn.active,
.star-btn:hover {
    color: #ffc107;
}

.poi-rating-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    margin-bottom: 0.75rem;
}

.rating-actions {
    display: flex;
    gap: 0.5rem;
}

.poi-loading,
.poi-error {
    text-align: center;
    padding: 2rem;
}

.poi-error {
    color: #dc3545;
}

/* Favorites Panel */
.favorites-panel {
    position: fixed;
    top: calc(var(--app-bar-height) + var(--safe-area-top));
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 90vw;
    background: var(--app-white);
    z-index: 1500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.favorites-panel:not([hidden]) {
    transform: translateX(0);
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--app-border);
}

.favorites-header h3 {
    margin: 0;
    font-size: 1rem;
}

.favorites-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.25rem;
}

.favorites-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.favorites-login-prompt {
    text-align: center;
    padding: 2rem 1rem;
}

.favorites-login-prompt i {
    font-size: 3rem;
    color: var(--app-text-light);
    margin-bottom: 1rem;
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: calc(var(--app-bar-height) + var(--safe-area-top));
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 90vw;
    background: var(--app-white);
    z-index: 1500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
}

.settings-panel:not([hidden]) {
    transform: translateX(0);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--app-border);
}

.settings-header h3 {
    margin: 0;
    font-size: 1rem;
}

.settings-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.25rem;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.setting-group {
    margin-bottom: 1.25rem;
}

.setting-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.setting-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.setting-toggle input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--app-border);
    border-radius: 12px;
    position: relative;
    transition: background-color 0.2s;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.setting-toggle input:checked + .toggle-slider {
    background: var(--app-train);
}

.setting-toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

/* Settings Section Divider & Title */
.settings-divider {
    height: 1px;
    background: var(--app-border);
    margin: 1.5rem 0;
}

.settings-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--app-text);
    margin: 0 0 1rem 0;
}

.settings-section-title i {
    color: var(--app-primary-dark);
}

/* Push Notification Status */
.push-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.push-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--app-border);
}

.push-status-indicator.active {
    background: #4CAF50;
}

.push-status-indicator.denied {
    background: #F44336;
}

.push-status-indicator.unsupported {
    background: #9E9E9E;
}

.push-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--app-primary);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.push-toggle-btn:hover {
    background: var(--app-primary-dark);
}

.push-toggle-btn.subscribed {
    background: var(--app-bg);
    border: 2px solid var(--app-border);
    color: var(--app-text);
}

.push-toggle-btn.subscribed:hover {
    background: var(--app-border);
}

.push-toggle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Trip Monitors List */
.setting-label .monitor-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--app-primary);
    color: var(--app-dark);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.monitors-list {
    background: var(--app-bg);
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}

.monitors-loading {
    padding: 2rem;
    text-align: center;
    color: var(--app-text-light);
    font-size: 0.9rem;
}

.monitors-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--app-text-light);
    font-size: 0.85rem;
}

.monitors-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.monitor-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    border-bottom: 1px solid var(--app-border);
}

.monitor-item.has-delay {
    border-left: 4px solid #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.monitor-item:last-child {
    border-bottom: none;
}

.monitor-item-icon {
    width: 36px;
    height: 36px;
    background: var(--app-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-dark);
    flex-shrink: 0;
}

.monitor-item-icon.reminder {
    background: #E3F2FD;
    color: #1976D2;
}

.monitor-item-icon.delay {
    background: #FFF3E0;
    color: #F57C00;
}

.monitor-item-content {
    flex: 1;
    min-width: 0;
}

.monitor-item-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.monitor-item-line .line-badge {
    padding: 0.125rem 0.5rem;
    background: var(--app-tram);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.monitor-item-route {
    font-size: 0.8rem;
    color: var(--app-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitor-item-schedule {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--app-text-light);
    margin-top: 0.25rem;
}

.monitor-item-actions {
    display: flex;
    gap: 0.25rem;
}

.monitor-item-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--app-text-light);
    transition: all 0.2s;
}

.monitor-item-btn:hover {
    background: var(--app-border);
    color: var(--app-text);
}

.monitor-item-btn.delete:hover {
    background: #FFEBEE;
    color: #D32F2F;
}

.monitors-refresh-btn {
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--app-bg);
    border: 1px solid var(--app-border);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--app-text);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.monitors-refresh-btn:hover {
    background: var(--app-border);
}

/* Offline Notice */
.offline-notice {
    position: fixed;
    bottom: calc(80px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: var(--app-dark);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    box-shadow: var(--app-shadow);
}

.offline-notice[hidden] {
    display: none;
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: calc(80px + var(--safe-area-bottom));
    left: 1rem;
    right: 1rem;
    z-index: 1000;
}

.install-prompt[hidden] {
    display: none;
}

.install-content {
    background: var(--app-dark);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--app-shadow);
}

.install-content i {
    color: var(--app-primary);
}

.install-content span {
    flex: 1;
    font-size: 0.85rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--app-primary);
    color: var(--app-dark);
}

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-dismiss {
    background: transparent;
    border: none;
    color: white;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

/* User Location Marker */
.user-location-container {
    position: relative;
}

.user-location-marker {
    background: #4285f4;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(66, 133, 244, 0.5);
}

.user-location-pulse {
    background: rgba(66, 133, 244, 0.3);
    border-radius: 50%;
    animation: location-pulse 2s infinite;
}

@keyframes location-pulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}

/* Loading */
.loading {
    text-align: center;
    padding: 1rem;
    color: var(--app-text-light);
}

/* Chatbot position adjustment for PWA */
.chatbot-container {
    bottom: calc(70px + var(--safe-area-bottom)) !important;
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .stops-panel {
        position: absolute;
        top: auto;
        bottom: 20px;
        left: 20px;
        right: auto;
        width: 380px;
        max-height: calc(100% - 40px);
        border-radius: 12px;
        transform: none;
    }

    .stops-panel.expanded {
        transform: none;
    }

    .panel-header {
        cursor: default;
    }

    .btn-toggle {
        display: none;
    }

    .stops-list {
        max-height: 400px;
    }

    .poi-modal {
        align-items: center;
    }

    .poi-modal-content {
        border-radius: 16px;
        max-width: 480px;
        max-height: 80vh;
    }
}

/* Small mobile */
@media (max-width: 360px) {
    .app-title {
        font-size: 1rem;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .category-filters {
        justify-content: center;
    }
}

/* =============================================
   Location Help Modal
   ============================================= */
.location-help-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.location-help-modal[hidden] {
    display: none;
}

.location-help-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.location-help-content {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    background: var(--app-white);
    border-radius: 16px;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.location-help-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--app-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.2s;
}

.location-help-close:hover {
    background: var(--app-border);
}

.location-help-header {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
    background: linear-gradient(135deg, #ffeb99 0%, var(--app-primary) 100%);
}

.location-help-header i {
    font-size: 2.5rem;
    color: var(--app-dark);
    margin-bottom: 0.5rem;
}

.location-help-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--app-dark);
}

.location-help-intro {
    text-align: center;
    padding: 1rem 1.5rem 0.5rem;
    color: var(--app-text-light);
    font-size: 0.9rem;
    margin: 0;
}

/* Tabs */
.location-help-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--app-border);
}

.location-help-tabs .tab-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--app-border);
    background: var(--app-white);
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
    color: var(--app-text-light);
}

.location-help-tabs .tab-btn:hover {
    background: var(--app-bg);
}

.location-help-tabs .tab-btn.active {
    background: var(--app-dark);
    color: white;
    border-color: var(--app-dark);
}

.location-help-tabs .tab-btn i {
    font-size: 0.9rem;
}

/* Tab Content */
.location-help-instructions {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    color: var(--app-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-content h4 i {
    color: var(--app-text-light);
}

.tab-content ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

.tab-content ol li {
    margin-bottom: 0.4rem;
}

.tab-content ol li strong {
    color: var(--app-dark);
}

.help-tip {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #1565c0;
}

.help-tip i {
    color: #ffc107;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Actions */
.location-help-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--app-border);
    background: var(--app-bg);
}

.location-help-actions .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.location-help-actions .btn-primary {
    background: var(--app-primary);
    color: var(--app-dark);
}

.location-help-actions .btn-primary:hover {
    background: var(--app-primary-dark);
}

.location-help-actions .btn-secondary {
    background: var(--app-white);
    border: 1px solid var(--app-border);
    color: var(--app-text);
}

.location-help-actions .btn-secondary:hover {
    background: var(--app-bg);
}

/* Mobile adjustments for modal */
@media (max-width: 400px) {
    .location-help-tabs .tab-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

    .location-help-tabs .tab-btn i {
        font-size: 0.8rem;
    }

    .location-help-content {
        max-height: 90vh;
    }

    .location-help-instructions {
        padding: 0.75rem 1rem;
    }
}

/* ============================================
   TRAM LINES STYLES
   ============================================ */

/* Lines Toggle Checkbox */
.filter-checkbox input:checked + .checkmark.lines {
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.filter-checkbox .checkmark.lines {
    border-color: var(--app-primary);
}

/* Highlighted Stop Marker Animation */
.highlighted-stop {
    animation: pulse-stop 1s ease-in-out infinite;
}

@keyframes pulse-stop {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Tram Line Popup Styles */
.tram-line-popup {
    min-width: 220px;
    padding: 0.25rem;
}

.tram-line-popup-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tram-line-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    border-radius: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.tram-line-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
}

.tram-line-route {
    font-size: 0.85rem;
    color: var(--app-text-light);
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--app-bg);
    border-radius: 4px;
}

.tram-line-route strong {
    color: var(--app-text);
}

.tram-line-takt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--app-text-light);
    margin-bottom: 0.5rem;
}

.tram-line-takt i {
    color: var(--app-primary-dark);
}

.tram-line-changes-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #d9534f;
    text-decoration: none;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--app-border);
    margin-bottom: 0.5rem;
}

.tram-line-changes-link:hover {
    color: #c9302c;
    text-decoration: underline;
}

.tram-line-changes-link i {
    font-size: 0.9rem;
}

.tram-line-highlight-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--app-primary);
    color: var(--app-dark);
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tram-line-highlight-btn:hover {
    background: var(--app-primary-dark);
}

.tram-line-highlight-btn i {
    font-size: 0.9rem;
}

/* Leaflet popup adjustments for tram lines */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 0.75rem;
}

/* Line layer z-index (below markers) */
.leaflet-overlay-pane svg path {
    pointer-events: stroke;
}

/* ============================================
   TRIP TRACKING STYLES
   ============================================ */

/* Track button in departure row */
.departure-row {
    position: relative;
}

.departure-track-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--app-primary);
    color: var(--app-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
    opacity: 0.8;
}

.departure-track-btn:hover {
    background: var(--app-primary-dark);
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.departure-track-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Adjust departure time when track button exists */
.departure-row:has(.departure-track-btn) .departure-time {
    margin-right: 36px;
}

/* Push enable button in departure row */
.departure-push-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--app-dark);
    color: var(--app-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
    opacity: 0.85;
}

.departure-push-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.departure-push-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* If both push and track buttons exist, push sits left of track */
.departure-row:has(.departure-track-btn) .departure-push-btn {
    right: 36px;
}

/* Adjust departure time spacing when push exists */
.departure-row:has(.departure-push-btn) .departure-time {
    margin-right: 36px;
}

/* If both exist, add combined spacing */
.departure-row:has(.departure-push-btn):has(.departure-track-btn) .departure-time {
    margin-right: 72px;
}

/* Quick Monitor Modal */
.quick-monitor-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 3000;
}
.quick-monitor-modal.show { display: block; }
.quick-monitor-modal .qm-backdrop {
    position: absolute; inset: 0; background: rgba(0,0,0,0.5);
}
.quick-monitor-modal .qm-card {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: 92%; max-width: 420px; background: #fff; border-radius: 10px; box-shadow: var(--app-shadow);
    overflow: hidden; font-family: inherit; color: var(--app-text);
}
.quick-monitor-modal .qm-header { background: var(--app-dark); color: #fff; padding: 10px 14px; font-weight: 600; }
.quick-monitor-modal .qm-header i { color: var(--app-primary); margin-right: 6px; }
.quick-monitor-modal .qm-body { padding: 12px 14px; }
.quick-monitor-modal .qm-row { display:flex; align-items:center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.quick-monitor-modal .qm-row label { display:flex; align-items:center; gap: 8px; font-weight: 600; }
.quick-monitor-modal .qm-input { display:flex; align-items:center; gap: 6px; }
.quick-monitor-modal .qm-input button { border:1px solid var(--app-border); background:#f8f8f8; border-radius:6px; padding:6px 8px; cursor:pointer; }
.quick-monitor-modal .qm-input button.active { background: var(--app-primary); border-color: var(--app-primary-dark); color: var(--app-dark); }
.quick-monitor-modal .qm-input input { width:56px; padding:5px 6px; border:1px solid var(--app-border); border-radius:6px; }
.quick-monitor-modal #qm-weekdays button { min-width: 36px; }
.quick-monitor-modal .qm-actions { display:flex; justify-content:flex-end; gap: 8px; padding: 10px 14px; border-top:1px solid var(--app-border); }
.quick-monitor-modal .qm-actions .qm-cancel { background:#eee; border:1px solid var(--app-border); border-radius:6px; padding:8px 12px; cursor:pointer; }
.quick-monitor-modal .qm-actions .qm-save { background: var(--app-primary); border:1px solid var(--app-primary-dark); color: var(--app-dark); border-radius:6px; padding:8px 12px; cursor:pointer; }

/* Trip Tracking Modal */
.trip-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.trip-modal.visible {
    opacity: 1;
    visibility: visible;
}

.trip-modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    background: var(--app-white);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.trip-modal.visible .trip-modal-content {
    transform: translateY(0);
}

.trip-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: 16px 16px 0 0;
    color: white;
}

.trip-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.trip-line-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 32px;
    padding: 0 0.5rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.trip-direction {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.trip-delay-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 100, 100, 0.9);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-left: 0.5rem;
    animation: pulse-delay 2s infinite;
}

@keyframes pulse-delay {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Tram Position Marker on Map */
.tram-position-marker {
    background: transparent !important;
    border: none !important;
}

.tram-position-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    animation: tram-bounce 0.5s ease-out, tram-pulse 2s infinite 0.5s;
}

.tram-position-icon i,
.tram-position-icon .tram-line-number {
    transform: rotate(45deg);
    color: white;
}

.tram-position-icon i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.tram-position-icon .tram-line-number {
    font-size: 0.75rem;
    font-weight: 700;
}

@keyframes tram-bounce {
    0% { transform: rotate(-45deg) scale(0) translateY(-20px); opacity: 0; }
    60% { transform: rotate(-45deg) scale(1.1) translateY(0); }
    100% { transform: rotate(-45deg) scale(1) translateY(0); opacity: 1; }
}

@keyframes tram-pulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 3px 20px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(255, 213, 0, 0.2); }
}

.tram-position-popup {
    min-width: 200px;
}

/* Delay indicator in Leaflet popups */
.tram-position-popup .delay-indicator {
    color: #dc3545;
    font-weight: 600;
}

.tram-position-popup .delay-indicator.early {
    color: #28a745;
}

/* Scheduled time detail (smaller, in parentheses) */
.tram-position-popup .scheduled-detail {
    font-size: 0.85em;
    color: #666;
}

.tram-popup-header {
    margin: -14px -14px 0 -14px;
    border-radius: 4px 4px 0 0 !important;
}

.trip-close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.trip-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.trip-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 200px;
    max-height: 50vh;
}

.trip-modal-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--app-border);
    background: var(--app-bg);
    padding-bottom: calc(0.75rem + var(--safe-area-bottom));
}

.trip-refresh-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--app-primary);
    color: var(--app-dark);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.trip-refresh-btn:hover {
    background: var(--app-primary-dark);
}

/* Trip Progress Bar */
.trip-progress-bar {
    height: 6px;
    background: var(--app-border);
    border-radius: 3px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.trip-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Trip Stops List */
.trip-stops-list {
    position: relative;
    padding-left: 2rem;
}

.trip-stops-list::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--app-border);
}

.trip-stop {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    position: relative;
}

.trip-stop-marker {
    position: absolute;
    left: -2rem;
    width: 24px;
    height: 24px;
    background: var(--app-white);
    border: 2px solid var(--app-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--app-text-light);
    z-index: 1;
}

.trip-stop.previous .trip-stop-marker {
    background: var(--line-color, var(--app-primary));
    border-color: var(--line-color, var(--app-primary));
    color: white;
}

.trip-stop.current .trip-stop-marker {
    background: var(--line-color, var(--app-primary));
    border-color: var(--line-color, var(--app-primary));
    color: white;
    width: 28px;
    height: 28px;
    left: calc(-2rem - 2px);
    font-size: 0.8rem;
    box-shadow: 0 0 0 4px rgba(255, 213, 0, 0.3);
    animation: pulse-marker 1.5s ease-in-out infinite;
}

@keyframes pulse-marker {
    0%, 100% { box-shadow: 0 0 0 4px rgba(255, 213, 0, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(255, 213, 0, 0.1); }
}

.trip-stop.upcoming .trip-stop-marker {
    background: var(--app-white);
    border-color: var(--app-border);
    color: var(--app-text-light);
}

.trip-stop.upcoming .trip-stop-marker i {
    font-size: 0.4rem;
}

.trip-stop-info {
    flex: 1;
    padding-top: 2px;
}

.trip-stop-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--app-text);
}

.trip-stop.previous .trip-stop-name {
    color: var(--app-text-light);
}

.trip-stop.current .trip-stop-name {
    font-weight: 700;
    color: var(--app-dark);
}

.trip-stop-time {
    font-size: 0.8rem;
    color: var(--app-text-light);
    margin-top: 2px;
}

.trip-stop.current .trip-stop-time {
    color: var(--app-text);
    font-weight: 500;
}

.trip-stop-platform {
    font-size: 0.75rem;
    color: var(--app-text-light);
    background: var(--app-bg);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 4px;
}

/* Trip Loading/Error States */
.trip-loading, .trip-error, .trip-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--app-text-light);
}

.trip-loading i {
    font-size: 2rem;
    color: var(--app-primary);
    margin-bottom: 1rem;
}

.trip-error i {
    font-size: 2rem;
    color: #d9534f;
    margin-bottom: 1rem;
}

.trip-retry-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--app-bg);
    border: 1px solid var(--app-border);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.trip-retry-btn:hover {
    background: var(--app-border);
}

/* Last Update Time */
.trip-last-update {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--app-text-light);
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--app-border);
}

.trip-last-update i {
    font-size: 0.7rem;
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .trip-modal {
        align-items: center;
    }

    .trip-modal-content {
        border-radius: 16px;
        max-height: 70vh;
    }

    .trip-modal-footer {
        border-radius: 0 0 16px 16px;
        padding-bottom: 0.75rem;
    }
}


/* ========================================
   AUTH MODAL (App-native Login)
   ======================================== */

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.auth-modal[hidden] {
    display: none;
}

.auth-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: var(--app-white);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    padding: 1.5rem;
    overflow-y: auto;
    animation: authSlideUp 0.3s ease-out;
}

@keyframes authSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--app-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-light);
    font-size: 1rem;
    transition: all 0.2s;
    z-index: 1;
}

.auth-modal-close:hover {
    background: var(--app-border);
    color: var(--app-text);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-modal-icon {
    width: 60px;
    height: 60px;
    background: var(--app-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 12px rgba(255, 213, 0, 0.4);
}

.auth-modal-icon i {
    font-size: 1.75rem;
    color: var(--app-dark);
}

.auth-modal-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--app-dark);
}

.auth-modal-header p {
    margin: 0;
    color: var(--app-text-light);
    font-size: 0.95rem;
}

/* Auth Message */
.auth-message {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.auth-message[hidden] {
    display: none;
}

.auth-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Google Auth Button */
.google-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0.875rem 1rem;
    background: white;
    border: 2px solid var(--app-border);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--app-text);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.google-auth-btn:hover {
    background: var(--app-bg);
    border-color: #ccc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.google-auth-btn .google-icon {
    flex-shrink: 0;
}

.auth-hint {
    text-align: center;
    color: var(--app-primary);
    font-size: 0.8rem;
    margin: 0.5rem 0 0;
    font-weight: 500;
}

.auth-hint i {
    margin-right: 0.25rem;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--app-text-light);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--app-border);
}

.auth-divider span {
    padding: 0 0.75rem;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: var(--app-bg);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1rem;
}

.auth-tab {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--app-text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--app-white);
    color: var(--app-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-form[hidden] {
    display: none;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.auth-field label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--app-text);
}

.auth-field label i {
    color: var(--app-text-light);
    font-size: 0.8rem;
}

.auth-field input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--app-border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.2);
}

.auth-field input::placeholder {
    color: #999;
}

.auth-terms {
    font-size: 0.8rem;
    color: var(--app-text-light);
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

.auth-terms a {
    color: var(--app-dark);
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.9rem 1rem;
    background: var(--app-primary);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--app-dark);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-submit-btn:hover {
    background: #e6c200;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 213, 0, 0.4);
}

.auth-submit-btn:disabled {
    background: var(--app-border);
    color: var(--app-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Desktop Auth Modal */
@media (min-width: 768px) {
    .auth-modal {
        align-items: center;
    }

    .auth-modal-content {
        border-radius: 20px;
        max-width: 400px;
        animation: authFadeIn 0.3s ease-out;
    }

    @keyframes authFadeIn {
        from { transform: scale(0.95); opacity: 0; }
        to { transform: scale(1); opacity: 1; }
    }
}

/* ========================================
   ROUTING PANEL STYLES
   ======================================== */

.routing-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--app-white);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    animation: routingSlideIn 0.3s ease-out;
}

.routing-panel[hidden] {
    display: none !important;
}

@keyframes routingSlideIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

body.routing-open {
    overflow: hidden;
}

.routing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    padding-top: calc(1rem + var(--safe-area-top));
    background: var(--app-dark);
    color: var(--app-white);
}

.routing-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.routing-header h3 i {
    color: var(--app-primary);
}

.routing-close {
    background: none;
    border: none;
    color: var(--app-white);
    font-size: 1.25rem;
    padding: 0.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.routing-close:hover {
    opacity: 1;
}

/* Routing Form */
.routing-form {
    padding: 1rem;
    background: var(--app-bg);
    border-bottom: 1px solid var(--app-border);
}

.routing-input-group {
    position: relative;
    margin-bottom: 0.5rem;
}

.routing-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--app-white);
    border: 2px solid var(--app-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.routing-input-wrapper:focus-within {
    border-color: var(--app-primary);
}

.routing-input-wrapper i.origin-icon {
    color: #4CAF50;
    padding-left: 1rem;
}

.routing-input-wrapper i.dest-icon {
    color: #F44336;
    padding-left: 1rem;
}

.routing-input {
    flex: 1;
    border: none;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.routing-input::placeholder {
    color: var(--app-text-light);
}

.routing-locate {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--app-text-light);
    cursor: pointer;
    transition: color 0.2s;
}

.routing-locate:hover {
    color: var(--app-primary-dark);
}

.routing-swap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto;
    background: var(--app-white);
    border: 2px solid var(--app-border);
    border-radius: 50%;
    color: var(--app-text-light);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 1;
    margin-top: -0.25rem;
    margin-bottom: -0.25rem;
}

.routing-swap:hover {
    border-color: var(--app-primary);
    color: var(--app-primary-dark);
}

/* Suggestions Dropdown */
.routing-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--app-white);
    border: 1px solid var(--app-border);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--app-shadow);
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--app-border);
    transition: background 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--app-bg);
}

.suggestion-item i {
    color: var(--app-tram);
}

.suggestion-item i.fa-train {
    color: var(--app-train);
}

.suggestion-empty,
.suggestion-error {
    padding: 1rem;
    text-align: center;
    color: var(--app-text-light);
}

/* Routing Options */
.routing-options {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    align-items: center;
}

.routing-time {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.routing-time label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--app-white);
    border: 2px solid var(--app-border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    flex: 1;
}

.routing-time label i {
    color: var(--app-text-light);
}

.routing-time input {
    border: none;
    font-size: 0.9rem;
    outline: none;
    width: 100%;
}

.routing-now-btn {
    background: var(--app-dark);
    color: var(--app-white);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.routing-now-btn:hover {
    background: var(--app-dark-light);
}

.routing-now-btn:active {
    transform: scale(0.95);
}

.routing-search-btn {
    background: var(--app-primary);
    color: var(--app-dark);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.routing-search-btn:hover {
    background: var(--app-primary-dark);
}

/* Routing Results */
.routing-results {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: calc(1rem + var(--safe-area-bottom));
}

.routing-placeholder,
.routing-loading,
.routing-empty,
.routing-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--app-text-light);
}

.routing-placeholder i,
.routing-loading i,
.routing-empty i,
.routing-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.routing-error i {
    color: #F44336;
}

/* Trip Cards */
.trip-card {
    background: var(--app-white);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    box-shadow: var(--app-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.trip-card.expanded {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.trip-header {
    padding: 1rem;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: auto auto;
    gap: 0.5rem 1rem;
    align-items: center;
}

/* Small bell in trip header */
.trip-header-bell {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--app-border);
    background: var(--app-white);
    color: var(--app-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.trip-header-bell:hover { background: var(--app-bg); }
.trip-header-bell:active { transform: scale(0.96); }

.trip-times {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trip-time {
    font-size: 1.25rem;
    font-weight: 700;
}

.trip-time.departure {
    color: var(--app-text);
}

.trip-time.arrival {
    color: var(--app-text-light);
}

.trip-delay-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #ffebee;
    color: #c62828;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.trip-delay-badge i {
    font-size: 0.7rem;
}

.trip-arrow {
    color: var(--app-text-light);
    font-size: 0.8rem;
}

.trip-meta {
    display: flex;
    gap: 1rem;
    color: var(--app-text-light);
    font-size: 0.85rem;
}

.trip-meta i {
    margin-right: 0.25rem;
}

.trip-direct {
    color: #4CAF50;
}

.trip-lines {
    grid-column: 1 / 3;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.trip-expand {
    color: var(--app-text-light);
    transition: transform 0.3s;
}

.trip-card.expanded .trip-expand {
    transform: rotate(180deg);
}

/* Trip Details */
.trip-details {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--app-border);
    animation: tripDetailsSlide 0.3s ease-out;
}

@keyframes tripDetailsSlide {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 1000px; }
}

/* Leg Items */
.leg-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
}

.leg-walk {
    padding: 0.5rem 0;
}

.leg-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-light);
}

.leg-walk-text {
    color: var(--app-text-light);
    font-size: 0.9rem;
}

.leg-timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
    padding: 0.25rem 0;
}

.leg-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid var(--app-tram);
    background: var(--app-white);
    flex-shrink: 0;
}

.leg-line {
    flex: 1;
    width: 4px;
    background: var(--app-tram);
    min-height: 40px;
}

.leg-content {
    flex: 1;
    min-width: 0;
}

.leg-origin,
.leg-dest {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.leg-dest {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.leg-time {
    font-weight: 600;
    font-size: 0.95rem;
}

.leg-time.delayed {
    color: #F44336;
}

.leg-time .delay {
    font-size: 0.8rem;
    color: #F44336;
    margin-left: 0.25rem;
}

.leg-station {
    font-size: 0.95rem;
}

.leg-platform {
    font-size: 0.8rem;
    color: var(--app-text-light);
    background: var(--app-bg);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.leg-transport {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

.leg-direction {
    color: var(--app-text-light);
    font-size: 0.85rem;
}

.leg-duration {
    color: var(--app-text-light);
    font-size: 0.85rem;
    margin-left: auto;
}

.leg-stops-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-text-light);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.leg-stops-toggle i {
    transition: transform 0.2s;
}

.leg-stops-toggle.expanded i {
    transform: rotate(180deg);
}

.leg-stops {
    padding-left: 1rem;
    border-left: 2px dashed var(--app-border);
    margin: 0.5rem 0;
}

.leg-stop {
    display: flex;
    gap: 0.75rem;
    padding: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--app-text-light);
}

.stop-time {
    width: 40px;
    flex-shrink: 0;
}

/* Line Badge in Routing */
.trip-card .line-badge,
.leg-transport .line-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 0.5rem;
    background: var(--app-tram);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 4px;
}

.trip-card .line-badge.sbahn,
.leg-transport .line-badge.sbahn {
    background: var(--app-train);
    border-radius: 50%;
    min-width: 28px;
    width: 28px;
}

/* Routing Results Header */
.routing-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.results-count {
    color: var(--app-text-light);
    font-size: 0.9rem;
}

.save-favorite-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 1.5px solid var(--app-border);
    border-radius: 20px;
    color: var(--app-text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.save-favorite-btn:hover {
    border-color: var(--app-primary);
    color: var(--app-primary-dark);
}

.save-favorite-btn.is-favorite {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: var(--app-dark);
}

.save-favorite-btn.is-favorite:hover {
    background: var(--app-primary-dark);
    border-color: var(--app-primary-dark);
}

/* Routing Favorites */
.routing-favorites {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 100%);
    border-bottom: 1px solid var(--app-border);
}

.routing-favorites[hidden] {
    display: none;
}

.favorites-header-small {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--app-text-light);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.favorites-header-small i {
    color: var(--app-primary-dark);
}

.favorites-list-inline {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--app-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.favorite-use {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.875rem;
    color: var(--app-text);
    transition: background 0.2s;
    min-width: 0;
}

.favorite-use:hover {
    background: var(--app-bg);
}

.favorite-use .fav-origin,
.favorite-use .fav-dest {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.favorite-use .fav-origin {
    font-weight: 500;
}

.favorite-use i {
    color: var(--app-text-light);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.favorite-remove {
    padding: 0.625rem 0.75rem;
    background: none;
    border: none;
    border-left: 1px solid var(--app-border);
    color: var(--app-text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.favorite-remove:hover {
    background: #fff0f0;
    color: #e53935;
}

/* Desktop Routing */
@media (min-width: 768px) {
    .routing-panel {
        left: auto;
        width: 420px;
        border-left: 1px solid var(--app-border);
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        animation: routingSlideInDesktop 0.3s ease-out;
    }

    @keyframes routingSlideInDesktop {
        from { transform: translateX(100%); }
        to { transform: translateX(0); }
    }

    .favorite-use .fav-origin,
    .favorite-use .fav-dest {
        max-width: 150px;
    }
}

/* ========================================
   PULL-TO-REFRESH
   ======================================== */

.pull-to-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--app-dark);
    color: var(--app-white);
    padding: 0.75rem 1.25rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    opacity: 0;
    pointer-events: none;
}

.pull-to-refresh-indicator i {
    font-size: 1rem;
    color: var(--app-primary);
    transition: transform 0.3s ease;
}

.pull-to-refresh-indicator.ready {
    background: var(--app-primary);
    color: var(--app-dark);
}

.pull-to-refresh-indicator.ready i {
    color: var(--app-dark);
    transform: rotate(180deg);
}

.pull-to-refresh-indicator.refreshing {
    background: var(--app-primary);
    color: var(--app-dark);
}

.pull-to-refresh-indicator.refreshing i {
    color: var(--app-dark);
}

/* Routing Refresh Button */
.routing-refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.75rem;
    background: var(--app-bg);
    border: 1.5px solid var(--app-border);
    border-radius: 10px;
    color: var(--app-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.routing-refresh-btn:hover {
    background: var(--app-white);
    border-color: var(--app-primary);
    color: var(--app-dark);
}

.routing-refresh-btn:active {
    transform: scale(0.98);
}

.routing-refresh-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.routing-refresh-btn.refreshing i {
    animation: spin 1s linear infinite;
}

/* ============================================================================
   TRIP MONITOR MODAL
   ============================================================================ */

/* Monitor button in trip details */
.trip-monitor-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
    color: var(--app-dark);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.trip-monitor-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 213, 0, 0.3);
}

.trip-monitor-btn:active {
    transform: scale(0.98);
}

/* Load Later Trips Button */
.load-later-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin: 1rem 0;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: var(--app-dark);
    border: 2px dashed var(--app-primary);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-later-btn:hover {
    background: linear-gradient(135deg, #fff8cc 0%, var(--app-primary) 100%);
    border-style: solid;
    transform: translateY(-1px);
}

.load-later-btn:active {
    transform: scale(0.98);
}

.load-later-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-later-btn i {
    font-size: 1rem;
}

/* Modal backdrop */
.monitor-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    padding-bottom: calc(1rem + var(--safe-area-bottom));
}

.monitor-modal[hidden] {
    display: none;
}

/* Modal content */
.monitor-modal-content {
    background: var(--app-white);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal header */
.monitor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--app-border);
}

.monitor-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.monitor-modal-header h3 i {
    color: var(--app-primary);
}

.monitor-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--app-bg);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--app-text-light);
    transition: all 0.2s;
}

.monitor-modal-close:hover {
    background: var(--app-border);
    color: var(--app-text);
}

/* Trip info section */
.monitor-modal-trip-info {
    padding: 1rem 1.25rem;
    background: var(--app-bg);
    border-bottom: 1px solid var(--app-border);
}

.monitor-trip-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.monitor-trip-time {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--app-dark);
}

.monitor-trip-route {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-text-light);
    font-size: 0.9rem;
}

.monitor-trip-route i {
    font-size: 0.75rem;
    color: var(--app-border);
}

/* Form section */
.monitor-modal-form {
    padding: 1.25rem;
}

/* Type selector (Einmalig / Wiederkehrend) */
.monitor-type-selector {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.monitor-type-option {
    flex: 1;
    cursor: pointer;
}

.monitor-type-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.monitor-type-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--app-bg);
    border: 2px solid var(--app-border);
    border-radius: 10px;
    transition: all 0.2s;
}

.monitor-type-option input:checked + .monitor-type-label {
    background: rgba(255, 213, 0, 0.1);
    border-color: var(--app-primary);
}

.monitor-type-label i {
    font-size: 1.5rem;
    color: var(--app-text-light);
}

.monitor-type-option input:checked + .monitor-type-label i {
    color: var(--app-primary-dark);
}

/* Notification Mode Selector (Aufbruch-Erinnerung vs Verspätungs-Alarm) */
.monitor-mode-selector {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.monitor-mode-option {
    flex: 1;
    cursor: pointer;
}

.monitor-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.monitor-mode-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 0.75rem;
    background: var(--app-bg);
    border: 2px solid var(--app-border);
    border-radius: 10px;
    transition: all 0.2s;
    text-align: center;
}

.monitor-mode-option input:checked + .monitor-mode-label {
    background: rgba(255, 213, 0, 0.1);
    border-color: var(--app-primary);
}

.monitor-mode-label i {
    font-size: 1.25rem;
    color: var(--app-text-light);
}

.monitor-mode-option input:checked + .monitor-mode-label i {
    color: var(--app-primary-dark);
}

.monitor-mode-label span {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
}

.monitor-mode-label small {
    font-size: 0.7rem;
    color: var(--app-text-light);
    font-weight: 400;
}

.monitor-mode-label .mode-title {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.monitor-mode-label .mode-desc {
    font-size: 0.65rem;
    color: var(--app-text-light);
    font-weight: 400;
    line-height: 1.3;
}

/* Reminder Section */
.monitor-reminder-section {
    margin-bottom: 1.25rem;
}

.monitor-reminder-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--app-text-light);
    margin-bottom: 0.5rem;
}

.reminder-time-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reminder-btn {
    flex: 1;
    min-width: 60px;
    padding: 0.625rem 0.75rem;
    background: var(--app-bg);
    border: 2px solid var(--app-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.reminder-btn:hover {
    background: var(--app-border);
}

.reminder-btn.active {
    background: rgba(255, 213, 0, 0.15);
    border-color: var(--app-primary);
    color: var(--app-primary-dark);
}

.reminder-explanation {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--app-bg);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--app-text-light);
    line-height: 1.4;
}

.reminder-explanation i {
    color: var(--app-primary-dark);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Date section */
.monitor-date-section,
.monitor-weekdays-section {
    margin-bottom: 1.25rem;
}

.monitor-date-section label,
.monitor-weekdays-section label,
.monitor-threshold-section label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--app-text-light);
    margin-bottom: 0.5rem;
}

.monitor-date-section input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--app-border);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.monitor-date-section input[type="date"]:focus {
    border-color: var(--app-primary);
}

/* Weekday selector */
.weekday-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.weekday-selector label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: var(--app-bg);
    border: 2px solid var(--app-border);
    border-radius: 6px;
    cursor: pointer;
    font-weight: normal;
    transition: all 0.2s;
}

.weekday-selector label:has(input:checked) {
    background: rgba(255, 213, 0, 0.2);
    border-color: var(--app-primary);
}

.weekday-selector input {
    display: none;
}

/* Threshold selector */
.monitor-threshold-section {
    margin-bottom: 1.25rem;
}

.threshold-selector {
    display: flex;
    gap: 0.5rem;
}

.threshold-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--app-bg);
    border: 2px solid var(--app-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.threshold-btn:hover {
    border-color: var(--app-text-light);
}

.threshold-btn.active {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: var(--app-dark);
}

/* Info box */
.monitor-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1565c0;
}

.monitor-info i {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Modal actions */
.monitor-modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--app-border);
}

.monitor-cancel-btn,
.monitor-save-btn {
    flex: 1;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.monitor-cancel-btn {
    background: var(--app-bg);
    border: 2px solid var(--app-border);
    color: var(--app-text);
}

.monitor-cancel-btn:hover {
    background: var(--app-border);
}

.monitor-save-btn {
    background: var(--app-primary);
    border: none;
    color: var(--app-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.monitor-save-btn:hover {
    background: var(--app-primary-dark);
}

.monitor-save-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Toast notification */
.routing-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--app-dark);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 3000;
    max-width: 90%;
    text-align: center;
}

.routing-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Body state when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ============================================================================
   BOTTOM NAVIGATION
   ============================================================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--app-white);
    border-top: 1px solid var(--app-border);
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + var(--safe-area-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--app-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.bottom-nav-btn i {
    font-size: 1.25rem;
}

.bottom-nav-btn span:not(.monitor-badge) {
    font-size: 0.7rem;
    font-weight: 500;
}

.bottom-nav-btn.active {
    color: var(--app-primary-dark);
}

.bottom-nav-btn.active i {
    color: var(--app-primary-dark);
}

.bottom-nav-btn:hover:not(.active) {
    color: var(--app-text);
}

/* Monitor badge */
.monitor-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(100%);
    background: #e74c3c;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Monitors Panel (for bell tab) */
.monitors-panel {
    position: fixed;
    top: var(--app-bar-height);
    left: 0;
    right: 0;
    bottom: 60px; /* Height of bottom nav */
    background: var(--app-bg);
    z-index: 900;
    overflow-y: auto;
    display: none;
    padding-bottom: var(--safe-area-bottom);
}

.monitors-panel.visible {
    display: block;
}

.monitors-panel-header {
    position: sticky;
    top: 0;
    background: var(--app-white);
    padding: 1rem;
    border-bottom: 1px solid var(--app-border);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.monitors-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--app-dark);
}

.monitors-actions { display:flex; align-items:center; gap: .75rem; }
.monitors-actions .toggle { display:flex; align-items:center; gap:.35rem; font-size:.85rem; color: var(--app-text); }
.monitors-actions input[type="checkbox"] { accent-color: var(--app-primary); width: 18px; height: 18px; }

.monitors-panel-content {
    padding: 1rem;
}

.monitors-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--app-text-light);
}

.monitors-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.monitors-empty p {
    margin: 0.5rem 0;
}

/* Monitor list item */
.monitor-list-item {
    background: var(--app-white);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--app-shadow);
}

.monitor-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.monitor-list-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.monitor-list-line .line-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.monitor-list-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--app-dark);
}

.monitor-list-stops {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--app-text);
}

.monitor-list-stops .from::before {
    content: "Von: ";
    color: var(--app-text-light);
    font-size: 0.8rem;
}

.monitor-list-stops .to::before {
    content: "Nach: ";
    color: var(--app-text-light);
    font-size: 0.8rem;
}

.monitor-list-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--app-border);
    font-size: 0.8rem;
    color: var(--app-text-light);
}

.monitor-list-type {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.monitor-list-type i {
    font-size: 0.9rem;
}

.monitor-delete-btn {
    background: transparent;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.monitor-delete-btn:hover {
    background: rgba(231, 76, 60, 0.1);
}

.monitor-edit-btn {
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
    margin-right: 0.25rem;
}
.monitor-edit-btn:hover { background: rgba(0,0,0,0.05); }

/* Expired monitor styling */
.monitor-list-item.monitor-expired {
    opacity: 0.6;
    background: #f9f9f9;
}

.monitor-expired-badge {
    background: #999;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Monitor delay display */
.monitor-delay {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 0.5rem;
}

.monitor-delay.delayed {
    background: #dc3545;
    color: white;
}

.monitor-delay.on-time {
    background: #28a745;
    color: white;
}

/* Monitor with delay - highlight border */
.monitor-list-item.has-delay {
    border-left: 4px solid #dc3545;
}

/* Crossed-out scheduled time when delayed */
.scheduled-crossed {
    text-decoration: line-through;
    color: #999;
    font-size: 0.85em;
    margin-right: 0.25rem;
}

/* Clickable monitor card */
.monitor-list-item.clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.monitor-list-item.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.monitor-list-item.clickable:active {
    transform: translateY(0);
    box-shadow: var(--app-shadow);
}

/* Tap hint for mobile */
.monitor-tap-hint {
    font-size: 0.7rem;
    color: #999;
    text-align: center;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--app-border);
}

.monitor-tap-hint i {
    margin-right: 0.25rem;
    opacity: 0.7;
}

/* Highlighted monitor (from notification click) */
.monitor-list-item.highlighted {
    animation: monitor-highlight 3s ease-out;
}

@keyframes monitor-highlight {
    0% {
        box-shadow: 0 0 0 3px var(--app-primary), var(--app-shadow);
        background: rgba(255, 193, 7, 0.15);
    }
    100% {
        box-shadow: var(--app-shadow);
        background: var(--app-white);
    }
}

/* Adjust map container for bottom nav */
#map {
    bottom: 60px !important;
}

/* Adjust routing panel for bottom nav */
.routing-panel {
    bottom: 60px;
}

/* Adjust toast position for bottom nav */
.routing-toast {
    bottom: 130px;
}
