:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-color: #f8fafc;
    --text-secondary: #94a3b8;
    --font-family: 'Inter', sans-serif;
    --header-height: 80px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #1e293b, #0f172a);
}

/* Container for all slides */
.fullscreen-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Individual Class Slide */
.class-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.class-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Multi-Class Grid */
.multi-class-grid {
    display: grid;
    height: 100%;
    width: 100%;
    gap: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.class-column {
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.class-header-small {
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary-color);
    font-weight: 800;
    font-size: 1.5rem;
    text-align: center;
    padding: 0.5rem;
    text-transform: uppercase;
    border-bottom: 2px solid var(--primary-color);
}

.days-vertical-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.day-block {
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.day-title-small {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 5px;
    text-align: center;
}

.lessons-container-small {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 5px;
}

.lesson-row-small {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.85rem;
    padding: 2px 0;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lesson-row-small:last-child {
    border-bottom: none;
}

.lesson-row-small .time {
    color: var(--primary-color);
    font-weight: 600;
    width: 85px;
    text-align: left;
    white-space: nowrap;
    flex-shrink: 0;
}

.lesson-row-small .subj {
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    flex: 1;
    min-width: 0;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--text-secondary);
}

/* Tabs & Sheet Items */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.sheet-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sheet-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: white;
}

/* Search Input */
.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: white;
    font-family: var(--font-family);
    width: 200px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
    width: 250px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Hamburger Menu Button */
.hamburger-btn {
    position: fixed;
    top: 15px;
    left: 20px;
    /* Moved to Left */
    right: auto;
    z-index: 1001;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    padding: 0;
}

.hamburger-btn span {
    width: 20px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Header Controls Panel */
.header-controls {
    position: fixed;
    top: 65px;
    left: 20px;
    /* Moved to Left */
    right: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Align Left */
    gap: 10px;
    background: rgba(15, 23, 42, 0.95);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.admin-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.admin-link:hover {
    color: var(--secondary-color);
}

/* Shift Selector */
.shift-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.shift-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shift-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.shift-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-input {
        width: 150px;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .search-input:focus {
        width: 180px;
    }
}

@media (max-width: 480px) {
    .header-controls {
        top: 65px;
        left: 15px;
        /* Left */
        right: auto;
        bottom: auto;
        transform: none;
        align-items: flex-start;
    }

    .hamburger-btn {
        top: 15px;
        left: 15px;
        /* Left */
        right: auto;
        bottom: auto;
        transform: none;
    }

    .search-input {
        width: 200px;
    }

    .search-input:focus {
        width: 220px;
    }
}

/* --- Телефон --- */
/* Слайд-шоу на телефоне не годится: свой класс пришлось бы ждать
   до 36 слайдов по 15 секунд. Здесь — обычный прокручиваемый список. */
@media (max-width: 767px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }


    .fullscreen-container {
        height: auto;
        min-height: 100vh;
        padding: 66px 10px 24px;
    }

    .mobile-list {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .mobile-class {
        background: var(--card-bg);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        overflow: hidden;
    }

    .mobile-class .class-header-small {
        font-size: 1.2rem;
        padding: 0.6rem;
    }

    /* Дни перестают делить экран поровну и просто идут друг за другом */
    .mobile-class .days-vertical-list,
    .mobile-class .lessons-container-small {
        display: block;
        overflow: visible;
    }

    .mobile-class .day-block {
        flex: none;
    }

    .mobile-class .lessons-container-small {
        padding: 4px 10px 8px;
    }

    .mobile-class .lesson-row-small {
        justify-content: flex-start;
        align-items: flex-start;
        gap: 10px;
        padding: 7px 0;
        font-size: 0.9rem;
    }

    .mobile-class .lesson-row-small .time {
        width: 74px;
        font-size: 0.78rem;
        padding-top: 2px;
    }

    /* Длинные названия предметов переносятся, а не обрезаются */
    .mobile-class .lesson-row-small .subj {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .loading {
        font-size: 1.1rem;
        width: 80%;
        text-align: center;
    }

    .hamburger-btn {
        top: 12px;
        left: 12px;
        right: auto;
    }

    .header-controls {
        top: 60px;
        left: 12px;
        right: 12px;
    }

    .search-input,
    .search-input:focus {
        width: 100%;
    }
}