/* ======================================================== */
/* 1. БАЗОВЫЕ И ОБЩИЕ СТИЛИ (Оригинальные + Фиксы)           */
/* ======================================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #1e1e24;
    color: #f5f5f7;
    margin: 0;
    padding: 0;
}

.d-none { 
    display: none !important; 
}

hr {
    border: 0; 
    border-top: 1px solid #44444f; 
    margin-bottom: 20px;
}

.centered-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

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

.card {
    background-color: #2a2a32;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.main-container .card { 
    max-width: 100%; 
}

.mb-4 { 
    margin-bottom: 24px; 
}

h1, h2, h3 { 
    margin-top: 0; 
    color: #ffffff; 
}

.subtitle { 
    color: #b3b3b3; 
    font-size: 14px; 
    margin-top: -10px; 
    margin-bottom: 20px;
}

.form-group { 
    margin-bottom: 20px; 
}

label { 
    display: block; 
    margin-bottom: 8px; 
    font-size: 14px; 
    color: #cdcdcd; 
}

/* ======================================================== */
/* 2. ЭЛЕМЕНТЫ ФОРМ, ПОЛЯ ВВОДА И КНОПКИ                     */
/* ======================================================== */
input[type="text"], 
input[type="password"], 
input[type="file"], 
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #44444f;
    border-radius: 6px;
    background-color: #13131a;
    color: #fff;
    box-sizing: border-box;
    font-size: 16px;
}

input:focus, 
select:focus { 
    outline: none; 
    border-color: #007aff; 
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
    box-sizing: border-box;
}

.btn-primary { 
    background-color: #007aff; 
    color: white; 
}

.btn-primary:hover { 
    background-color: #0056b3; 
}

.btn-danger { 
    background-color: #ff3b30; 
    color: white; 
    width: auto; 
    padding: 8px 16px; 
}

.btn-success { 
    background-color: #34c759; 
    color: white; 
}

.wide-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}

.file-input-label {
    background-color: #007aff; 
    display: block; 
    text-align: center;
    cursor: pointer;
}

/* ======================================================== */
/* 3. ИНТЕРФЕЙС АДМИНИСТРАТОРА (Сетка, логи, таблицы)        */
/* ======================================================== */
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 30px; 
}

.header p {
    margin: 5px 0 0 0; 
    color: #aaa;
}

.filter-block {
    background-color: #2a2a32; 
    padding: 15px; 
    border-radius: 8px; 
    display: flex; 
    flex-direction: column; 
    gap: 15px;
}

.slides-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px;
}

.slides-header h3 {
    margin: 0;
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 20px; 
}

.slide-card { 
    background: #13131a; 
    border-radius: 8px; 
    padding: 12px; 
    text-align: center; 
    border: 1px solid #333; 
    position: relative; 
}

.slide-card img { 
    width: 100%; 
    height: 140px; 
    object-fit: cover; 
    border-radius: 6px; 
    margin-bottom: 10px; 
}

.error-message { 
    background-color: #ff3b30; 
    color: white; 
    padding: 10px; 
    border-radius: 6px; 
    margin-bottom: 15px; 
    font-size: 14px; 
}

.status-message { 
    margin-top: 10px; 
    font-size: 14px; 
    color: #34c759; 
}

.loading-text {
    color: #aaa;
    font-style: italic;
}

.user-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
    background: #13131a; 
    border-radius: 8px; 
    overflow: hidden; 
}

.user-table th, 
.user-table td { 
    padding: 12px; 
    text-align: left; 
    border-bottom: 1px solid #333; 
}

.user-table th { 
    background-color: #22222a; 
    color: #fff; 
}

.inline-form { 
    display: flex; 
    gap: 15px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
}

.inline-form .form-group { 
    flex: 1; 
    min-width: 200px; 
    margin-bottom: 0; 
}

.inline-form .select-group {
    min-width: 150px;
}

.inline-form .btn { 
    width: auto; 
    align-self: flex-end; 
    padding: 12px 24px; 
}

/* ======================================================== */
/* 4. ИНТЕРФЕЙС УЧИТЕЛЯ (Копия логики Kivy)                  */
/* ======================================================== */
.teacher-preview-box {
    background-color: #13131a;
    border: 2px dashed #444;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.teacher-preview-box img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 6px;
    object-fit: contain;
    margin-top: 10px;
}

.nav-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    transition: opacity 0.3s ease;
}

.nav-layout .btn { 
    width: 30%; 
}

.nav-layout span { 
    font-weight: bold; 
    font-size: 16px; 
}

/* ======================================================== */
/* 5. РЕЖИМ VR-ОЧКОВ / ШЛЕМ (Фикс схлопывания размеров)     */
/* ======================================================== */
#vr-screen {
    background-color: #000000 !important;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    box-sizing: border-box;
}

#vr-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.vr-image-wrapper {
    flex-grow: 1; 
    width: 100vw;
    height: 60vh; /* Занимает центральные 60% высоты шлема */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    overflow: hidden;
    background-color: #000;
}

.vr-image-viewer {
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 65vh;
    object-fit: contain; /* Картинка масштабируется без искажений */
}


/* ======================================================== */
/* 6. МОДАЛЬНОЕ ОКНО ПРОСМОТРА КАРТИНОК                      */
/* ======================================================== */
#image-modal {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.85); 
    z-index: 9999; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: zoom-out;
}

#close-modal-btn {
    position: absolute; 
    top: 20px; 
    right: 30px; 
    color: #fff; 
    font-size: 40px; 
    font-weight: bold; 
    cursor: pointer; 
    user-select: none;
}

#image-modal img {
    max-width: 90%; 
    max-height: 90%; 
    border-radius: 8px; 
    box-shadow: 0 12px 36px rgba(0,0,0,0.5); 
    cursor: default;
}
/* Фикс отображения картинок в личной сетке учителя и админа */
.grid .slide-card {
    background: #13131a;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 230px; /* Фиксированная высота карточки */
    box-sizing: border-box;
}

.grid .slide-card img {
    width: 100%;
    height: 120px;
    object-fit: cover; /* Картинка заполняет блок без искажений */
    border-radius: 6px;
    background-color: #000; /* Черная подложка, если картинка грузится */
    display: block;
}

/* Фикс главного блока превью текущего слайда */
.teacher-preview-box {
    background-color: #13131a;
    border: 2px dashed #444;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#teacher-img-preview {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 6px;
    margin-top: 10px;
    display: block;
}
