﻿/* Глобальные стили */
body {
    background: linear-gradient(135deg, #f0f2f5 0%, #e6f4ea 100%);
    font-family: 'Montserrat', Arial, sans-serif;
    color: #000000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('/fonts/Montserrat-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

footer {
    text-align: center;
    margin-top: 20px;
}

    footer .btn-primary {
        display: inline-block;
        margin: 0 auto;
    }

/* Общие элементы */
.container {
    background-color: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 1200px;
    width: 90%;
    margin: 20px auto;
}

.btn-primary {
    background-color: #00A859;
    border-color: #00A859;
    color: #FFFFFF;
    border-radius: 5px;
    padding: 10px 20px;
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .btn-primary:hover {
        background-color: #008C47;
        border-color: #008C47;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }

.download-btn {
    display: none;
}

.logo-link {
    pointer-events: none;
}

.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #00A859;
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: none;
    transition: opacity 0.3s;
    opacity: 0.8;
}

    .scroll-top-btn:hover {
        opacity: 1;
        background-color: #008C47;
    }

    .scroll-top-btn.visible {
        display: block;
    }

.btn-danger {
    background-color: #cb2c39;
    border-color: #cb2c39;
    color: #FFFFFF;
    border-radius: 5px;
    padding: 5px 10px;
    transition: background-color 0.3s, box-shadow 0.3s, transform 0.3s;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: 10px;
}

    .btn-danger:hover {
        background-color: #a1232f;
        border-color: #a1232f;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }

/* Шапка */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 600px;
}

.logo-item {
    max-width: 150px;
    max-height: 75px;
    object-fit: contain;
}

.logo-container-anim {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 1200px;
    max-width: 100%;
    gap: 0;
}

.animated-logo-left {
    width: 550px;
    height: 300px;
    object-fit: contain;
}

.animated-logo-right {
    width: 580px;
    height: 220px;
    object-fit: contain;
}

.header-background {
    position: relative;
    background-image: url('/images/background.gif');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    box-sizing: border-box;
}

    .header-background::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0);
        z-index: 1;
    }

    .header-background > * {
        position: relative;
        z-index: 2;
    }

.content-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

.qr-container {
    position: fixed;
    top: 30px;
    right: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background-color: #FFFFFF;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s;
    opacity: 0.9;
    z-index: 1000;
    max-width: 120px;
}

    .qr-container:hover {
        opacity: 1;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

#qrcode {
    width: 100px;
    height: 100px;
}

.qr-text {
    font-size: 10px;
    color: #20586b;
    text-align: center;
    font-weight: 500;
    margin: 0;
    line-height: 1.2; /* Уменьшаем межстрочный интервал для компактности */
    max-width: 120px; /* Ограничиваем ширину текста */
    word-wrap: break-word; /* Перенос слов */
    hyphens: auto;
}

select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 200px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
}

    select:hover {
        border-color: #00A859;
        box-shadow: 0 0 5px rgba(0, 168, 89, 0.3);
    }

    select:focus {
        outline: none;
        border-color: #00A859;
        box-shadow: 0 0 5px rgba(0, 168, 89, 0.5);
    }

.datetime-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
}

.current-date {
    font-weight: 500;
    margin: 0;
    background-color: rgba(230, 244, 234, 0.9);
    padding: 4px 8px;
    border-radius: 5px;
    color: #20586b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.current-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #E6F4EA;
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
    color: #00A859;
    transition: transform 0.2s ease;
}

    .current-time:hover {
        transform: scale(1.05);
    }

#live-time {
    font-size: 18px;
    color: #20586b;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
}

.timer-text {
    font-size: 14px;
    color: #00A859;
}

/* Бегущая строка */
.marquee-container {
    width: 100%;
    overflow: hidden;
    background-color: #E6F4EA;
    padding: 10px 0;
    margin-bottom: 20px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.marquee-text {
    display: inline-block;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
}

    .marquee-text span {
        margin-right: 50px;
        color: #cb2c39;
        font-weight: bold;
        font-size: 16px;
    }

    .marquee-text:hover {
        animation-play-state: paused;
    }

@keyframes marquee {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Таблица */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

    .table th,
    .table td {
        border: 1px solid #ddd;
        vertical-align: top;
        text-align: center;
    }

    .table th {
        background-color: #cb2c39;
        font-weight: bold;
        color: #ffffff;
        padding: 4px;
    }

        .table th:first-child,
        .table td:first-child {
            width: 80px;
            padding: 0;
        }

        .table th:not(:first-child),
        .table td:not(:first-child) {
            width: 100px;
            padding: 0;
        }

    .table tr.date-row td {
        font-size: 12px;
        font-weight: bold;
        padding: 4px;
        border-bottom: 1px solid #ddd;
        background-color: #18677e;
        color: #ffffff;
        text-align: center;
    }

    .table td:first-child ol {
        margin: 0;
        padding-left: 0;
    }

        .table td:first-child ol li {
            margin: 0;
            padding: 2px 0;
            min-height: 40px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            box-sizing: border-box;
        }

.pair-number {
    font-size: 24px;
    font-weight: bold;
    color: #20586b;
    line-height: 1;
    text-align: center;
}

.pair-time {
    font-size: 8px;
    color: #20586b;
    margin-top: 4px;
    text-align: center;
    line-height: 1;
}

.current-time {
    background-color: #E6F4EA;
    border-left: 4px solid #00A859;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 168, 89, 0.2);
}

    .current-time:hover {
        background-color: #D0E9D6;
        box-shadow: 0 4px 10px rgba(0, 168, 89, 0.3);
    }

.table td:not(:first-child) ol {
    padding-left: 0;
    margin: 0;
}

    .table td:not(:first-child) ol li {
        background-color: #e8ecef;
        margin: 0;
        padding: 2px 5px;
        min-height: 40px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-sizing: border-box;
        overflow-wrap: break-word;
    }

        .table td:not(:first-child) ol li:nth-child(even) {
            background-color: #ffffff;
        }

        .table td:not(:first-child) ol li div {
            line-height: 1.1;
            font-size: 12px;
            text-align: left;
        }

            .table td:not(:first-child) ol li div:nth-child(1) {
                font-weight: bold;
            }

            .table td:not(:first-child) ol li div:nth-child(2) {
                color: #555;
            }

            .table td:not(:first-child) ol li div:nth-child(3) {
                font-style: italic;
            }

.current-pair {
    background-color: #E6F4EA !important;
    border: 2px solid #00A859;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 168, 89, 0.2);
    padding: 2px 5px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-wrap: break-word;
}

    .current-pair:hover {
        background-color: #D0E9D6 !important;
        box-shadow: 0 4px 10px rgba(0, 168, 89, 0.3);
        border: 2px solid #008C47;
    }

/* Админская панель */
.admin-menu {
    padding: 20px;
    text-align: center;
}

.menu-list {
    list-style-type: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .menu-list li {
        margin: 10px 0;
    }

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    background-color: #f9f9f9;
    border-radius: 5px;
    width: 350px;
    margin: 0 auto;
}

    .menu-item:hover {
        background-color: #e0e0e0;
    }

.logout-label {
    color: red;
    cursor: pointer;
    display: block;
    margin-top: 20px;
    text-align: center;
}

    .logout-label:hover {
        text-decoration: underline;
    }

.arrow-right {
    margin-left: 10px;
    font-size: 18px;
}

.arrow-left {
    margin-right: 10px;
    font-size: 18px;
    cursor: pointer;
}

.admin-container {
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

    .admin-container h3 {
        margin-top: 0;
    }

.schedule-form,
.schedule-edit-section,
.schedule-delete-section,
.management-section,
.marquee-input-container {
    margin-bottom: 30px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

    .management-section h4,
    .management-section h5 {
        margin-top: 10px;
    }

.marquee-input-container {
    min-width: 400px;
}

.marquee-input {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s, box-shadow 0.3s;
}

    .marquee-input:hover {
        border-color: #00A859;
        box-shadow: 0 0 5px rgba(0, 168, 89, 0.3);
    }

    .marquee-input:focus {
        outline: none;
        border-color: #00A859;
        box-shadow: 0 0 5px rgba(0, 168, 89, 0.5);
    }

    .marquee-input.input-error {
        border-color: #cb2c39;
        box-shadow: 0 0 5px rgba(203, 44, 57, 0.5);
    }

.char-counter {
    font-size: 12px;
    color: #555;
    margin-top: 5px;
    text-align: left;
}

.char-counter-error {
    color: #cb2c39;
    font-weight: bold;
}

.marquee-messages-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
}

.marquee-messages-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .marquee-messages-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 10px;
        border-bottom: 1px solid #eee;
    }

        .marquee-messages-list li:last-child {
            border-bottom: none;
        }

.message-text {
    flex-grow: 1;
    margin-right: 10px;
    word-break: break-word;
}

.schedule-form {
    min-width: 400px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .form-group label {
        font-weight: bold;
    }

    .form-group input {
        padding: 8px;
        border: 1px solid #ddd;
        border-radius: 5px;
        font-size: 14px;
    }

.schedule-edit-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    margin-top: 10px;
}

    .schedule-edit-table th,
    .schedule-edit-table td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left;
        vertical-align: middle;
    }

    .schedule-edit-table th {
        background-color: #f2f2f2;
    }

        /* Фиксированные ширины колонок */
        .schedule-edit-table th:nth-child(1),
        .schedule-edit-table td:nth-child(1) {
            width: 20%; /* Время */
        }

        .schedule-edit-table th:nth-child(2),
        .schedule-edit-table td:nth-child(2) {
            width: 20%; /* Кабинет */
        }

        .schedule-edit-table th:nth-child(3),
        .schedule-edit-table td:nth-child(3) {
            width: 25%; /* Предмет */
        }

        .schedule-edit-table th:nth-child(4),
        .schedule-edit-table td:nth-child(4) {
            width: 25%; /* Преподаватель */
        }

        .schedule-edit-table th:nth-child(5),
        .schedule-edit-table td:nth-child(5) {
            width: 10%; /* Действия */
        }

    .schedule-edit-table select {
        width: 100%; /* Select занимает всю ширину ячейки */
    }

.schedule-delete-section {
    min-width: 400px;
}

.schedule-edit-section,
.schedule-delete-section {
    margin-top: 20px;
}

    .schedule-delete-section .btn {
        margin-top: 10px;
    }

.management-list {
    list-style-type: none;
    padding: 0;
}

    .management-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        min-width: 400px;
    }

.management-text {
    flex-grow: 1;
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 15px;
    }

    .download-btn {
        display: inline-block;
    }

    .logo-link {
        pointer-events: auto;
    }

    .header-background {
        padding: 15px;
        background-position: center top;
    }

    .content-container {
        flex-direction: column;
    }

    .qr-container {
        display: none;
    }

    .filter-container {
        gap: 10px;
    }

    select {
        width: 140px;
        font-size: 12px;
        padding: 6px 10px;
    }

    .table tr.date-row td {
        font-size: 10px;
    }

    .table td:first-child ol li {
        font-size: 10px;
    }

    .admin-container {
        padding: 15px;
        max-width: 100%;
    }

    .marquee-input-container {
        flex-direction: column;
        align-items: stretch;
    }

    .marquee-input {
        max-width: 100%;
        font-size: 12px;
    }

    .btn-primary {
        width: 100%;
        margin-top: 10px;
        padding: 8px;
        font-size: 14px;
    }

    .marquee-messages-list li {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    .btn-danger {
        margin-left: 0;
        margin-top: 5px;
        width: 100%;
        padding: 8px;
        font-size: 14px;
    }

    .message-text {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .logo-item {
        max-width: 100px;
        max-height: 50px;
    }

    .logo-container {
        gap: 15px;
    }

    .logo-container-anim {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .animated-logo-left {
        width: 300px;
        height: 150px;
    }

    .animated-logo-right {
        width: 300px;
        height: 110px;
    }

    .schedule-edit-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    select {
        width: 100px;
        font-size: 10px;
    }

    .header-background {
        padding: 10px;
    }

    .admin-container {
        padding: 10px;
    }

    .download-btn {
        display: inline-block;
    }

    .logo-link {
        pointer-events: auto;
    }

    .marquee-input {
        font-size: 10px;
    }

    .btn-primary,
    .btn-danger {
        font-size: 12px;
    }

    .marquee-messages-container {
        max-height: 200px;
    }

    .logo-item {
        max-width: 80px;
        max-height: 40px;
    }

    .logo-container {
        gap: 10px;
    }

    .logo-container-anim {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    .animated-logo-left {
        width: 150px;
        height: 75px;
    }

    .animated-logo-right {
        width: 150px;
        height: 55px;
    }

    .schedule-edit-table {
        min-width: 400px;
    }
}
/* === Layout без навбара === */
.page {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

.content {
    flex: 1 0 auto;
    width: 100%;
}

.footer {
    flex-shrink: 0;
    padding: 10px 0;
    text-align: center;
}

/* =========================
   ТАБЛИЦА ПОЛЬЗОВАТЕЛЕЙ (админка)
   ========================= */
.users-table {
    width: 100%;
    min-width: 1080px;
    border-collapse: collapse;
    margin-top: 10px;
    table-layout: auto;
}

    .users-table th,
    .users-table td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left;
        vertical-align: middle;
        word-break: break-word;
    }

    .users-table th {
        background-color: #f2f2f2;
        font-weight: bold;
        white-space: nowrap;
    }

    /* Роль — селект на всю ширину ячейки */
    .users-table select.role-select {
        width: 100%;
        min-width: 170px;
        padding: 6px 8px;
        font-size: 14px;
    }

    /* Действия — флекс-контейнер с переносом кнопок */
    .users-table .user-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

        .users-table .user-actions .btn {
            padding: 5px 10px;
            font-size: 12px;
            margin-left: 0;
            white-space: nowrap;
        }

    /* Специфичные ширины колонок */
    .users-table .col-email {
        min-width: 200px;
    }

    .users-table .col-name {
        min-width: 160px;
    }

    .users-table .col-role {
        min-width: 180px;
    }

    .users-table .col-status {
        min-width: 110px;
    }

    .users-table .col-date {
        min-width: 110px;
    }

    .users-table .col-actions {
        min-width: 380px;
    }