:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: white;
    --text-primary: #333;
    --text-secondary: #999;
    --border-color: #ddd;
    --header-bg: #333;
    --header-text: white;
    --hover-bg: #555;
    --row-hover: #f9f9f9;
    --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #999;
    --border-color: #444;
    --header-bg: #1a1a1a;
    --header-text: #e0e0e0;
    --hover-bg: #3a3a3a;
    --row-hover: #3a3a3a;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: "Oxanium", sans-serif;
    padding: 20px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

.navbar {
    font-family: "Oxanium", sans-serif;
    background-color: #002C49;
    padding: 0;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-container {
    font-family: "Oxanium", sans-serif;
    max-width: 2400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar-brand {
    color: white;
    font-size: 48px;
    font-weight: bold;
    text-decoration: none;
    padding: 15px 0;
}

.navbar-brand:hover {
    color: #FFB703;
}

.navbar-menu {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.navbar-menu a:hover {
    background-color: #FFB703;
    color: black;
}

.about-container {
    font-family: "Oxanium", sans-serif;
    max-width: 800px;
    margin: 40px auto;
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
}

ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
    color: #555;
}

.contact-info {
    font-family: "Oxanium", sans-serif;
    background-color: #f9f9f9;
    padding: 20px;
    border-left: 4px solid #d32f2f;
    margin-top: 30px;
}

/* Dark Mode About Styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .about-container {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode h1,
body.dark-mode h2 {
    color: #FFB703;
}

body.dark-mode p,
body.dark-mode li {
    color: #b0b0b0;
}

body.dark-mode .contact-info {
    background-color: #333;
    border-left-color: #FFB703;
}


.header-container {
    font-family: "Oxanium", sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1 {
    font-family: "Oxanium", sans-serif;
    color: var(--text-primary);
    margin: 0;
}

.dark-mode-btn {
    padding: 10px 15px;
    background-color: var(--header-bg);
    color: var(--header-text);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.dark-mode-btn:hover {
    background-color: var(--hover-bg);
}

.filter-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    max-width: 1000px;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.filter-input::placeholder {
    color: var(--text-secondary);
}

.departure-board-container {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px var(--shadow);
}

.departure-board-title {
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.departure-board-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.station-dropdown {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.stop-input {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.stop-input::placeholder {
    color: var(--text-secondary);
}

.stop-input:disabled {
    background-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.stop-apply-btn {
    padding: 10px 20px;
    background-color: var(--header-bg);
    color: var(--header-text);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.stop-apply-btn:hover:not(:disabled) {
    background-color: var(--hover-bg);
}

.stop-apply-btn:disabled {
    background-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}


#departureBoard {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    margin-top: 15px;
}

#departureBoard thead {
    background-color: var(--header-bg);
    color: var(--header-text);
}

#departureBoard th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
}

#departureBoard td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

#departureBoard tbody tr:hover {
    background-color: var(--row-hover);
}

/* Headers */
#departureBoard thead th:nth-child(1),
#departureBoard thead th:nth-child(2),
#departureBoard thead th:nth-child(5),
#departureBoard thead th:nth-child(6),
#departureBoard tbody td:nth-child(1),
#departureBoard tbody td:nth-child(2),
#departureBoard tbody td:nth-child(5),
#departureBoard tbody td:nth-child(6) {
    text-align: left;
}

#departureBoard thead th:nth-child(4),
#departureBoard thead th:nth-child(7),
#departureBoard tbody td:nth-child(4),
#departureBoard tbody td:nth-child(7) {
    text-align: right;
}

/*#departureBoard thead th:nth-child(7),*/
/*#departureBoard thead td:nth-child(7) {*/
/*    text-align: center;*/
/*}*/

/* Scheduled */
#departureBoard tbody td:nth-child(2) {
    font-size: 1.2em;
}

/* Destination */
#departureBoard tbody td:nth-child(5) {
    font-size: 1.2em;
}

/* Stops list*/
#departureBoard tbody td:nth-child(6) {
    font-size: 0.85em;
    color: #808080;
}

/* Expected */
#departureBoard tbody td:nth-child(7) {
    font-size: 1.2em;
}

/* Bay */
#departureBoard tbody td:nth-child(3) {
    padding: 0;
}

#departureBoard tbody td:nth-child(3) > div {
    display: flex;
    align-items: center;
    justify-content: center;
}

#departureBoard tbody td:nth-child(3) .boxed-text {
    background-color: white;
    color: black;
    font-weight: bold;
    font-size: 1.2em;
    padding: 2px 12px;
    border-radius: 8px;
    max-width: 70%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}


.clock {
    text-align: center;
    margin-top: 20px;
    font-size: 3.0em;
    font-weight: bold;
    font-family: "Nova Mono", monospace;
}

.clock-seconds {
    font-size: 0.8em;
}

.legend-container {
    margin-bottom: 20px;
    margin-top: 20px;
    padding: 15px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px var(--shadow);
}

.legend-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
}

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

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 4px var(--shadow);
    transition: background-color 0.3s;
}


thead {
    background-color: var(--header-bg);
    color: var(--header-text);
}

th {
    padding: 12px;
    text-align: left;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

#busTable th:hover {
    background-color: var(--hover-bg);
}

#busTable th::after {
    content: ' ⇅';
    font-size: 12px;
    opacity: 0.5;
    margin-left: 5px;
}

#busTable th.sorted-asc::after {
    content: ' ↑';
    opacity: 1;
}

#busTable th.sorted-desc::after {
    content: ' ↓';
    opacity: 1;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

td:nth-child(2),
th:nth-child(2) {
    text-align: center;
}

td:nth-child(3),
th:nth-child(3) {
    text-align: right;
}

td:nth-child(5),
th:nth-child(5) {
    text-align: right;
}

td:nth-child(7),
th:nth-child(7) {
    text-align: right;
}


tbody tr:hover {
    background-color: var(--row-hover);
}

.route-corridor {
    background-color: #71A434;
    color: white;
    font-weight: bold;
    font-size: large;
}

.route-local {
    background-color: #814099;
    color: white;
    font-weight: bold;
    font-size: large;
}

.route-express {
    background-color: #CD173F;
    color: white;
    font-weight: bold;
    font-size: large;
}

.route-regional {
    background-color: #00254B;
    color: white;
    font-weight: bold;
    font-size: large;
}

.route-rural {
    background-color: #84BCE6;
    color: #000;
    font-weight: bold;
    font-size: large;
}

.route-ecs {
    background-color: #848484;
    color: white;
    font-weight: bold;
    font-size: large;
}

.on-time {
    background-color: #90EE90;
    color: #000;
}

.very-early {
    background-color: #8B0000;
    color: white;
}

.early {
    background-color: #FF6B6B;
    color: #000;
}

.late {
    background-color: #FFFF00;
    color: #000;
}

.very-late {
    background-color: #FFA500;
    color: #000;
}

.unknown {
    background-color: #CCCCCC;
    color: #333;
}

.aw-dep {
    background-color: #0099AA;
    color: white;
}

.ad-sev {
    background-color: #50AA50;
    color: white;
}

.cancelled {
    background-color: #FF0000;
    color: white;
}

#earlyCount {
    background-color: #FF6B6B;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

#ontimeCount {
    background-color: #90EE90;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

#lateCount {
    background-color: #FFFF00;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

#vearlyCount {
    background-color: #8B0000;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

#vlateCount {
    background-color: #FFA500;
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}


.error {
    color: #d32f2f;
    padding: 20px;
    font-size: 16px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-primary);
    font-size: 16px;
}

@keyframes rollUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.departure-board-container table {
    overflow: hidden;
}

#departureBoardBody tr.animate-roll-up {
    animation: rollUp 1.6s ease-out forwards;
}

#departureBoardBody tr td {
    overflow: hidden;
}

.hidden-column {
    display: none !important;
}
