/* 1. ПЕРЕМЕННЫЕ ДЛЯ СВЕТЛОЙ ТЕМЫ (ПО УМОЛЧАНИЮ) */
:root {
    --bg-main: #f5f5f7;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-table-header: #e0e0f0;
    --text-main: #333333;
    --text-muted: #666666;
    --text-table-header: #40406f;
    --accent: #0071e3;
    --border: #f0f0f0;
    --overlay-bg: rgba(0,0,0,0.4);
}

/* 2. ПЕРЕМЕННЫЕ ДЛЯ ТЁМНОЙ ТЕМЫ */
/* Элементы переключатся, когда чекбокс темы (#theme-toggle) будет отмечен */
#theme-toggle:checked ~ .page-wrapper {
    --bg-main: #1c1c1e;
    --bg-card: #2c2c2e;
    --bg-header: #2c2c2e;
    --bg-table-header: #202010;
    --text-main: #f5f5f7;
    --text-muted: #aeaeae;
    --text-table-header: #909040;
    --accent: #0a84ff;
    --border: #3a3a3c;
    --overlay-bg: rgba(0,0,0,0.6);
}

/* Обнуление стилей с использованием переменных */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    font-size: 16px;
}

/* Главная обертка вместо body для правильной работы темы */
.page-wrapper {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Хедер */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    background-color: var(--bg-header);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 50%; /* Сдвигаем левый край ровно на центр экрана */
    transform: translateX(-50%); /* Сдвигаем шапку обратно влево на 50% */
    width: 100%; /* На маленьких экранах занимает всю ширину */
    max-width: 1024px; /* На больших экранах ограничивается этой шириной */
    z-index: 160;
}

.logo {
    font-size: 1.5rem;
    font-weight: 1000;
    color: var(--accent);
    text-decoration: none;
}

/* Контейнер для кнопок справа (тема + бургер) */
.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Скрываем технические чекбоксы */
.burger-toggle, #theme-toggle {
    display: none;
}

/* Кнопка переключения темы (Иконка Солнце/Луна) */
.theme-btn {
    cursor: pointer;
    font-size: 1.25rem;
    user-select: none;
}

/* Меняем иконку в зависимости от состояния чекбокса темы */
#theme-toggle ~ .page-wrapper .theme-btn::before {
    content: "🌙"; /* Показываем луну в светлой теме */
}
#theme-toggle:checked ~ .page-wrapper .theme-btn::before {
    content: "☀️"; /* Показываем солнце в тёмной теме */
}

/* Кнопка бургера */
.burger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    min-height: 20px;
    min-width: 30px;
    cursor: pointer;
    z-index: 200;
}

/* Линии бургера */
.burger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* Боковое меню */
.menu_old {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background-color: var(--bg-header);
    padding-top: 80px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease-in-out;
    z-index: 150;
}
.menu {
    position: fixed;
    top: -100vh; /* Изначально полностью спрятано выше экрана */
    left: 50%;
    transform: translateX(-50%); /* Центрируем меню так же, как и шапку */
    width: 100%;
    max-width: 1024px; /* Ширина идеально совпадает с вашей шапкой */
    height: auto; /* Высота подстраивается под количество ссылок */
    background-color: var(--bg-header);
    padding: 20px 0; /* Небольшие отступы сверху и снизу */
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    transition: top 0.4s ease-in-out; /* Плавное скольжение вниз */
    z-index: 150; /* Чуть ниже шапки (100), чтобы выпадать из-под неё */
}

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

.menu-item {
    border-bottom: 1px solid var(--border);
    width: 100%; /* Ссылка растягивается во всю ширину */
    text-align: center;
}

.menu-item:last-child {
    border-bottom: none; /* Убираем нижнюю рамку у последнего пункта */
}

.menu-link {
    display: block;
    padding: 15px 25px;
    font-size: 1.2rem;
    color: var(--text-main);
    text-decoration: none;
}

.menu-link:hover {
    background-color: var(--bg-main);
    color: var(--accent);
}

/* Логика открытия меню */
.burger-toggle:checked ~ .menu {
    top: 60px !important;
}

/* Анимация крестика */
.burger-toggle:checked ~ .header .burger-btn span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.burger-toggle:checked ~ .header .burger-btn span:nth-child(2) {
    opacity: 0;
}

.burger-toggle:checked ~ .header .burger-btn span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Задний фон-затемнение */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--overlay-bg);
    z-index: 140;
    display: none;
}

.burger-toggle:checked ~ .overlay {
    display: block;
}

/* Контент страницы */
.main-content {
    margin-top: 80px;
    padding: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

/* Контейнер, который спасет мобильную верстку */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Включает горизонтальную прокрутку, если таблица не влезает */
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

/* Базовые стили таблицы */
.custom-table {
    width: 100%;
    border-collapse: collapse; /* Убирает двойные рамки между ячейками */
    background-color: var(--bg-card);
    color: var(--text-main);
    font-size: 1.2rem;
    text-align: left;
    min-width: 300px; /* Гарантирует, что на мобилках таблица не сожмется в кашу */
}

/* Стили шапки */
.custom-table thead {
    background-color: var(--bg-table-header);
    color: var(--text-table-header);
    padding: 12px 15px;
    font-weight: 800;
}

/* Стили обычных ячеек */
.custom-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

/* Стили обычных ячеек */
.custom-table td:last-child {
    text-align: center;
    max-width: 130px; /* Последний столбец делаем узким */
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

p {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-muted);
}
