:root {
    --rbs-teal: #2d4a4d;
    --rbs-gold: #c9a227;
    --rbs-cell: #dcdcdc;
    --rbs-cell-alt: #ececec;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #f0f0f0;
    font-family: AvertaCY-regular, AvertaCY, Averta, Arial, Helvetica, sans-serif;
    overflow: hidden;
}

.page {
    width: 100%;
    max-width: none;
    height: 100vh;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

body {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
}

.title-bar {
    position: relative;
    background: var(--rbs-teal);
    color: #fff;
    text-align: center;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: clamp(12px, 1.6vh, 22px) 0;
    flex: 0 0 auto;
}

.title-bar img.RBS-logo {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    height: clamp(64px, 4vh, 90px);
    width: auto;
}

.schedule-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

table.schedule {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
table.schedule th,
table.schedule td {
    border: 2px solid #fff;
    padding: clamp(10px, 1.5vh, 24px) clamp(8px, 1vw, 20px);
    text-align: center;
    vertical-align: middle;
}

table.schedule thead th {
    background: var(--rbs-gold);
    color: #fff;
    text-transform: uppercase;
    font-size: clamp(0.85rem, 1.1vw, 1.15rem);
}

table.schedule tbody th {
    background: var(--rbs-gold);
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    font-size: clamp(0.85rem, 1vw, 1.1rem);
}

table.schedule tbody td {
    background: var(--rbs-cell);
    font-size: clamp(0.75rem, 0.95vw, 1rem);
}

table.schedule tbody td .course {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

table.schedule tbody td .teacher {
    display: block;
    color: #555;
    font-size: 0.85em;
    margin-top: 2px;
}

table.schedule tbody td .room {
    display: block;
}

table.schedule tbody td .group {
    display: block;
    font-style: italic;
}

/* 2800px, not 1800px: ordinary desktop monitors (1920px, 2560px, even
   most ultrawides) are well under this, so they keep the normal-sized
   base values and look like a regular webpage viewed up close. Only the
   actual 4K kiosk (confirmed running at 3840px CSS width, 100% OS
   scaling) crosses this and gets the "TV viewed from across a room"
   sizing below. Matches pmba.css's own breakpoint at the same value. */
@media (min-width: 2800px) {
    .title-bar {
        font-size: clamp(3rem, 3.7vw, 5.7rem);
        padding: clamp(23px, 2.3vh, 41px) 0;
    }

    table.schedule th,
    table.schedule td {
        padding: clamp(23px, 2.3vh, 46px) clamp(18px, 1.4vw, 37px);
    }

    table.schedule thead th {
        font-size: clamp(1.5rem, 1.6vw, 2.3rem);
    }

    table.schedule tbody th {
        font-size: clamp(1.4rem, 1.5vw, 2.2rem);
    }

    table.schedule tbody td {
        font-size: clamp(1.25rem, 1.4vw, 1.95rem);
    }
    .title-bar img.RBS-logo {
        height: clamp(90px, 6vh, 130px);
        left: 32px;
    }
}

@media (max-width: 700px) {
    html, body {
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    body {
        display: block;
    }

    .page {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 100vh;
        padding: 10px 12px;
    }

    .title-bar {
        font-size: 1.4rem;
        padding: 12px 0;
    }

    table.schedule {
        min-width: 640px;
        height: auto;
    }

    table.schedule th,
    table.schedule td {
        padding: 8px 6px;
    }

    table.schedule thead th,
    table.schedule tbody th {
        font-size: 0.8rem;
    }

    table.schedule tbody td {
        font-size: 0.75rem;
    }

    .title-bar img.RBS-logo {
        height: 18px;
        left: 10px;
    }
}

/* Manual override for the automatic time-based swap between this page and
   pmba_view.php - kept small and low-contrast since the primary use case
   is a passive kiosk display, not a page someone is meant to click around. */
.page-swap-link {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 20px;
    opacity: 0.55;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.page-swap-link:hover,
.page-swap-link:focus {
    opacity: 1;
    background: rgba(0, 0, 0, 0.75);
}


.page-swap-link--top {
    position: absolute;
    top: 50%;
    right: 25px;
    bottom: auto;
    transform: translateY(-50%);
    background: var(--rbs-gold);
    border: none;
    border-radius: 6px;
    padding: 15px 23px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 1;
}

.page-swap-link--top:hover,
.page-swap-link--top:focus {
    background: var(--rbs-teal);
}
