:root {
    --tab-bg-color: #13653f;
    --tab-active-bg-color: #5cb85c;
    --tab-text-color: #fff;
    --calendar-color: #333;
    --calendar-link-text-color: #0074a2;
    --calendar-border-color: #212529;
    --calendar-header-bg-color: #13653f;
    --calendar-header-text-color: #fff;
    --event-cell-even: #f0f0f0;
    --event-cell-odd: #fff;
    --column-width: 104px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
}

.app-shell {
    width: 100%;
    padding-bottom: 45px;
}

.app-shell.is-loading {
    padding-bottom: 0;
}

.schedule-wrapper {
    display: flex;
}

.app-shell.is-loading #schedule-header,
.app-shell.is-loading .schedule-wrapper {
    display: none;
}

.section {
    margin: 1rem 0;
}

.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.danger {
    margin: 1rem;
    padding: 0.75rem 1rem;
    background: #f8d7da;
    color: #842029;
    border-radius: 4px;
}

#track-key {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    justify-content: center;
    min-height: 1.5rem;
    padding: 0;
    margin: 0 0 1rem;
}

#track-key li:last-child {
    display: none;
}

#track-key .track-color {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    vertical-align: middle;
    border: 2px solid #000;
}

.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.buttons a {
    display: block;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: #13653f;
    color: #fff;
    border-radius: 3px;
    transform: scale(1);
    transition: transform 100ms linear;
}

.buttons a:hover {
    transform: scale(1.05);
}

.schedule-container {
    width: 100%;
    margin: 0 auto;
}

#tab-container {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
}

#tab-container .tab {
    flex-grow: 1;
    margin-right: 5px;
    display: inline-block;
    padding: 0.7em;
    color: var(--tab-text-color);
    text-decoration: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    background-color: var(--tab-bg-color);
    transition: all 300ms ease;
}

#tab-container .tab.active,
#tab-container .tab:hover {
    padding-top: 0.9em;
}

#tab-container .tab.active {
    background: var(--tab-active-bg-color);
}

#tab-container .tab small {
    padding-top: 0.4em;
    display: inline-block;
    border: 2px solid;
    border-radius: 4px;
    width: 2em;
    height: 2em;
    text-align: center;
    margin-right: 1em;
    line-height: 1em;
}

.calendar-container {
    width: 100%;
    border: 1px solid var(--calendar-border-color);
    overflow: auto;
}

.calendar,
.agenda {
    font-size: 0.85em;
    line-height: 1em;
    color: var(--calendar-color);
}

.calendar a,
.agenda a {
    color: var(--calendar-link-text-color);
}

.calendar {
    position: relative;
}

.calendar .cell {
    position: absolute;
    width: var(--column-width);
    height: 25px;
    margin: 0;
    line-height: 25px;
    padding: 0 6px;
    border-right: 1px solid var(--calendar-border-color);
}

.calendar .cell.bg {
    border-right: 0;
}

.calendar .cell.top-cell,
.agenda .cell.top-cell {
    background-color: var(--calendar-header-bg-color);
    color: var(--calendar-header-text-color);
    border-color: var(--calendar-border-color);
}

.calendar .top-cell {
    height: 55px;
}

.calendar .room-header {
    font-size: 1em;
    text-align: center;
    line-height: 1.1em;
    padding-top: 0.5em;
}

.calendar .even-cell {
    background: var(--event-cell-even);
}

.calendar .odd-cell {
    background: var(--event-cell-odd);
}

.calendar .left-cell {
    width: var(--column-width);
}

.calendar.personal .cell,
.calendar.personal .left-cell {
    width: calc(var(--column-width) * 2);
}

.calendar.personal .cell.bg {
    width: 100%;
}

.calendar.personal .room-header {
    font-size: 1.5em;
}

.calendar .current-time-line {
    position: absolute;
    left: 0;
    height: 25px;
    width: 100%;
    background-color: var(--tab-active-bg-color);
    opacity: 0.5;
    pointer-events: none;
}

.calendar.personal .current-time-line.day-column-line {
    width: 201px;
}

.calendar .event,
.agenda .event {
    background: #ffdbdb;
    border: 2px solid #000;
    border-radius: 2px;
    color: #000;
    font-family: Verdana, sans-serif;
}

.calendar .event {
    position: absolute;
    width: 99px;
    cursor: pointer;
    overflow: hidden;
    margin-left: 2px;
    font-size: 10px;
    line-height: 9px;
    padding: 2px;
    hyphens: auto;
    overflow-wrap: anywhere;
}

.calendar .event-icon {
    margin: 0 0 2px 0.2em;
    float: right;
    font-size: 1.3em;
    line-height: 1;
}

.agenda {
    min-height: 300px;
}

.agenda .top-cell {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    min-height: 55px;
    gap: 0.5rem;
    padding: 0.75rem;
}

.agenda .form-control,
.agenda .form-select {
    padding: 0.4rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.agenda .event {
    margin: 1rem;
    line-height: 1.2em;
    padding: 0.75rem;
}

.agenda-event-wrapper {
    transition: opacity 0.2s ease-in-out;
}

.event-desc .title,
.agenda .event .title {
    font-weight: bold;
    font-size: 1.3em;
    line-height: 1.5em;
}

.agenda .description,
.event-desc .description {
    padding: 1em 0;
    white-space: pre-wrap;
    line-height: 1.4;
}

.meta-details > div,
.notice {
    margin-top: 0.35rem;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.notice .tag-icon {
    width: 1.5rem;
    flex: 0 0 1.5rem;
    text-align: center;
    margin-top: 0.1rem;
}

.notice > div {
    flex: 1 1 auto;
}

.event-desc {
    position: absolute;
    z-index: 20;
    width: 300px;
    background: #fff;
    color: #222;
    border: 1px solid #888;
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.event-desc .close-event {
    float: right;
    cursor: pointer;
}

.event-desc .close-event::before {
    content: "✕";
}

.event-desc .add-to,
.event-desc .remove-from,
.btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: 4px;
    background: #6c757d;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.event-desc .add-to:hover,
.event-desc .remove-from:hover,
.btn:hover {
    background: #5a6268;
}

.text-center {
    text-align: center;
}

#spin-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    z-index: 50;
}

#spin-container[hidden] {
    /* biome-ignore lint/complexity/noImportantStyles: Needed as workaround. */
    display: none !important;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.35rem solid #ccc;
    border-top-color: #13653f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 767px) {
    #tab-container .tab {
        font-size: 0.8em;
    }
}

@media (max-width: 500px) {
    #tab-container {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 5px;
    }

    #tab-container .tab {
        margin-right: 0;
    }
}
