:root {
    /* Modern Emerald/Green Primary - Fresh & Professional */
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: #34d399;
    --primary-darker: #047857;
    --primary-lighter: #6ee7b7;

    /* Accent Colors - Vibrant but Tasteful */
    --secondary-color: #3b82f6;
    --accent-color: #f59e0b;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-amber: #fbbf24;

    /* Background Colors - Deep Dark with Warm Tones */
    --bg-dark: #0a0f1a;
    --bg-darker: #050810;
    --bg-card: rgba(20, 30, 40, 0.85);
    --bg-card-hover: rgba(30, 45, 60, 0.95);
    --bg-glass: rgba(10, 15, 26, 0.75);
    --bg-overlay: rgba(5, 8, 16, 0.95);
    --bg-surface: rgba(20, 30, 40, 0.6);
    --bg-elevated: rgba(30, 40, 50, 0.9);

    /* Text Colors - High Contrast & Readable */
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-accent: #34d399;
    --text-inverse: #0a0f1a;
    --text-on-primary: #ffffff;

    /* Border Colors - Subtle & Refined */
    --border-color: rgba(148, 163, 184, 0.15);
    --border-light: rgba(148, 163, 184, 0.25);
    --border-accent: rgba(16, 185, 129, 0.4);
    --border-divider: rgba(148, 163, 184, 0.1);
    --border-focus: rgba(16, 185, 129, 0.5);

    /* Status Colors - Clear & Distinct */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;

    /* Shadows - Modern Depth */
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.6), 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -2px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.3);
    --shadow-glow-lg: 0 0 40px rgba(16, 185, 129, 0.4);

    /* Gradients - Smooth & Modern */
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    --gradient-primary-light: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-surface: linear-gradient(180deg, rgba(20, 30, 40, 0.95) 0%, rgba(10, 15, 26, 0.98) 100%);
    --gradient-bg: radial-gradient(ellipse at top, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(59, 130, 246, 0.05) 0%, transparent 50%);

    /* Animation & Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-darker);
    background-image: var(--gradient-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
}

.skip-link:focus {
    left: 1em;
    top: 1em;
}

/* Header */
.header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 18px 32px;
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-section i {
    font-size: 36px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
}

.logo-section h1 {
    font-size: 26px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    letter-spacing: -0.5px;
}

.tagline {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-top: -4px;
}

.search-bar-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 18px;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition-base);
    font-weight: 500;
}

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

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), var(--shadow-md);
    transform: translateY(-1px);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient-primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.search-btn:active {
    transform: translateY(-50%) scale(0.95);
}

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

.icon-btn {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-login,
.btn-signup {
    padding: 11px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    letter-spacing: 0.3px;
}

.btn-login {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1.5px solid var(--border-light);
}

.btn-login:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-signup {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-signup:active {
    transform: translateY(0);
}

/* Navigation Tabs */
.nav-tabs {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 6px;
    padding: 8px 32px;
    overflow-x: auto;
}

.nav-tab {
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    letter-spacing: 0.2px;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(30, 41, 59, 0.5);
}

.nav-tab.active {
    color: var(--text-on-primary);
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.nav-tab.active i {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 0;
}

.tab-content {
    display: none;
}

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

/* Map Container */
.map-container {
    position: relative;
    height: calc(100vh - 140px);
    width: 100%;
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
    background: var(--bg-darker);
    filter: brightness(0.95) contrast(1.1);
}

/* Custom Leaflet map styling */
.leaflet-container {
    background: var(--bg-darker);
    font-family: 'Inter', sans-serif;
}

.leaflet-container .leaflet-control-zoom {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.leaflet-container .leaflet-control-zoom a {
    background: var(--bg-card);
    color: var(--text-primary);
    border: none;
    border-bottom: 1px solid var(--border-color);
}

.leaflet-container .leaflet-control-zoom a:hover {
    background: var(--bg-card-hover);
    color: var(--primary-color);
}

.leaflet-container .leaflet-control-zoom-in,
.leaflet-container .leaflet-control-zoom-out {
    font-size: 18px;
    font-weight: 600;
    line-height: 30px;
}

.leaflet-container .leaflet-control-attribution {
    background: rgba(13, 20, 33, 0.8);
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.leaflet-container .leaflet-control-attribution a {
    color: var(--primary-color);
}

/* Modern Train Marker Styling */
.modern-train-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.train-marker-custom {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    /* No transform transitions - prevents dancing */
}

.train-marker-custom:hover {
    /* No scale transform - prevents position changes */
    z-index: 1000 !important;
}

.train-marker-custom:hover .train-icon-wrapper {
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.6),
        0 0 0 3px rgba(255, 255, 255, 0.2),
        0 0 30px var(--primary-color)88 !important;
    filter: brightness(1.15);
}

.train-marker-custom:hover .train-number-badge-hover {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(-4px) !important;
}

.train-marker-custom:hover .train-glow-ring {
    opacity: 0.8 !important;
    animation: pulseGlow 1s ease-in-out infinite;
}

.train-marker-custom:hover .train-status-dot {
    transform: scale(1.2);
    box-shadow: 0 0 12px currentColor, 0 0 6px currentColor !important;
}

/* Glow ring animation */
@keyframes pulseGlow {

    0%,
    100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Speed line animation */
@keyframes speedLine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Status dot pulse */
@keyframes statusPulse {

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

    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

/* Removed - using icon wrapper instead */

/* Marker entrance animation - subtle, no position changes */
.modern-train-marker {
    animation: markerEntrance 0.4s ease-out;
}

@keyframes markerEntrance {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Smooth icon transitions - only visual effects, no position changes */
.train-icon-wrapper {
    transition: box-shadow 0.2s ease, filter 0.2s ease !important;
}

.train-status-dot {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

/* Train marker active state - subtle animation */
.train-marker-custom.active .train-icon-wrapper {
    animation: markerActive 0.4s ease-out;
}

.train-marker-custom.active .train-glow-ring {
    animation: pulseGlow 0.8s ease-in-out infinite;
    opacity: 1 !important;
}

@keyframes markerActive {
    0% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.3);
    }

    100% {
        filter: brightness(1.1);
    }
}

/* Map controls enhancement */
.map-controls {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-btn {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--primary-color)44;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(16, 185, 129, 0.4);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Enhanced marker interactions - no position changes */
.train-marker-custom:active .train-icon-wrapper {
    filter: brightness(0.9) !important;
}

/* Marker cluster styling (if using clustering) */
.marker-cluster {
    background: var(--bg-glass) !important;
    border: 2px solid var(--primary-color) !important;
    border-radius: 50% !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

/* Smooth map transitions */
.leaflet-container {
    transition: filter 0.3s ease;
}

.leaflet-container.loading {
    filter: blur(2px);
    pointer-events: none;
}

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-btn {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1.5px solid var(--border-light);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    font-size: 18px;
}

.control-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.control-btn:active {
    transform: translateY(0) scale(0.95);
}

.map-legend {
    position: absolute;
    bottom: 24px;
    left: 24px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    border: 1px solid var(--border-light);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-icon {
    width: 24px;
    height: 16px;
    display: inline-block;
    border-radius: 3px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.train-icon-up {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: 2px solid #2980b9;
    border-radius: 8px 8px 4px 4px;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.train-icon-up::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid #2980b9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.train-icon-down {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    border: 2px solid #d35400;
    border-radius: 8px 8px 4px 4px;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.4);
}

.train-icon-down::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid #d35400;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Find Trains Section */
.find-trains-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
}

.search-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 48px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(16, 185, 129, 0.3);
}

.search-card h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.description {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.station-search-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 16px;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--primary-color);
    font-size: 16px;
}

.station-input {
    width: 100%;
    padding: 16px 44px 16px 48px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.station-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15), var(--shadow);
    transform: translateY(-1px);
}

.clear-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.swap-btn {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border: 1.5px solid var(--border-color);
    width: 52px;
    height: 52px;
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    font-size: 18px;
}

.swap-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: rotate(180deg) scale(1.05);
    box-shadow: var(--shadow);
}

.search-trains-btn {
    background: var(--gradient-primary);
    border: none;
    padding: 16px 36px;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    letter-spacing: 0.3px;
}

.search-trains-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    background: var(--gradient-primary-light);
}

.search-trains-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-lg);
}

.search-trains-btn:active {
    transform: translateY(0);
}

/* Results Header */
.results-header {
    margin-bottom: 24px;
}

.results-header h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.filter-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.filter-btn {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1.5px solid var(--border-color);
    padding: 10px 22px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.2px;
}

.filter-btn:hover {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-primary);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.results-count {
    color: var(--text-muted);
    font-size: 14px;
}

/* Train Cards */
.trains-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.train-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.train-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.train-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.train-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

.train-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.train-number-name {
    flex: 1;
}

.train-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.train-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.train-type {
    background: var(--gradient-primary);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.train-route {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.route-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.station-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.station-time {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.station-platform {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.route-arrow {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.route-arrow i {
    font-size: 24px;
}

.train-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.train-card-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
}

.check-availability-btn {
    flex: 1;
    background: var(--gradient-primary);
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.check-availability-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.check-availability-btn:active {
    transform: translateY(0);
}

.check-availability-btn i {
    font-size: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.meta-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.running-days {
    display: flex;
    gap: 8px;
}

.day-badge {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-darker);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.day-badge.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Train Info Section */
.train-info-container,
.live-status-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
}

.train-info-form,
.station-status-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: end;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 11, 19, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Map Loading Overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 11, 19, 0.75);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    border-radius: 0;
}

.map-loadin.gauge-badge {
    background: var(--bg-darker);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    border: 1px solid var(--border-color);
}

/* Speed Leaderboard Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease;
}

.rank-badge:hover {
    transform: translateX(4px);
}

.rank-badge.blue {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.rank-badge.purple {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #c084fc;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.1);
}

.rank-badge i {
    font-size: 14px;
    opacity: 0.9;
}

.map-loading-content {
    background: var(--bg-card);
    padding: 32px 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 240px;
}

.map-loading-content .loader {
    width: 48px;
    height: 48px;
    border-width: 3px;
}

.map-loading-text {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.map-loading-subtext {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
}

/* Train Popup Styling - Updated with train theme */
.leaflet-popup-content-wrapper {
    background: rgba(26, 31, 46, 0.98) !important;
    backdrop-filter: blur(20px);
    color: var(--text-primary) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(108, 92, 231, 0.3) !important;
    border: 1px solid rgba(108, 92, 231, 0.3) !important;
    font-family: 'Inter', sans-serif !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
}

.leaflet-popup-tip {
    background: rgba(26, 31, 46, 0.98) !important;
    border: 1px solid rgba(108, 92, 231, 0.3) !important;
}

.leaflet-popup-close-button {
    color: var(--text-primary) !important;
    font-size: 24px !important;
    padding: 8px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 16px !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.leaflet-popup-close-button:hover {
    background: rgba(108, 92, 231, 0.2) !important;
    color: var(--primary-color) !important;
    transform: rotate(90deg) !important;
}

.train-popup .leaflet-popup-content-wrapper {
    padding: 0 !important;
    background: transparent !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

.modern-train-popup {
    animation: popupSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

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

/* Modern Train Tooltip Styling */
.leaflet-tooltip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-family: 'Inter', sans-serif !important;
    padding: 0 !important;
}

.modern-train-tooltip {
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.leaflet-tooltip-top:before {
    border-top-color: rgba(255, 255, 255, 0.95) !important;
}

.leaflet-tooltip-bottom:before {
    border-bottom-color: rgba(255, 255, 255, 0.95) !important;
}

.leaflet-tooltip-left:before {
    border-left-color: rgba(255, 255, 255, 0.95) !important;
}

.leaflet-tooltip-right:before {
    border-right-color: rgba(255, 255, 255, 0.95) !important;
}

/* Marker hover effects consolidated with train-marker-custom above - removing duplicate */

/* Compact Train Info Styles - Modern & Professional */
.train-info-compact-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
}

.train-info-header-compact {
    background: var(--gradient-primary);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.train-info-title-section {
    flex: 1;
    min-width: 0;
}

.train-number-badge-compact {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.train-name-compact {
    color: white;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.3;
}

.train-route-compact {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 500;
}

.train-type-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.train-stats-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1px;
    background: var(--border-divider);
    padding: 0;
}

.stat-item-compact {
    background: var(--bg-card);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition-base);
}

.stat-item-compact:hover {
    background: var(--bg-card-hover);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-value {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}

.stat-unit {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.running-days-compact {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.running-days-compact .day-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-darker);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.running-days-compact .day-badge.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.current-status-compact {
    background: var(--bg-card-hover);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
    animation: pulse 2s ease-in-out infinite;
}

.status-label {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.status-value {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}

.status-update {
    color: var(--text-muted);
    font-size: 12px;
}

.train-route-compact-section {
    padding: 20px 24px;
}

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

.section-header-compact h4 {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.station-count {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.timeline-compact {
    position: relative;
    padding-left: 24px;
}

.timeline-item-compact {
    position: relative;
    margin-bottom: 16px;
    padding-left: 32px;
    padding-bottom: 16px;
}

.timeline-item-compact:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 20px;
    bottom: -16px;
    width: 2px;
    background: var(--border-color);
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid var(--bg-card);
    z-index: 2;
}

.timeline-dot.passed {
    background: var(--text-muted);
    border-color: var(--text-muted);
}

.timeline-dot.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.timeline-dot.upcoming {
    background: transparent;
    border-color: var(--border-color);
}

.timeline-content-compact {
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.timeline-item-compact:hover .timeline-content-compact {
    background: var(--bg-card-hover);
    border-color: var(--border-accent);
}

.station-info-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.station-name-compact {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.station-code-compact {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    background: var(--bg-darker);
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.station-timings-compact {
    display: flex;
    gap: 16px;
    margin-bottom: 6px;
}

.timing-compact {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timing-label-compact {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 28px;
}

.timing-value-compact {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.timing-actual-compact {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
}

.station-meta-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-item {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.delay-badge-compact {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.timeline-item-passed .timeline-content-compact {
    opacity: 0.7;
}

.timeline-item-current .timeline-content-compact {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.05);
}

.no-live-status {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.no-live-status i {
    color: var(--text-muted);
}

.timeline-line {
    position: absolute;
    left: 15px;
    top: 32px;
    width: 2px;
    height: calc(100% + 16px);
    background: var(--border-color);
}

.timeline-line-end {
    height: 0;
}

.timeline-station-marker {
    position: absolute;
    left: -25px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-size: 14px;
}

.timeline-station-passed .timeline-station-marker {
    background: var(--text-muted);
    color: var(--bg-card);
}

.timeline-station-current .timeline-station-marker {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
    animation: pulse 2s infinite;
}

.timeline-station-upcoming .timeline-station-marker {
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
}

.timeline-station-passed .timeline-line {
    background: var(--text-muted);
}

.timeline-station-current .timeline-line {
    background: var(--primary-color);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(108, 92, 231, 0.1);
    }
}

.timeline-station-content {
    flex: 1;
    background: var(--bg-darker);
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    margin-left: 16px;
}

.timeline-station-passed .timeline-station-content {
    opacity: 0.7;
    background: var(--bg-card);
}

.timeline-station-current .timeline-station-content {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1) 0%, rgba(108, 92, 231, 0.05) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.timeline-station-main {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 24px;
}

.timeline-station-info {
    flex: 1;
}

.timeline-station-time {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.timeline-station-passed .timeline-station-time {
    color: var(--text-muted);
}

.timeline-station-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.timeline-station-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.timeline-station-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-station-meta i {
    font-size: 11px;
}

.timeline-station-times {
    display: flex;
    gap: 16px;
    text-align: right;
}

.timeline-time-item {
    min-width: 80px;
}

.time-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.time-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.time-value.time-delayed {
    color: var(--error-color);
}

.timeline-station-departure {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-secondary);
}

/* Statistics Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Detail Items */
.detail-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-label i {
    color: var(--primary-color);
    font-size: 14px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Pulse Animation for Live Indicator */
@keyframes pulse {

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

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Autocomplete Styles */
.autocomplete-suggestions {
    font-family: 'Inter', sans-serif;
}

.autocomplete-item {
    position: relative;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--bg-card-hover) !important;
    border-left: 3px solid var(--primary-color);
}

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

/* Input wrapper positioning for autocomplete */
.input-wrapper {
    position: relative;
}

/* Ensure autocomplete appears above other elements */
.autocomplete-suggestions {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Train Info Side Panel (FlightRadar24 Style) */
.train-info-panel {
    position: fixed;
    right: -420px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.train-info-panel.open {
    right: 0;
}

.train-panel-header {
    padding: 20px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.train-panel-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.train-panel-title #train-panel-number {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.train-panel-title #train-panel-name {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.9;
}

.train-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.train-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.train-panel-tabs {
    display: flex;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
}

.panel-tab {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.panel-tab:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.panel-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-card);
}

.panel-tab i {
    font-size: 14px;
}

.train-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.train-panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.train-panel-loading .loader {
    margin-bottom: 20px;
}

.panel-tab-content {
    display: none;
}

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

.train-route-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: var(--bg-darker);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.train-route-display i {
    color: var(--primary-color);
    font-size: 14px;
}

.train-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.train-stat-item {
    background: var(--bg-darker);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.train-stat-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.train-stat-item .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(108, 92, 231, 0.2);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.train-stat-item .stat-info {
    flex: 1;
}

.train-panel-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.train-panel-details-btn {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.train-panel-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.train-panel-details-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.train-panel-details-btn i {
    font-size: 16px;
}

.train-stat-item .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.train-stat-item .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.train-live-status {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.current-location-card {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 255, 136, 0.05) 100%);
    border: 2px solid #00ff88;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.location-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #00ff88;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.location-info {
    flex: 1;
}

.location-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.location-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.location-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.delay-badge {
    background: #ff6b6b;
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
    min-width: 80px;
}

.delay-label {
    font-size: 10px;
    opacity: 0.9;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delay-value {
    font-size: 18px;
    font-weight: 700;
}

.next-station-card {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.next-station-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.next-station-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.next-station-time {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.next-station-platform {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.route-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.route-station-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-darker);
    border-radius: 8px;
    border-left: 3px solid var(--border-color);
    transition: all 0.2s ease;
}

.route-station-item:hover {
    border-left-color: var(--primary-color);
    background: var(--bg-card-hover);
}

.route-station-item.current {
    border-left-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.route-station-item.passed {
    opacity: 0.6;
}

.route-station-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    margin-top: 4px;
    flex-shrink: 0;
}

.route-station-item.current .route-station-marker {
    background: #00ff88;
    box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.2);
}

.route-station-item.passed .route-station-marker {
    background: var(--text-muted);
}

.route-station-info {
    flex: 1;
}

.route-station-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.route-station-code {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 8px;
}

.route-station-details {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.route-station-time {
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile Responsive for Panel */
@media (max-width: 768px) {
    .train-info-panel {
        width: 100%;
        right: -100%;
    }

    .train-panel-header {
        padding: 16px;
    }

    .train-panel-title #train-panel-number {
        font-size: 18px;
    }

    .train-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== Reservation Chart Styles ==================== */
.chart-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
}

.chart-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 24px;
}

.chart-form .form-group {
    position: relative;
}

.chart-form .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chart-form .form-group label i {
    color: var(--primary-color);
    font-size: 16px;
}

.chart-form .search-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-darker);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.chart-form .search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.chart-form .search-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chart-form select.search-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.info-tooltip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.info-tooltip i {
    color: var(--primary-color);
    font-size: 14px;
}

.chart-actions {
    margin-top: 8px;
}

.chart-results {
    margin-top: 30px;
}

.chart-display-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
}

.chart-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.chart-header-main h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chart-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.chart-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-meta i {
    color: var(--primary-color);
    font-size: 14px;
}

.chart-summary {
    margin-bottom: 32px;
}

.chart-summary h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-summary h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.class-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.class-summary-card {
    background: var(--bg-darker);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.class-summary-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.class-summary-card .class-code {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.class-summary-card .class-name {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.class-summary-card .class-vacant {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.class-summary-card[data-class="1A"] .class-code {
    color: #f59e0b;
}

.class-summary-card[data-class="2A"] .class-code {
    color: #10b981;
}

.class-summary-card[data-class="3A"] .class-code {
    color: #3b82f6;
}

.class-summary-card[data-class="3E"] .class-code {
    color: #059669;
}

.class-summary-card[data-class="SL"] .class-code {
    color: #ef4444;
}

.chart-coaches {
    margin-top: 32px;
}

.chart-coaches h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-coaches h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.coaches-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.coach-item {
    background: var(--bg-darker);
    border-radius: 10px;
    padding: 16px;
    min-width: 100px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.coach-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.coach-item.engine-coach {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #f59e0b;
    color: white;
}

.coach-item.coach-available {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.coach-item.coach-full {
    border-color: var(--border-color);
    opacity: 0.7;
}

.coach-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.engine-coach .coach-name {
    color: white;
}

.coach-class {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.coach-vacant {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}

.vacant-available {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.vacant-zero {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.coach-item[data-class="1A"] {
    border-left: 4px solid #f59e0b;
}

.coach-item[data-class="2A"] {
    border-left: 4px solid #10b981;
}

.coach-item[data-class="3A"] {
    border-left: 4px solid #3b82f6;
}

.coach-item[data-class="3E"] {
    border-left: 4px solid #10b981;
}

.coach-item[data-class="SL"] {
    border-left: 4px solid #ef4444;
}

/* Responsive Chart */
@media (max-width: 768px) {
    .chart-container {
        padding: 20px 16px;
    }

    .chart-display-card {
        padding: 20px;
    }

    .chart-header-main h2 {
        font-size: 22px;
    }

    .class-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .coaches-container {
        gap: 8px;
    }

    .coach-item {
        min-width: 80px;
        padding: 12px;
    }

    .coach-name {
        font-size: 16px;
    }
}

/* Coach Details Modal */
.coach-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.coach-details-modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.coach-details-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 24px 32px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px 32px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.berth-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.berth-item {
    background: var(--bg-darker);
    border-radius: 12px;
    padding: 16px;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.berth-item.berth-available {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.berth-item.berth-occupied {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
    opacity: 0.8;
}

.berth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.berth-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.berth-route {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.berth-splits {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.berth-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    background: var(--bg-card);
}

.berth-split.split-available {
    background: rgba(16, 185, 129, 0.15);
    border-left: 3px solid var(--success-color);
}

.berth-split.split-occupied {
    background: rgba(239, 68, 68, 0.15);
    border-left: 3px solid var(--error-color);
}

.split-route {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.split-quota {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 8px;
    padding: 2px 6px;
    background: var(--bg-darker);
    border-radius: 4px;
}

.split-status {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.split-available .split-status {
    color: var(--success-color);
}

.split-occupied .split-status {
    color: var(--error-color);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .berth-details-grid {
        grid-template-columns: 1fr;
    }
}

/* PNR Status Styles */
.pnr-status-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.pnr-search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pnr-results {
    margin-top: 24px;
}

.pnr-status-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
}

.pnr-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.pnr-number-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pnr-number-section h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.change-pnr-btn {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.change-pnr-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.train-info-section {
    margin-bottom: 24px;
}

.train-header {
    margin-bottom: 20px;
}

.train-number-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.train-number-name h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.train-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fbbf24;
    font-weight: 600;
    font-size: 16px;
}

.journey-details {
    background: var(--bg-darker);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.route-info {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}

.station-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.station-code {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.station-name {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

.station-time {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.route-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 24px;
}

.journey-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.booking-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--bg-darker);
    border-radius: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-status-section {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-darker);
    border-radius: 12px;
}

.chart-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 16px;
}

.chart-status.chart-prepared {
    color: var(--success-color);
}

.chart-status.chart-not-prepared {
    color: var(--warning-color);
}

.checked-now {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 8px;
}

.refresh-chart-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.refresh-chart-btn:hover {
    background: var(--bg-card);
    color: var(--primary-color);
    transform: rotate(180deg);
}

.passenger-status-section {
    margin-top: 24px;
}

.passenger-status-section h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.passenger-table {
    overflow-x: auto;
}

.passenger-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-darker);
    border-radius: 12px;
    overflow: hidden;
}

.passenger-table thead {
    background: var(--primary-color);
    color: white;
}

.passenger-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.passenger-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.passenger-table tbody tr:last-child td {
    border-bottom: none;
}

.passenger-table tbody tr:hover {
    background: var(--bg-card);
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

.badge-confirmed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.badge-waiting {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.status-confirmed {
    background: rgba(16, 185, 129, 0.05);
}

.status-waiting {
    background: rgba(245, 158, 11, 0.05);
}

/* Responsive PNR Status */
@media (max-width: 768px) {
    .pnr-status-container {
        padding: 16px;
    }

    .pnr-status-card {
        padding: 20px;
    }

    .pnr-number-section h2 {
        font-size: 22px;
    }

    .route-info {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .route-arrow {
        transform: rotate(90deg);
    }

    .booking-details {
        grid-template-columns: 1fr;
    }

    .passenger-table {
        font-size: 14px;
    }

    .passenger-table th,
    .passenger-table td {
        padding: 12px 8px;
    }
}

/* Panel Animation */
@keyframes slideInRight {
    from {
        right: -420px;
    }

    to {
        right: 0;
    }
}

@keyframes slideOutRight {
    from {
        right: 0;
    }

    to {
        right: -420px;
    }
}

/* Touch-friendly improvements for mobile */
@media (hover: none) and (pointer: coarse) {

    .nav-tab,
    .btn,
    .control-btn,
    .icon-btn,
    .search-btn,
    .search-trains-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .train-card {
        cursor: default;
    }

    .train-card:active {
        transform: scale(0.98);
    }

    .station-input,
    .search-input {
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    /* Improve touch targets */
    .clear-btn,
    .swap-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Disable hover effects on touch devices */
    .train-card:hover {
        transform: none;
    }

    .btn:hover,
    .nav-tab:hover {
        transform: none;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .map-container {
        height: calc(100vh - 160px);
    }

    .header-container {
        padding: 10px 15px;
    }

    .nav-tabs {
        padding: 0 15px;
    }
}

/* Performance optimizations - merged with global * selector */

/* Smooth scrolling for better UX */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .station-search-form {
        grid-template-columns: 1fr;
    }

    .swap-btn {
        margin-bottom: 0;
        transform: rotate(90deg);
    }

    .train-route {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .route-arrow {
        transform: rotate(90deg);
        justify-content: center;
    }

    .timeline-station-main {
        flex-direction: column;
        gap: 16px;
    }

    .timeline-station-times {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .logo-section h1 {
        font-size: 20px;
    }

    .tagline {
        font-size: 10px;
    }

    .search-bar-container {
        max-width: 100%;
        order: 2;
    }

    .header-actions {
        justify-content: space-between;
        width: 100%;
        order: 3;
        flex-wrap: wrap;
        gap: 8px;
    }

    .icon-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .btn-login,
    .btn-signup {
        padding: 8px 16px;
        font-size: 13px;
    }

    .nav-tabs {
        padding: 0 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tab {
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .find-trains-container,
    .train-info-container,
    .live-status-container {
        padding: 15px 12px;
    }

    .search-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .search-card h2 {
        font-size: 24px;
    }

    .description {
        font-size: 14px;
    }

    .station-search-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .swap-btn {
        width: 100%;
        height: 44px;
        margin-bottom: 0;
        transform: rotate(90deg);
    }

    .search-trains-btn {
        width: 100%;
        padding: 14px;
        margin-bottom: 0;
    }

    .map-container {
        height: calc(100vh - 200px);
    }

    .map-controls {
        top: 10px;
        right: 10px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }

    .map-legend {
        bottom: 10px;
        left: 10px;
        padding: 12px 16px;
        font-size: 12px;
    }

    .train-card {
        padding: 16px;
    }

    .train-card-header {
        flex-direction: column;
        gap: 12px;
        align-items: start;
    }

    .train-number {
        font-size: 16px;
    }

    .train-name {
        font-size: 13px;
    }

    .train-route {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .route-arrow {
        transform: rotate(90deg);
        justify-content: center;
        padding: 8px 0;
    }

    .train-meta {
        flex-direction: column;
        gap: 16px;
    }

    .running-days {
        flex-wrap: wrap;
    }

    .day-badge {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .train-live-header {
        padding: 20px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .train-live-header h2 {
        font-size: 20px;
    }

    .train-info-section,
    .train-timeline-section {
        padding: 20px 16px;
    }

    .train-info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .current-status-bar {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
        align-items: start;
    }

    .timeline-container {
        padding-left: 30px;
    }

    .timeline-station-marker {
        left: -20px;
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .timeline-station-content {
        padding: 12px 16px;
        margin-left: 12px;
    }

    .timeline-station-main {
        flex-direction: column;
        gap: 12px;
    }

    .timeline-station-times {
        width: 100%;
        justify-content: space-between;
    }

    .timeline-time-item {
        min-width: 70px;
    }

    .results-header h3 {
        font-size: 20px;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 10px 12px;
    }

    .logo-section {
        gap: 8px;
    }

    .logo-section i {
        font-size: 24px;
    }

    .logo-section h1 {
        font-size: 18px;
    }

    .search-input {
        padding: 10px 40px 10px 12px;
        font-size: 14px;
    }

    .nav-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .nav-tab i {
        font-size: 12px;
    }

    .find-trains-container,
    .train-info-container,
    .live-status-container {
        padding: 12px 10px;
    }

    .search-card {
        padding: 16px 12px;
    }

    .search-card h2 {
        font-size: 20px;
    }

    .station-input {
        padding: 12px 36px 12px 38px;
        font-size: 14px;
    }

    .map-container {
        height: calc(100vh - 220px);
    }

    .train-card {
        padding: 12px;
    }

    .train-number {
        font-size: 14px;
    }

    .station-name {
        font-size: 14px;
    }

    .station-time {
        font-size: 18px;
    }

    .train-live-header {
        padding: 16px 12px;
    }

    .train-live-header h2 {
        font-size: 18px;
    }

    .train-info-section,
    .train-timeline-section {
        padding: 16px 12px;
    }

    .timeline-station-name {
        font-size: 14px;
    }

    .timeline-station-time {
        font-size: 16px;
    }

    .timeline-station-meta {
        font-size: 12px;
        gap: 12px;
    }

    .header-actions .btn-login,
    .header-actions .btn-signup {
        flex: 1;
        max-width: 48%;
    }

    .nav-tabs {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .logo-section h1 {
        font-size: 16px;
    }

    .search-card h2 {
        font-size: 18px;
    }

    .train-live-header h2 {
        font-size: 16px;
    }

    .btn-login,
    .btn-signup {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Train Availability Styles */
.availability-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 30px;
}

.availability-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.availability-results-card {
    margin-top: 32px;
}

.availability-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.train-info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.train-info-header h3 {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.train-number-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.route-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.route-info .station-code {
    background: var(--bg-darker);
    padding: 10px 18px;
    border-radius: 10px;
    border: 1.5px solid var(--border-light);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.route-info i {
    color: var(--primary-color);
    font-size: 20px;
}

.fare-breakup-section,
.availability-calendar-section,
.info-messages-section {
    margin-bottom: 32px;
}

.fare-breakup-section h4,
.availability-calendar-section h4,
.info-messages-section h4 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fare-breakup-section h4 i,
.availability-calendar-section h4 i,
.info-messages-section h4 i {
    color: var(--primary-color);
}

.fare-breakup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    background: var(--bg-darker);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.fare-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.fare-item.total-fare {
    grid-column: 1 / -1;
    padding-top: 20px;
    margin-top: 12px;
    border-top: 2px solid var(--primary-color);
    border-bottom: none;
}

.fare-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.fare-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.fare-item.total-fare .fare-value {
    font-size: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.availability-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.availability-day {
    background: var(--bg-darker);
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.availability-day:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.availability-day.status-available {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.availability-day.status-rac {
    border-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.availability-day.status-wl {
    border-color: var(--accent-red);
    background: rgba(239, 68, 68, 0.1);
}

.availability-day.status-regret {
    border-color: var(--border-color);
    background: rgba(148, 163, 184, 0.05);
    opacity: 0.7;
}

.day-date {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.day-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.availability-day.status-available .day-status {
    color: var(--success-color);
}

.availability-day.status-rac .day-status {
    color: var(--warning-color);
}

.availability-day.status-wl .day-status {
    color: var(--accent-red);
}

.availability-day.status-regret .day-status {
    color: var(--text-muted);
}

.day-delay {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.info-messages-section {
    background: var(--bg-darker);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.info-message {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.info-message:last-child {
    margin-bottom: 0;
}

.info-message p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
}

.error-message i {
    font-size: 24px;
}

.error-message p {
    margin: 0;
    font-weight: 500;
}

/* Optional Label */
.optional-label {
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 400;
    margin-left: 4px;
}

/* Availability Actions */
.availability-actions {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.availability-actions .search-trains-btn {
    flex: 1;
}

.secondary-btn {
    background: var(--bg-card) !important;
    border: 1.5px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
    box-shadow: none !important;
}

.secondary-btn:hover {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: var(--primary-dark) !important;
    color: var(--primary-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

/* Class Tabs */
.class-tabs-container {
    margin: 24px 0;
    border-bottom: 2px solid var(--border-color);
}

.class-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 0;
}

.class-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: -2px;
    white-space: nowrap;
}

.class-tab:hover {
    color: var(--primary-color);
    background: rgba(16, 185, 129, 0.05);
}

.class-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.1);
}

.class-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

/* Availability Train List */
.availability-train-list {
    margin-top: 32px;
    animation: fadeIn 0.3s ease-in;
}

.availability-train-list .search-card {
    margin-bottom: 0;
}

.availability-train-list h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.availability-train-list .description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.availability-train-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.availability-train-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.availability-train-card .check-availability-btn {
    width: 100%;
    margin-top: 12px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Responsive Design for Availability */
@media (max-width: 768px) {
    .availability-container {
        padding: 20px 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .availability-actions {
        flex-direction: column;
    }

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

    .train-info-header {
        width: 100%;
    }

    .route-info {
        width: 100%;
        justify-content: center;
    }

    .fare-breakup-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .availability-calendar {
        grid-template-columns: 1fr;
    }

    .availability-day {
        padding: 16px;
    }

    .class-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .class-tab {
        padding: 10px 16px;
        font-size: 13px;
        min-width: fit-content;
    }
}

/* --- Side Panel Styles (Missing) --- */
.train-info-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    /* High z-index to be above map */
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.train-info-panel.active {
    transform: translateX(0);
}

.train-panel-header {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.train-panel-title {
    display: flex;
    flex-direction: column;
}

#train-panel-number,
#station-panel-code {
    font-size: 24px;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#train-panel-name,
#station-panel-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.train-panel-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.train-panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.train-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.train-panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Major Station Markers */
.major-station-marker {
    background: transparent;
    border: none;
}

.station-icon-wrapper {
    position: relative;
    width: 24px;
    height: 24px;
    background: #e67e22;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.station-icon-wrapper:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.6);
    border-color: #f39c12;
}

.station-icon-wrapper i {
    font-size: 10px;
    color: white;
}

/* Station tooltip */
.station-name-tooltip {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    color: white !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(4px) !important;
}

.station-name-tooltip::before {
    border-top-color: rgba(15, 23, 42, 0.9) !important;
}

/* Live Board Card Style */
.live-board-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.live-board-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
    border-color: rgba(255, 255, 255, 0.1);
}

/* =========================================
/* =========================================
   Station Live Board - Centered Modal Design
   ========================================= */

#station-live-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: 650px;
    max-width: 90vw;
    height: auto;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 8px;
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    /* Ultra high z-index */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.2s ease-out;
    border: none;
}

#station-live-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header - Dark & Distinct */
#station-live-modal .train-panel-header {
    background: #0f172a !important;
    /* Force Slate 900 */
    padding: 12px 16px;
    border-bottom: 1px solid #1e293b;
    color: white !important;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#station-live-modal .train-panel-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    gap: 10px;
    align-items: center;
    color: white !important;
}

#station-live-modal .train-panel-close {
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#station-live-modal .train-panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Body Content */
#station-panel-content {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    padding: 0;
    /* Flush with edges */
}

/* Live Board Grid Table - Light Theme */
.live-board-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1fr;
    padding: 12px 20px;
    background: #f1f5f9;
    /* Slate 100 */
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    /* Slate 500 */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.live-board-list {
    display: flex;
    flex-direction: column;
}

.live-board-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1fr;
    /* Matches header */
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    /* Light border */
    align-items: center;
    transition: background 0.1s ease;
    font-size: 13px;
    background: #ffffff;
    color: #334155;
    /* Slate 700 */
}

.live-board-row:hover {
    background: #f8fafc;
    /* Very light gray hover */
}

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

/* Column Styles */
.lb-col-train {
    display: flex;
    flex-direction: column;
    padding-right: 12px;
}

.lb-train-no {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    /* Slate 800 */
    margin-bottom: 2px;
}

.lb-train-name {
    font-size: 11px;
    color: #64748b;
    /* Slate 500 */
    text-transform: uppercase;
    font-weight: 600;
}

.lb-col-time {
    font-weight: 600;
    color: #334155;
}

.lb-col-status {
    font-weight: 700;
    font-size: 12px;
}

.lb-col-pf {
    text-align: right;
    color: #475569;
    font-weight: 500;
}

/* Status Colors (Light Theme Optimized) */
.status-ontime {
    color: #16a34a;
    /* Green 600 */
}

.status-late {
    color: #dc2626;
    /* Red 600 */
}

.status-arrived {
    color: #0f172a;
    /* Slate 900 - Bold/Black */
}

/* Scrollbar for the modal */
#station-panel-content::-webkit-scrollbar {
    width: 8px;
}

#station-panel-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#station-panel-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#station-panel-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.board-train-number {
    font-size: 14px;
    font-weight: 700;
    color: #e67e22;
}

.board-train-name {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.board-pf-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.board-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-top: 4px;
}

.board-expected {
    color: var(--text-primary);
    font-weight: 600;
}

.board-status {
    font-weight: 500;
}

.status-ontime {
    color: #10b981;
}

.status-late {
    color: #ef4444;
}

.status-early {
    color: #3498db;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-indicator i {
    font-size: 6px;
    animation: flash 1.5s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ==================== Map Station Markers ==================== */
.custom-station-icon {
    background: transparent !important;
    border: none !important;
}

.station-marker-enhanced {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.station-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    position: relative;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.station-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.4);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    z-index: 1;
}

.station-marker-enhanced:hover .station-dot {
    transform: scale(1.3);
    background: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.4);
    border-color: #fff;
}

.station-marker-enhanced:hover .station-pulse {
    animation: none;
    background: rgba(0, 255, 136, 0.2);
    width: 200%;
    height: 200%;
    transition: all 0.3s ease;
}

/* Tooltip */
.station-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.9);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.station-marker-enhanced:hover .station-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px) scale(1);
}

/* Triangle for tooltip */
.station-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Live Train Progress Animation */
.live-progress-container {
    position: relative;
    height: 60px;
    /* Space between stations - adjustable */
    margin-left: 0;
    /* Aligned via flex/grid in parent usually, or specific padding */
    border-left: 2px dashed var(--border-color);
    opacity: 0.8;
    margin-left: 33px;
    /* Align with timeline dot center approx */
    overflow: visible;
}

.live-train-icon-wrapper {
    position: absolute;
    left: -13px;
    /* Center on the 2px border */
    width: 28px;
    height: 28px;
    z-index: 10;
    transition: top 1s ease-in-out;
}

.live-train-icon {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3);
    animation: trainPulse 2s infinite;
}

.live-train-icon.ghost {
    background: #64748b;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.3);
}

.live-train-icon i {
    transform: rotate(180deg);
}

@keyframes trainPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        transform: scale(0.95);
    }

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

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        transform: scale(0.95);
    }

    /* Mobile Responsiveness */
    @media (max-width: 768px) {
        .header-container {
            padding: 12px 16px;
            gap: 16px;
        }

        .logo-section i {
            font-size: 28px;
        }

        .logo-section h1 {
            font-size: 20px;
        }

        .search-bar-container {
            order: 3;
            /* Move search bar below logo and actions on mobile if needed */
            width: 100%;
            max-width: 100%;
            margin-top: 10px;
        }

        .header-actions {
            margin-left: auto;
            /* Push actions to the right */
        }

        .nav-tabs {
            padding: 8px 16px;
        }

        .main-content {
            min-height: calc(100vh - 180px);
            /* Adjust for taller header */
        }

        /* Stack split views vertically */
        .split-view {
            flex-direction: column;
        }

        .sidebar {
            width: 100%;
            height: auto;
            max-height: 50vh;
            /* Limit sidebar height on mobile */
            border-right: none;
            border-bottom: 1px solid var(--border-color);
        }

        .map-container {
            height: 50vh;
            /* Share screen with sidebar */
        }

        /* Train Cards on Mobile */
        .train-card {
            padding: 16px;
        }

        .train-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 10px;
        }

        .train-route-info {
            flex-direction: column;
            gap: 16px;
            align-items: flex-start;
        }

        /* Dialogs/Modals full width */
        .modal-content,
        .glass-panel {
            width: 95%;
            margin: 10px auto;
        }
    }