/* Base Component Styles */
body {
    --bg-pitch: var(--md-sys-color-surface, #090909);
    --surface-card: var(--md-sys-color-surface, #262626);
    --text-primary: var(--md-sys-color-on-surface, #FFFFFF);
    --text-secondary: var(--md-sys-color-on-surface-variant, #A0A0A0);
}

* {
    box-sizing: border-box;
}

/* Route Badges */
.badge-route {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: bold;
    white-space: nowrap;
}

.badge-route-lg {
    height: 56px;
    min-width: 130px;
    font-size: 28px;
    line-height: 48px;
}

.badge-route-md {
    height: 40px;
    min-width: 92px;
    font-size: 20px;
    line-height: 48px;
}

.badge-route-sm {
    height: 28px;
    min-width: 65px;
    font-size: 14px;
    line-height: 24px;
    border-radius: 5px;
    flex-shrink: 0;
}

.badge-lrt1 {
    background-color: #00834f;
    color: white;
}

.badge-lrt2 {
    background-color: #9B60B0;
    color: rgb(255, 255, 255);
}

.badge-mrt3 {
    background-color: #ffd24c;
    color: black;
}

.badge-carousel {
    background-color: #ee3124;
    color: white;
}

.badge-jeep {
    background-color: white;
    color: black;
}

/* Crowd Density Badges */
.badge-density {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 28px;
    min-width: 90px;
    padding: 0 12px;
    border-radius: 8px;
    border: 2px solid;
    font-size: 14px;
    line-height: 24px;
    white-space: nowrap;
}

.badge-density-lg {
    font-size: 20px;
    line-height: 48px;
    min-width: 128px;
}

.badge-heavy {
    background-color: #ef4444;
    border-color: #ef4444;
    color: white;
}

.badge-moderate {
    background-color: transparent;
    border-color: #f59e0b;
    color: #f59e0b;
}

.badge-light {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.badge-unknown {
    background-color: #6b7280;
    border-color: #6b7280;
    color: white;
}

/* ========== PIDS BOARD (TV Landscape) ========== */
.pids-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--md-sys-color-surface, #333333);
    color: var(--text-primary);
}

.pids-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 22px;
    border-bottom: 2px solid #444444;
}

.pids-station-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pids-station-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pids-station-name h1 {
    font-size: 36px;
    font-weight: 600;
    margin: 0;
}

.pids-transfer-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pids-transfer-info span {
    font-size: 36px;
    font-weight: 600;
}

.pids-datetime {
    width: 600px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 20px;
}

.pids-date {
    font-size: 32px;
    font-weight: 400;
}

.pids-time {
    font-size: 40px;
    font-weight: 600;
}

/* Train Sections */
.pids-trains {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pids-direction-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pids-direction-title {
    padding: 0 22px;
    margin: 15px 0;
}

.pids-direction-title h2 {
    font-size: 40px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant, #d1d5db);
    margin: 0;
}

.pids-train-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--md-sys-color-surface-variant, #444444);
    padding: 16px 22px;
    margin-bottom: 2px;
    min-height: 60px;
}

.pids-train-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pids-train-destination {
    font-size: 32px;
    min-width: 140px;
}

.pids-train-direction {
    font-size: 24px;
    color: #9ca3af;
}

.pids-train-eta {
    font-size: 32px;
    text-align: right;
    min-width: 120px;
}

/* Footer Connections */
.pids-footer {
    background-color: var(--md-sys-color-surface, #1a1a1a);
    padding: 12px 30px;
    border-top: 2px solid #444444;
}

.pids-footer h3 {
    font-size: 36px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.pids-connections {
    display: flex;
    gap: 14px;
}

/* ========== STATION CARD (Mobile Portrait) ========== */
.station-card {
    width: 100%;
    max-width: 448px;
    background-color: var(--surface-card);
    border-radius: 24px;
    padding-bottom: 24px;
    color: var(--text-primary);
    height: auto;
    min-height: fit-content;
}

.station-card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 24px;
}

.station-header-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.station-header-top .badge-route {
    margin-top: 5px;
    /* Centers badge vertically with the 32px font's first line */
}

.station-card-header h2 {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    line-height: 1.2;
}

.station-card-body {
    padding: 0px 24px;
}

.station-card-arrivals-title {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.station-arrival-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--md-sys-color-surface-variant, #444);
}

.station-arrival-row:last-child {
    border-bottom: none;
}

.station-arrival-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.station-arrival-destination {
    font-size: 20px;
    font-weight: 600;
}

.station-arrival-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.alerts-modal-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.alerts-modal-content::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.station-arrival-time {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}

.station-arrival-status {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    opacity: 0.5;
}

.station-arrival-scheduled {
    color: var(--text-secondary);
    font-size: 16px;
}

.station-view-more {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.station-view-more button {
    background-color: #444444;
    color: white;
    border: none;
    border-radius: 16px;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

/* ========== NOTIFICATION TOGGLE ========== */
.station-notify-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 0 0;
    margin-top: 20px;
    border-top: 1px solid var(--md-sys-color-surface-variant, #444);
}

.notify-label {
    font-family: 'Cabin', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #10b981;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* ========== TRAIN DETAILS CARD (Mobile Popup) ========== */
.train-details-card {
    width: 100%;
    max-width: 448px;
    background-color: var(--surface-card);
    border-radius: 24px;
    padding-top: 4px;
    color: var(--text-primary);
    padding-bottom: 24px;
    height: auto;
    min-height: fit-content;
}

.train-details-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
}

.train-details-header h2 {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
}

.train-details-body {
    padding: 0 24px;
}

.train-details-row {
    display: flex;
    justify-content: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--md-sys-color-surface-variant, #444);
}

.train-details-row:last-child {
    border-bottom: none;
}

.train-details-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.train-details-value {
    font-size: 24px;
    font-weight: 600;
}

.train-details-label {
    font-size: 16px;
    color: var(--text-secondary);
}

/* ========== MOBILE RESPONSIVENESS ========== */
@media (max-width: 600px) {

    /* Station Card */
    .station-card-header h2 {
        font-size: 24px;
        /* Scaled down from 32px */
    }

    .station-header-top .badge-route {
        margin-top: 3px;
        /* Adjust alignment for smaller text */
    }

    .station-card-header {
        padding: 20px;
    }

    .station-card-body {
        padding: 0 20px;
    }

    /* Train Details Card */
    .train-details-header h2 {
        font-size: 24px;
        /* Scaled down from 32px */
    }

    .train-details-header {
        padding: 16px 20px;
        gap: 12px;
    }

    .train-details-value {
        font-size: 20px;
        /* Scaled down from 24px */
    }

    .train-details-row {
        padding: 12px 0;
        /* Reduced padding */
    }
}