:root {
    --primary-color: #4e6cef;
    --primary-dark: #3a50b2;
    --secondary-color: #f3f4f6;
    --text-color: #333;
    --light-text: #666;
    --white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 60px; /* Space for footer if needed */
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

#play_store_banner img {
    height: 30px;
    vertical-align: middle;
    margin-left: 10px;
}

/* Navigation Tabs (Main) */
nav.main-nav {
    background-color: var(--white);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: sticky;
    top: 56px; /* Adjust based on header height */
    z-index: 999;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

nav.main-nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
    min-width: 100%;
}

nav.main-nav li {
    flex: 1;
    text-align: center;
    max-width: 200px;
}

nav.main-nav a {
    display: block;
    padding: 1rem 0.5rem;
    text-decoration: none;
    color: var(--light-text);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

nav.main-nav a:hover {
    color: var(--primary-color);
    background-color: rgba(78, 108, 239, 0.05);
}

nav.main-nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Container */
.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 15px;
}

/* Sub-tabs (Destination) */
.distination_tab {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 5px;
    box-shadow: var(--shadow);
}

.distination_tab a {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    border-radius: var(--radius);
    color: var(--light-text);
    transition: all 0.2s ease;
    text-decoration: none; /* Add this */
}

.distination_tab a.selected {
    background-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
}

/* Cards / Lists */
.countdown_list, .timetable_list, .calendar_content {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
}

.countdown_todays_timetable, .timetable_todays_timetable {
    text-align: center;
    margin-bottom: 15px;
    font-weight: 500;
    color: var(--light-text);
}

/* Countdown Items */
.countdown_list ul {
    list-style: none;
}

.departure_group {
    border-bottom: 1px solid var(--border-color);
    padding: 15px;
    transition: background-color 0.2s;
}

.departure_group:last-child {
    border-bottom: none;
}

.departure_group:hover {
    background-color: #f9fafb;
}

.departure_group a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column; /* Mobile first stack */
    align-items: flex-start;
}

@media (min-width: 400px) {
    .departure_group a {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.departure_time {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-right: 15px;
}

.departure_lator_text_color {
    color: var(--light-text);
    font-size: 0.9rem;
}

.deparure_lator {
    font-weight: bold;
    margin-left: 5px;
}

/* Countdown Colors */
.departure_lator_text_color.red .deparure_lator { color: #e53e3e; }
.departure_lator_text_color.yellow .deparure_lator { color: #d69e2e; }
.departure_lator_text_color.green .deparure_lator { color: #38a169; }

/* Timetable */
.timetable_header {
    padding: 15px;
    background-color: var(--white);
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    margin-top: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timetable_header::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s;
}

/* This assumes the JS toggles visibility of the next element */
/* We might need to adjust JS to add an active class to header for rotation */

.timetable table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    margin-top: 5px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.timetable th, .timetable td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.timetable th {
    background-color: #f8f9fa;
    font-weight: 600;
    width: 60px;
}

.timetable td:last-child {
    text-align: left;
    letter-spacing: 1px;
}

/* Calendar */
.calendar_diagram_name {
    width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.calendar_diagram_name td {
    padding: 10px;
    text-align: center;
    color: var(--white);
    font-size: 0.9rem;
}

.calendar_header {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 20px 0 10px;
}

.calendar table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    table-layout: fixed; /* Equal width columns */
}

.calendar th, .calendar td {
    padding: 10px 5px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.calendar th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Calendar Colors */
.white { background-color: #fff; color: #333 !important; }
.pink { background-color: #fca5a5; } /* Red-300 */
.sky_blue { background-color: #7dd3fc; } /* Sky-300 */
.dark_gray { background-color: #9ca3af; } /* Gray-400 */
.orange { background-color: #fdba74; } /* Orange-300 */
.light_gray { background-color: #f3f4f6; }
.gray { background-color: #e5e7eb; }

/* Utility */
.invisible {
    display: none !important;
}

/* Loading */
#loading {
    text-align: center;
    padding: 40px;
    color: var(--light-text);
}
