/* ======================
  ОСНОВНЫЕ СТИЛИ
====================== */

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f6fa;
    color: #222;
}

/* ======================
    ХЕДЕР
====================== */

.header {
    background: #ffffff;
    border-bottom: 1px solid #e3e3e3;
    padding: 12px 0;
    margin-bottom: 30px;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-weight: bold;
    font-size: 20px;
}

.nav-link {
    margin-left: 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.nav-link:hover {
    color: #007bff;
}

/* ======================
   АДМИНКА — ЛЕВАЯ ПАНЕЛЬ
====================== */

.admin-body {
    display: flex;
    margin: 0;
}

.admin-sidebar {
    width: 230px;
    background: #1f2937;
    color: #fff;
    height: 100vh;
    padding: 25px 15px;
    box-sizing: border-box;
}

.admin-logo {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
}

.admin-link {
    display: block;
    padding: 12px 10px;
    color: #fff;
    text-decoration: none;
    margin-bottom: 10px;
    border-radius: 8px;
    transition: 0.2s;
}

.admin-link:hover {
    background: #374151;
}

.admin-content {
    flex: 1;
    padding: 30px;
}

/* ======================
    ЗАГОЛОВКИ
====================== */

.page-title {
    font-size: 26px;
    margin-bottom: 20px;
}

.page-subtitle {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
}

/* ======================
    ФОРМЫ
====================== */

.form-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    max-width: 800px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    margin-bottom: 20px;
    font-size: 15px;
    box-sizing: border-box;
}

.form-textarea {
    height: 140px;
    resize: none;
}

/* ======================
    КНОПКИ
====================== */

.btn-primary {
    display: inline-block;
    padding: 12px 20px;
    background: #007bff;
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    border: none;
}

.btn-primary:hover {
    background: #005ad5;
}

.btn-small {
    padding: 6px 12px;
    background: #4b5563;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.btn-small:hover {
    background: #374151;
}

/* ======================
    ТАБЛИЦЫ
====================== */

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.admin-table th {
    background: #e5e7eb;
    padding: 12px;
    text-align: left;
    font-size: 15px;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
    background: #f3f4f6;
}

/* ======================
    КАРТОЧКИ КУРСОВ
====================== */

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

.course-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-card-body {
    text-align: left;
}

.course-title {
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

.course-card-footer {
    margin-top: 15px;
    text-align: center;
}

/* ======================
    МОДУЛИ / УРОКИ
====================== */

.modules-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.module-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.module-title {
    font-size: 18px;
    margin-bottom: 12px;
    font-weight: bold;
}

/* ======================
    АУДИОПЛЕЕР + СКОРОСТЬ
====================== */

.audio-player {
    width: 100%;
    outline: none;
    margin-top: 10px;
}

.audio-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
}

.speed-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.speed-controls select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-size: 13px;
}

/* ======================
    ПРОЧЕЕ
====================== */

.empty {
    color: #999;
    font-size: 14px;
}

.user-body {
    background: #f5f6fa;
}

.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* ======================
    СТРАНИЦА ЛОГИНА
====================== */

.auth-body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    box-sizing: border-box;
}

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px 28px 26px;
    box-shadow: 0 20px 45px rgba(0,0,0,0.25);
}

.auth-title {
    font-size: 24px;
    margin-bottom: 6px;
    text-align: center;
}

.auth-subtitle {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 20px;
}

.auth-form .form-input {
    background: #f9fafb;
}

.auth-btn {
    width: 100%;
    text-align: center;
    margin-top: 5px;
}

.auth-messages {
    margin-bottom: 15px;
}

.auth-message {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.auth-message-danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* ======================
    БЛОК МОДУЛЯ В ФОРМЕ
====================== */

.module-block {
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
}

/* ======================
    СЕТКА ДЛЯ ФОРМЫ КЛИЕНТА
====================== */

.form-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 20px;
    align-items: flex-start;
}

.courses-select-card {
    max-height: 520px;
    overflow-y: auto;
}

.courses-hint {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
}

.course-checkbox {
    padding: 8px 6px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.course-checkbox label {
    cursor: pointer;
}

.course-tag {
    color: #6b7280;
    font-size: 12px;
    margin-left: 4px;
}

/* флеш-сообщения */

.flash-wrapper {
    margin-bottom: 15px;
}

.flash {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 5px;
}

.flash-danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* Бейдж в меню админки */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* Комментарии */
.comments-block {
    margin-top: 18px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
}

.comments-list {
    margin-bottom: 10px;
}

.comment-row {
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.comment-user {
    background: #e0f2fe;
    align-self: flex-start;
}

.comment-admin {
    background: #fef3c7;
    align-self: flex-end;
}

.comment-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.comment-text {
    white-space: pre-wrap;
}

.comments-empty {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 10px;
}

.comment-form {
    margin-top: 8px;
}

.comment-textarea {
    min-height: 80px;
}

.btn-comment {
    margin-top: 6px;
}

/* Диалог в админке */
.comments-thread {
    margin-bottom: 20px;
}

/* Статусы в таблице комментариев */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.status-ok {
    background: #dcfce7;
    color: #15803d;
}

.status-wait {
    background: #fee2e2;
    color: #b91c1c;
}

/* вспомогательный текст */
.muted {
    color: #6b7280;
    font-size: 12px;
}

/* ======================
   ЛЕВОЕ МЕНЮ КУРСА
====================== */

.course-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: flex-start;
}

.course-sidebar {
    align-self: stretch;
}

.sidebar-section {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid #e5e7eb;
}

.sidebar-title {
    padding: 10px 14px;
    font-weight: 700;
    font-size: 14px;
    background: #2563eb;
    color: #ffffff;
}

.sidebar-title-secondary {
    background: #1e40af;
}

.sidebar-link {
    display: block;
    padding: 9px 14px;
    font-size: 14px;
    color: #111827;
    text-decoration: none;
    border-top: 1px solid #e5e7eb;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link:hover {
    background: #eff6ff;
}

.sidebar-link-active {
    background: #1d4ed8;
    color: #ffffff;
}

.sidebar-link-muted {
    color: #111827;
}

.sidebar-empty {
    padding: 9px 14px 11px;
    font-size: 13px;
    color: #9ca3af;
}

/* Права колонка внутри разметки курса */
.course-main {
}

/* ======================
   СТРАНИЦА СПЕЦКУРСА
====================== */

.special-page {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.special-title {
    text-align: center;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 24px;
}

.special-hero {
    width: 100%;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 24px;
}

.special-hero-img {
    display: block;
    width: 100%;
    height: auto;
}

.special-description {
    background: #ffffff;
    padding: 24px 26px;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.07);
    font-size: 16px;
    line-height: 1.8;
    color: #111827;
    margin-bottom: 24px;
    white-space: pre-line; /* чтобы переносы в описании отображались как абзацы */
}

.special-buy-wrapper {
    text-align: center;
    margin-bottom: 32px;
}

.special-buy-btn {
    padding-left: 46px;
    padding-right: 46px;
    font-size: 17px;
}

.special-buy-note {
    font-size: 13px;
    color: #6b7280;
    margin-top: 8px;
}

/* Другие спецкурсы */

.special-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 10px;
}

.special-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.special-card-title {
    font-size: 16px;
    margin-bottom: 18px;
}

.special-card-btn {
    width: 100%;
}

/* превью обложки в админке */

.special-cover-preview {
    display: block;
    max-width: 320px;
    border-radius: 10px;
    margin-bottom: 15px;
}

