/* Copyright (c) 2026 Bluebonnet Studios
   SPDX-License-Identifier: Apache-2.0 */

/* General Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    background: linear-gradient(45deg, #e0f7fa, #ffe0b2, #c8e6c9, #f3e5f5);
    color: #333;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#app {
    width: 95%;
    max-width: 500px;
    padding: 20px;
    background: inherit;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 10px;
    border: 1px solid #e5e5e5;
    position: relative;
}

h1 {
    font-size: 26px;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 10px;
}

#current-time {
    font-size: 80px;
    color: #1c1c1e;
    margin-bottom: 20px;
}

h2 {
    font-size: 22px;
    font-weight: 500;
    color: #1c1c1e;
    margin: 15px 0;
}

button {
    padding: 14px 22px;
    margin: 10px 5px;
    font-size: 28px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background-color: #b7f3b7;
    color: #1c1c1e;
    width: calc(100% - 20px);
    max-width: 240px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #76c76b;
}

select {
    padding: 14px 18px;
    margin: 15px 0;
    font-size: 18px;
    border-radius: 10px;
    border: 1px solid #d1d1d6;
    width: 100%;
    max-width: 240px;
    background-color: #f2f2f7;
    color: #1c1c1e;
    appearance: none;
}

label {
    display: block;
    margin-top: 20px;
    font-size: 20px;
    font-weight: 500;
    color: #1c1c1e;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 20px;
    border-radius: 20px;
    width: 80%;
    max-width: 350px;
    text-align: left;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-height: 80%;
    overflow: auto;
    position: relative;
}

/* Small "X" close button at the top right */
.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px; /* Small size */
    height: 20px;
    padding: 0;
    font-family: inherit;
    font-size: 20px; /* Small "X" */
    background: none; /* No background */
    border: none; /* No border */
    color: #555; /* Neutral color */
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

/* Darken the "X" slightly on hover */
.close-modal:hover {
    color: #000;
}

/* Ensure modal content does not shift due to "X" */
.modal-content {
    position: relative;
    padding: 20px;
    padding-top: 30px; /* Keeps content aligned */
    border-radius: 12px;
    text-align: center;
}

/* Updated styling for the "Next Three Departures" modal */
#next-departures-modal .modal-content {
    padding-top: 10px;
    padding-bottom: 15px;
    padding-left: 20px;
    padding-right: 20px;
}

#next-departures-modal h3 {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 24px;
    text-align: center;
    padding: 5px 0;
}

/* Next departures content styling */
#next-departures-content {
    font-size: 20px;
    line-height: 1.4;
    text-align: center;
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Full Schedule Modal Grid Layout for Three Columns */
.full-schedule-container {
    display: flex;
    gap: 20px;
    padding: 10px;
    justify-content: space-between;
}

.schedule-column {
    flex: 1;
}

.schedule-column h4 {
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.schedule-content {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    gap: 5px;
    text-align: center;
}

/* "Updated: X" link and unofficial-source disclaimer */
.schedule-updated {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.schedule-updated a {
    color: #666;
    text-decoration: underline;
}

.unofficial-notice {
    font-size: 12px;
    color: #8a6d00;
    background-color: #fff8e1;
    border-radius: 8px;
    padding: 6px 10px;
    margin: 8px auto 0;
    max-width: 320px;
}

/* Logo Styling */
#logo {
    width: 200px;
    margin: 20px auto;
}

/* About Button Image Styling */
.about-button-image {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.about-button-image:hover {
    opacity: 0.7;
}

/* About Modal Styling */
#about-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

#about-modal .modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 20px;
    border-radius: 20px;
    width: 50%;
    max-width: 350px;
    text-align: left;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#about-description a {
    color: #007aff;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.about-copyright {
    font-size: 12px;
    color: #8e8e93;
    margin-top: 14px;
}

.about-copyright a {
    color: #8e8e93;
    text-decoration: underline;
}

#about-description a:hover {
    color: #005ecb;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    #app {
        width: 95%;
        padding: 15px;
    }

    h1 {
        font-size: 22px;
    }

    #current-time {
        font-size: 80px;
    }

    h2 {
        font-size: 20px;
    }

    button {
        font-size: 16px;
        max-width: 100%;
    }

    select {
        font-size: 16px;
        max-width: 100%;
    }

    .modal-content {
        width: 90%;
        margin: 0 auto;
        top: 20%;
        transform: translateY(0);
    }

    .full-schedule-container {
        flex-direction: column;
        gap: 10px;
    }
}