:root {
    --bg-body: #121212;         /* Глубокий черный фон */
    --bg-surface: #1c1c1e;      /* Цвет карточек (графит) */
    --bg-element: #2c2c2e;      /* Цвет элементов списка */
    --primary-glow: #4f4bff;    /* Неоновый синий */
    --text-main: #ffffff;
    --text-muted: #bbbbbb;
    --border-radius: 20px;
    --border-color: #333;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden; /* Запрещаем горизонтальный скролл */
    /* Убираем вертикальный скролл, если он не нужен */
    overflow-y: auto;
}

/* Красивый глобальный скроллбар (для всей страницы) */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    width: 5px;
    background: transparent; /* Цвет фона дорожки под цвет вашей темы */
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4f4bff;
}

/* --- Левая панель (Меню) --- */
.course-card {
    background-color: var(--bg-surface);
    border-radius: var(--border-radius);
    padding: 10px;
    height: auto;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    overflow: hidden; /* Чтобы список не вылезал при сворачивании */
}

.course-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 500;
    user-select: none;
    transition: color 0.3s;
}

.course-header:hover {
    color: var(--primary-glow);
}

.course-header i {
    transition: transform 0.3s ease;
}

/* Поворот стрелки */
.course-header.open i {
    transform: rotate(180deg);
}

/* Анимация аккордеона */
.topic-list {
    list-style: none;
    padding: 0 10px;
    margin: 0;
    max-height: 0; /* Скрыто по умолчанию */
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease-in-out;
}

.topic-list.show {
    max-height: 500px; /* Раскрытие */
    opacity: 1;
    padding-bottom: 10px;
    margin-top: 5px;
    overflow-y: auto;  /* Включаем вертикальную прокрутку */
    padding-right: 5px; /* Отступ для красивого скроллбара */
}

/* Элемент темы */
.topic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    border: 1px solid transparent; /* Чтобы не прыгало при активе */
    border-radius: 15px;
    padding: 12px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
    text-decoration: none;
}

.topic-item:hover {
    background-color: var(--bg-element);
    color: white;
}

/* Активная тема (Свечение как на фото) */
.topic-item.active {
    border-color: var(--primary-glow);
    background-color: rgba(79, 75, 255, 0.05);
    box-shadow: 0 0 15px rgba(79, 75, 255, 0.3), inset 0 0 10px rgba(79, 75, 255, 0.1);
    color: var(--primary-glow);
}

.topic-num {
    display: inline-block;
    width: 30px;
    font-weight: bold;
}

/* Кнопка "Новая тема" */
.add-new-btn {
    border: 1px dashed rgba(255, 255, 255, 0.3); /* Светлая пунктирная рамка */
    opacity: 1; /* Убираем прозрачность всей кнопки */
    color: rgba(255, 255, 255, 0.5); /* Делаем текст светлее */
    background-color: rgba(255, 255, 255, 0.02); /* Легкий фон, чтобы кнопка выделялась */
}

.add-new-btn:hover {
    border-color: var(--primary-glow); /* Синяя рамка при наведении */
    color: white; /* Белый текст при наведении */
    background-color: rgba(79, 75, 255, 0.1); /* Синеватый фон */
}

/* --- Правая панель --- */
.details-panel {
    background-color: var(--bg-surface);
    border-radius: var(--border-radius);
    padding: 40px;
    border: 1px solid var(--border-color);
    min-height: 600px;
    display: none; /* Скрыто пока не выбрали тему */
    animation: fadeIn 0.5s ease;
    position: relative; 
    overflow: hidden;
}

/* Плейсхолдер "Выберите тему" */
.empty-state {
    height: 400px;
    background-color: var(--bg-surface);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #444;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Поля ввода (стилизация линий) */
.field-group {
    margin-bottom: 2rem;
}
.field-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    display: block;
}
.field-value {
    border-bottom: 1px solid #444;
    padding-bottom: 8px;
    font-size: 1.1rem;
    color: #ddd;
}

/* Зона загрузки файлов */
.upload-area {
    background-color: #252528;
    border-radius: 20px;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px dashed transparent; /* Скрытая рамка */
}

.upload-area:hover {
    background-color: #2e2e32;
    border-color: var(--primary-glow); /* Синяя рамка при наведении */
}

.plus-icon {
    font-size: 2.5rem;
    font-weight: 300;
    color: #ccc;
    transition: transform 0.2s;
}

.upload-area:hover .plus-icon {
    transform: scale(1.1);
    color: var(--primary-glow);
}

/* Список добавленных файлов */
.file-item {
    background-color: var(--bg-element);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
    border: 1px solid #3a3a3c;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.file-icon {
    font-size: 1.8rem;
    margin-right: 15px;
    color: #aaa;
}

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

.login-card {
    transform: translateY(-5%);
}

.btn-purple {
    color: #5c16ff;              /* фиолетовый текст */
    border-color: #5c16ff;       /* фиолетовая обводка */
}

.btn-purple:hover,
.btn-purple:focus {
    transition: color 0.5s ease, border-color 0.5s ease, background-color 0.5s ease;
    background-color: #5c16ff;   /* фиолетовый фон */
    color: #1e1e1e;              /* графитовый текст */
    border-color: #5c16ff;
}


.dark-input {
    background-color: #ffffff;
    color: #1e1e1e;
    border: 1px solid #ced4da;
    border-radius: 10px;
    box-shadow: none;
}

.dark-input::placeholder {
    color: #9ca3af; /* серый плейсхолдер */
}

/* КОНТРОЛЬ СВЕЧЕНИЯ */
.dark-input:focus {
    background-color: #ffffff;
    color: #1e1e1e;

    border: 2px solid #5c16ff;
    border-color: #5c16ff;
    box-shadow: 0 0 0 0.4rem #370e98ab; 
    /* ↑ сила и цвет свечения */
    outline: none;
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}





/* --- Главная страница (Выбор роли) --- */

/* Свечение для текста Caldera */
.brand-glow {
    color: var(--primary-glow);
    text-shadow: 0 0 25px rgba(79, 75, 255, 0.5);
}

/* Разрядка букв для подзаголовка LMS */
.tracking-widest {
    letter-spacing: 0.2em;
}

/* Стилизация карточек ролей */
.role-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px 30px;
    width: 320px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

/* Декоративная линия сверху карточки (появляется при наведении) */
.role-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: var(--primary-glow);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}


/* 1. Эффекты при наведении на саму карточку (чуть подправил тени) */
.role-card:hover {
    transform: translateY(-12px); /* Всплывает чуть выше для большей динамики */
    border-color: rgba(79, 75, 255, 0.6); /* Чуть ярче граница */
    background-color: #232327; /* Немного светлее фон */
    /* Более глубокая и мягкая тень */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), 0 0 35px rgba(79, 75, 255, 0.2);
}

/* 1. Делаем текст описания ярче в обычном состоянии */
.role-card .text-muted {
    color: rgba(255, 255, 255, 0.7) !important; /* Белый цвет с прозрачностью 70% вместо стандартных 50% */
    transition: all 0.4s ease; /* Чтобы все изменения были плавными */
}

/* 2. При наведении делаем его максимально ярким */
.role-card:hover .text-muted {
    color: #ffffff !important; /* Чистый белый цвет */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4); /* Мягкое свечение */
}


.role-card:hover::before {
    transform: scaleX(1);
}

/* Круглый контейнер для иконки */
.card-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--bg-element);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    color: var(--text-main);
    transition: all 0.4s ease;
}

/* Анимация иконки при наведении на карточку */
.role-card:hover .card-icon-wrapper {
    background-color: var(--primary-glow);
    color: #fff;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 20px rgba(79, 75, 255, 0.4);
}




/* --- Страница Логина --- */

.login-card .text-muted, 
.login-card .text-secondary {
    color: rgba(255, 255, 255, 0.7) !important; /* Светло-серый, почти белый */
}

.login-card .brand-glow {
    color: var(--primary-glow);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(79, 75, 255, 0.5);
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 45px;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.login-card-edge {
    position: absolute;
    top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}

/* Кастомные инпуты */
.input-group-custom {
    position: relative;
    display: flex;
    align-items: center;
}

.icon-field {
    position: absolute;
    left: 18px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
    transition: 0.3s;
}

.dark-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    background: #1a1a1d;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: white !important;
    outline: none;
    transition: all 0.3s ease;
}

.dark-input:focus {
    border-color: var(--primary-glow);
    background: #212124;
    box-shadow: 0 0 15px rgba(79, 75, 255, 0.15);
}

.dark-input:focus + .icon-field, 
.input-group-custom:focus-within .icon-field {
    color: var(--primary-glow);
}

/* Кнопка входа */
.btn-login {
    width: 100%;
    padding: 15px;
    border-radius: 14px;
    background: var(--primary-glow);
    color: white;
    border: none;
    font-weight: 600;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-login:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 75, 255, 0.4);
}

/* Ссылки и чекбокс */
.forgot-link, .back-link {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: 0.3s;
}

.forgot-link:hover, .back-link:hover {
    color: white;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.checkbox-wrapper input[type="checkbox"] {
    accent-color: var(--primary-glow);
    cursor: pointer;
}

/* Стили для кнопки-глазика */
.password-toggle {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5); /* Делаем иконку светлой (50% прозрачности) */
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.3s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: #ffffff; /* При наведении иконка становится ярко-белой */
}

.password-toggle i {
    font-size: 1.2rem; /* Размер иконки */
}

/* Корректируем отступ в инпуте, чтобы текст не залезал под глаз */
.dark-input {
    padding-right: 45px !important;
}
/* Убираем стандартный значок глаза в Microsoft Edge */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}

/* Убираем стандартные иконки в Chrome/Safari/Opera (если появятся) */
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    position: absolute;
    right: 0;
}

/* Стили специально для админки, чтобы всё отобразилось */
    .admin-card {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: 20px;
        padding: 25px;
        transition: all 0.3s ease;
    }

    .dark-input-clean {
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        color: white !important;
        border-radius: 12px !important;
        padding: 12px 15px !important;
    }

    .dark-input-clean:focus {
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
        box-shadow: none !important;
    }

    .field-label {
        color: #888;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 8px;
        display: block;
    }

    .hover-red:hover {
        color: #ff4d4d !important;
    }

    .topic-item {
        background: rgba(255, 255, 255, 0.02);
        border-radius: 12px;
        padding: 12px 15px;
        margin-bottom: 10px;
        border: 1px solid transparent;
    }

    .topic-item:hover {
        border-color: rgba(255, 255, 255, 0.1);
    }

    .hover-success-icon:hover { color: #198754 !important; transform: scale(1.1); transition: 0.2s; }

    
/* Делаем иконку мусорки видимой сразу */
.bi-trash {
    color: rgba(255, 255, 255, 0.5); /* Белый на 50% прозрачности */
    transition: color 0.3s ease;
}

/* При наведении она станет ярко-красной */
.bi-trash:hover {
    color: #ff4d4d !important;
}

/* Обнуляем счетчик для каждого списка тем внутри курса */
.topic-list {
    counter-reset: topic-counter;
}

/* Увеличиваем счетчик для каждого элемента, который НЕ является кнопкой добавления */
.topic-item:not(.add-new-btn) {
    counter-increment: topic-counter;
}

/* Выводим номер прямо внутрь спана */
.topic-item:not(.add-new-btn) .topic-num::before {
    content: counter(topic-counter);
}

/* Опционально: фиксированная ширина для выравнивания, если ее еще нет */
.topic-num {
    display: inline-block;
    min-width: 24px;
    font-weight: 500;
}

/* Общие стили для темных полей ввода */
.dark-input-clean {
    background-color: #1e1e1e !important; /* Насыщенный темный фон */
    border: 1px solid #333 !important;
    color: #fff !important;
    border-radius: 12px !important; /* Закругляем углы */
    padding: 10px 15px;
}

.dark-input-clean:focus {
    background-color: #252525 !important;
    border-color: #555 !important;
    box-shadow: none !important;
}

/* Исправляем выпадающий список (белый фон и текст) */
.dark-input-clean option {
    background-color: #1e1e1e; /* Фон выпадающих пунктов */
    color: #fff; /* Цвет текста пунктов */
    padding: 10px;
}

/* Убираем стандартную синюю подсветку в некоторых браузерах */
select.dark-input-clean {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

/* Изменяем цвет текста плейсхолдера для полей с классом dark-input-clean */
.dark-input-clean::placeholder {
    color: #a0a0a0; /* Светло-серый цвет, можете настроить оттенок под свой дизайн */
    opacity: 1;     /* Обязательно для Firefox, так как он по умолчанию делает плейсхолдеры полупрозрачными */
}

/* Опционально: Для браузеров на движке WebKit (Chrome, Safari, Edge) */
.dark-input-clean::-webkit-input-placeholder {
    color: #a0a0a0;
}

/* Опционально: Для старых версий Firefox */
.dark-input-clean::-moz-placeholder {
    color: #a0a0a0;
    opacity: 1;
}

/* Если хотите, чтобы при фокусе подсказка немного тускнела или меняла цвет: */
.dark-input-clean:focus::placeholder {
    color: #6c757d; /* Слегка более тёмный серый при вводе текста (по желанию) */
}