@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }

    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 0.3s;
        animation-timing-function: ease;
    }
}

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

:root {
    color-scheme: dark;

    --bg-page: #1E1E1E;
    --bg-surface: #252526;
    --bg-surface-alt: #222223;
    --border-primary: #676869;
    --border-subtle: #3B3D3F;
    --text-primary: #FFFFFF;
    --text-secondary: #D4D4D4;
    --text-muted: #B8B8B8;
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-size-h1: 28px;
    --font-size-btn-lg: 20px;
    --font-size-card-title: 16px;
    --font-size-body: 15px;
    --font-size-card-sub: 13px;
    --font-size-table: 12px;
    background-color: var(--bg-page);
}

body {
    margin: 0px;
    position: fixed;
    inset: 0px;
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-main);
}

body:has(.splash) {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.splash {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
    width: 150px;
}

.splash-text {
    text-align: center;
    max-width: 460px;
}

.splash-text h1 {
    font-size: var(--font-size-h1);
    line-height: 1.2;
    margin-bottom: 8px;
}

.splash-text p {
    font-size: var(--font-size-body);
    line-height: 1.5;
    color: var(--text-muted);
}

.btn-continu {
    margin-top: 8px;
    height: 40px;
    width: 140px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-continu a {
    color: inherit;
    text-decoration: none;
    width: 100%;
    height: 100%;
    font-size: var(--font-size-body);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-continu:hover {
    color: var(--text-primary);
    background: var(--border-primary);
}

.home-container,
.section-container,
.calendar-container {
    position: relative;
    width: calc(100% - 80px);
    height: calc(100dvh - 80px);
    margin: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.top-logo {
    width: 60px;
    height: 60px;
}

.home-container .top-logo,
.section-container .top-logo,
.calendar-container .top-logo {
    position: absolute;
    top: 0px;
    left: 0px;
}

.home-text,
.section-text,
.calendar-text {
    max-width: 540px;
    align-self: flex-end;
}

.home-text h1,
.section-text h1,
.calendar-text h1 {
    font-size: var(--font-size-h1);
    line-height: 1;
    margin-bottom: 12px;
}

.home-text p,
.section-text p,
.calendar-text p {
    font-size: var(--font-size-body);
    line-height: 1;
    color: var(--text-muted);
}

.home-actions,
.section-actions,
.calendar-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-home,
.btn-section,
.btn-calendar {
    height: 40px;
    width: 120px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-section {
    width: 145px;
}

.btn-home a,
.btn-section a,
.btn-calendar a {
    color: inherit;
    text-decoration: none;
    width: 100%;
    height: 100%;
    font-size: var(--font-size-body);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-home:hover,
.btn-section:hover,
.btn-calendar:hover {
    border: none;
    color: var(--text-primary);
    background: var(--border-primary);
}

.home-logo img {
    width: 300px;
    height: 300px;
    margin-right: 60px;
}

.section-logo img,
.calendar-logo img {
    width: 246px;
    height: 300px;
    margin-right: 60px;
}

.timetable-container,
.instructors-container {
    width: calc(100% - 80px);
    height: calc(100dvh - 80px);
    margin: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.instructors-container {
    gap: 24px;
}

.timetable-header,
.instructors-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: var(--font-size-h1);
    line-height: 1;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-nav {
    height: 40px;
    padding: 0px 16px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-nav a {
    color: inherit;
    text-decoration: none;
    width: 100%;
    height: 100%;
    font-size: var(--font-size-body);
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-nav:hover {
    color: var(--text-primary);
    background: var(--border-primary);
}

.table-wrapper {
    width: 100%;
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border-primary);
    border-radius: 10px;
}

table {
    width: 100%;
    height: 100%;
    border-collapse: separate;
    border-spacing: 0px;
    font-size: var(--font-size-table);
}

th,
td {
    padding: 6px 8px;
    border-right: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
    vertical-align: middle;
}

th:last-child,
td:last-child {
    border-right: none;
}

tbody tr:last-child th,
tbody tr:last-child td {
    border-bottom: none;
}

thead th {
    position: sticky;
    top: 0px;
    z-index: 2;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-primary);
    min-width: 72px;
}

thead th:first-child {
    left: 0px;
    z-index: 3;
}

tbody th.day-cell {
    position: sticky;
    left: 0px;
    z-index: 1;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    min-width: 90px;
}

tbody th.block-cell {
    background-color: var(--bg-page);
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

td.subject-cell {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
}

td.instructor-cell {
    background-color: var(--bg-surface-alt);
    color: var(--text-secondary);
}

td.room-cell {
    background-color: var(--bg-surface-alt);
    color: var(--text-muted);
}

tr.day-end th,
tr.day-end td {
    border-bottom: 1px solid var(--border-primary);
}

.instructors-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, 320px);
    gap: 16px;
    align-content: start;
}

.instructor-card {
    width: 320px;
    height: 112px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
    transition: border-color 0.2s ease;
}

.instructor-card:hover {
    border-color: var(--text-muted);
}

.instructor-photo {
    width: 76px;
    height: 76px;
    border-radius: 10px;
    background: transparent;
    padding: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
}

.instructor-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.instructor-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0px;
}

.instructor-name {
    font-size: var(--font-size-card-title);
    font-weight: 600;
    color: var(--text-primary);
}

.instructor-subject {
    font-size: var(--font-size-card-sub);
    line-height: 1.4;
    color: var(--text-muted);
}
