* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: #0e1621;
    color: #ffffff;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: 100vh;
    background-color: #17212b;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* --- Сайдбар --- */
.sidebar {
    width: 320px;
    background-color: #17212b;
    border-right: 1px solid #242f3d;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 10px 15px;
    background-color: #17212b;
    border-bottom: 1px solid #242f3d;
}

/* Стили для реального поля ввода */
.search-bar {
    width: 100%;
    background-color: #242f3d;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid transparent;
    outline: none;
    transition: border 0.2s;
}
.search-bar::placeholder {
    color: #7f91a4;
}
.search-bar:focus {
    border: 1px solid #2b5278;
}

.subjects-list {
    overflow-y: auto;
    flex: 1;
}

/* --- Элементы списка (Предметы и Результаты поиска) --- */
.subject-item, .search-result-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #242f3d;
    transition: background 0.2s;
}

.subject-item:hover, .search-result-item:hover {
    background-color: #202b36;
}

.subject-item.active {
    background-color: #2b5278;
    color: #fff;
}

/* Заголовок группы в поиске */
.search-group-title {
    padding: 10px 20px 5px 20px;
    font-size: 12px;
    color: #7f91a4;
    text-transform: uppercase;
    font-weight: bold;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-title {
    font-size: 15px;
    color: #ffffff;
}

.search-result-subject {
    font-size: 12px;
    color: #64b5f6;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #7f91a4;
    font-size: 14px;
}

/* --- Контент --- */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #0e1621;
    position: relative;
}

.content-header {
    padding: 15px 20px;
    background-color: #17212b;
    border-bottom: 1px solid #242f3d;
    display: flex;
    align-items: center;
    min-height: 60px;
}

.content-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.back-btn {
    display: none;
    background: none;
    border: none;
    color: #64b5f6;
    font-size: 16px;
    margin-right: 15px;
    cursor: pointer;
}

.content-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
}

.empty-state {
    text-align: center;
    color: #7f91a4;
    margin-top: 100px;
}

.topics-list {
    list-style: none;
}

.topics-list li {
    padding: 15px;
    background-color: #17212b;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.topics-list li:hover {
    background-color: #202b36;
}

/* Форма пароля */
.password-form {
    max-width: 400px;
    margin: 50px auto;
    background-color: #17212b;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.password-form h3 {
    margin-bottom: 20px;
    color: #64b5f6;
}

.password-form input {
    width: 100%;
    padding: 12px;
    background-color: #242f3d;
    border: 1px solid #3e546a;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 2px;
}

.password-form button {
    width: 100%;
    padding: 12px;
    background-color: #2b5278;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.password-form button:hover {
    background-color: #3a6b9a;
}

.error-msg {
    color: #e53935;
    margin-top: 10px;
    font-size: 14px;
}

/* --- Текст лекции --- */
.lecture-text {
    white-space: pre-wrap;
    font-size: 16px;
    color: #e1e1e1;
    /* ВОТ ОНА — МАГИЯ МОНОШИРИННОГО ШРИФТА */
    font-family: Consolas, "Courier New", monospace; 
}

/* Адаптивность */
@media (max-width: 768px) {
    .app-container { position: relative; overflow: hidden; }
    .sidebar {
        width: 100%; position: absolute; top: 0; left: 0;
        height: 100%; z-index: 10; transition: transform 0.3s ease;
    }
    .content {
        width: 100%; position: absolute; top: 0; left: 0;
        height: 100%; z-index: 5; transform: translateX(100%); transition: transform 0.3s ease;
    }
    .app-container.show-content .sidebar { transform: translateX(-100%); }
    .app-container.show-content .content { transform: translateX(0); }
    .back-btn { display: block; }
    .content-body { padding: 15px; }
}
