/*dashboard.css*/

/* =========================
   Заголовки
   ========================= */

h2 {
    color: #535353;
    text-align: center;
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    margin: 10px;
}

h3 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #535353;
}

h4 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
/*    font-weight: bold;*/
}

/* =========================
   Общие стили контейнера
   ========================= */
.dashboard-layout {
    display: flex;
    max-width: 900px;
    margin: 10px auto;
    padding: 0px;
    border-radius: 10px;
}

.sidebar {
    display: flex;
    gap: 1rem;
    flex-direction: column;
    width: 165px;
    line-height: 1.15;
    align-items: center;
    padding-right: 2rem;
    flex-shrink: 0; /* чтобы не сжимался */
}

.sidebar-inner {
    position: sticky; /* вместо fixed */
    top: 110px;
    align-items: center;
}

.main-content {
    flex-grow: 1;
    padding: 0;
    line-height: 1.15;
}

/* =========================
  Фотографии
  ========================= */
.student-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    z-index: 3;
    margin: 0 auto; /* ← Центрирование */
    display: block;  /* ← Обязательно для margin: auto */
    transition: transform 0.4s, box-shadow 0.4s;
    box-shadow:
    inset 0 -3em 3em rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgb(255, 255, 255),
    0.3em 0.3em 1em rgba(0, 0, 0, 0.3);
}

.student-photo:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow:
    inset 0 -3em 3em rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgb(255, 255, 255),
    0.5em 0.5em 2em rgba(0, 0, 0, 0.4);
}

/* =========================
   Меню навигации
   ========================= */
.menu {
    display: flex;
    flex-direction: column;
/*    gap: 10px;*/
    gap: clamp(3px, 1.5vh, 10px);
    list-style: none;
    padding: 0;
}

.menu-item-card {
    flex: 1 1 auto;
    min-width: 80px;
    border-radius: 8px;
    overflow: hidden;
    line-height: 1.3;
    font-size: 0.9rem;
    background-color: #f9f9f9;
    transition: transform 0.4s, box-shadow 0.4s;
    box-shadow:
    inset 0 -3em 3em rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgb(255, 255, 255),
    0.3em 0.3em 1em rgba(0, 0, 0, 0.3);
}

.menu-item-card:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow:
    inset 0 -1em 2em rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgb(255, 255, 255),
    0.5em 0.5em 2em rgba(0, 0, 0, 0.4);
}

.menu-item-link {
    text-decoration: none; /* Убирает подчеркивание */
    color: inherit; /* Наследует цвет текста */
    display: block; /* Делаем ссылку блочным элементом */
/*    padding: 7px 30px;*/
    /* 🔥 Адаптивный padding для всех устройств */
    padding: clamp(1px, 1.5vh, 7px) clamp(10px, 4vw, 30px);
}
/* =========================
   Основная секция (контент)
   ========================= */
.dashboard-section {
    padding: 10px;
}

/* =========================
   Адаптивность
   ========================= */

/* Кнопка гамбургера скрыта по умолчанию */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 5px;
    left: 5px;
    font-size: 24px;
    color: yellow;
    cursor: pointer;
    background: none;
    border: none;
    margin: 0px;
    z-index: 1100;

}

/* Затемнение фона при открытом сайдбаре */
.overlay {
    display: none;             /* скрыт по умолчанию */
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.4);
    z-index: 999;              /* ниже сайдбара, выше остального */
}

/* Показываем overlay при активном сайдбаре */
.sidebar.active + .overlay {
    display: block;
}

/* ====== Мобильная версия ====== */
@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }

    .sidebar {
        display: flex;
        position: fixed;
        top: 0; /* ← С САМОГО ВЕРХА */
        left: 0;
        width: 175px;
        height: 100vh; /* ← ВСЯ ВЫСОТА ЭКРАНА */
        height: 100dvh; /* ← Для iOS */

        background: rgba(249, 249, 249, 0.95); /* ← Полупрозрачный */
        backdrop-filter: blur(10px); /* ← Размытие фона */

        padding: 1rem;
        padding-top: 90px; /* ← КОНТЕНТ начинается под header */
        padding-bottom: env(safe-area-inset-bottom, 20px);
        box-shadow: 2px 0 5px rgba(0,0,0,0.3);
        z-index: 1000;

        /* Прокрутка */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;

        /* Анимация */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Стилизация скроллбара */
    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }

    /* Убираем sticky */
    .sidebar-inner {
        position: static;
    }

    /* Уменьшаем фото */
    .student-photo {
        width: 120px;
        height: 120px;
    }

    /* main-content */
    .main-content {
        flex-grow: 1;
        padding: 1rem;
    }

    /* Overlay */
    .overlay {
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
        pointer-events: none;
    }

    .sidebar.active ~ .overlay {
        opacity: 1;
        pointer-events: auto;
    }

    /* Остальные стили для мобильных */
    header h1 {
        font-size: 1rem !important;
        margin-block-start: 0.3em !important;
        margin-block-end: 0.1em !important;
        color: #C0C0C0 !important;
    }

    .home-page h2 {
        color: #6495ED;
    }

    .teacher-photo {
        float: none;
        display: block;
        margin: 0 auto 20px;
        width: 135px;
        height: 200px;
    }

    .bg-container {
        padding: 20px;
    }

    .content {
        text-align: center;
    }

    .lang-switcher {
        top: 5px;
        right: 5px;
    }

    .lang-btn {
        padding: 3px;
    }

    .lang-dropdown {
        min-width: 120px;
        font-size: 0.75rem;
    }

    .tooltip .tooltiptext {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    .schedule-page ul {
        padding-inline-start: 15px;
    }
}

/* Для тач-устройств (телефоны/планшеты) */
@media (hover: none) and (pointer: coarse) {
    .tooltip .tooltiptext {
        display: none !important; /* полностью скрываем */
        visibility: hidden !important;
        opacity: 0 !important;
    }
}

@media (max-width: 768px) and (max-height: 500px) {
    .sidebar {
        /* 🔥 ИСПРАВЛЕНО: Явно указываем начало и высоту */
        top: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;

/*        padding-top: 0px;*/
        padding-top: clamp(0px, 5vh, 80px) !important;
    }

    .student-photo {
        width: 70px !important;
        height: 70px !important;
    }

    h4 {
        font-size: 12px;
        margin-bottom: 5px;
    }

/*    .menu {*/
/*        gap: 3px;*/
/*    }*/

/*    .menu-item-link {*/
/*        padding: 4px 15px;*/
/*        font-size: 0.8rem;*/
/*    }*/
}

css/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
}

.pagination-link {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.pagination-link:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

.pagination-info {
    padding: 8px 12px;
    color: #666;
    font-weight: bold;
}


/* Страница со списком заметок */
.notes-page {
    padding: 10px;
}

.notes-page h2 {
    margin-bottom: 20px;
}

.notes-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.note-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.note-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

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

.note-language {
    background: #4CAF50;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.note-date {
    color: #666;
    font-size: 0.9rem;
}

.note-lesson-title {
    margin: 10px 0;
    color: #333;
    font-size: 1.1rem;
}

.note-content {
    margin: 15px 0;
    line-height: 1.6;
    color: #444;
}

.note-content p {
    margin-bottom: 10px;
}

.note-content ul,
.note-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.note-content li {
    margin-bottom: 5px;
}

.note-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 0.85rem;
}

.btn-delete-note {
    background: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-delete-note:hover {
    background: #da190b;
}

.no-notes {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-notes p {
    margin: 10px 0;
}

.no-notes .hint {
    color: #999;
    font-size: 0.9rem;
}

/* Кнопки действий с заметками */
.note-actions {
    display: flex;
    gap: 8px;
}

.btn-edit-note {
    background: #2196F3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-edit-note:hover {
    background: #0b7dda;
}

.btn-delete-note {
    background: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-delete-note:hover {
    background: #da190b;
}