* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* ── Navbar ── */
nav {
    background: #2c3e50;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav .nav-brand {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
}

nav .nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

nav .nav-links a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
}

nav .nav-links a:hover {
    background: #34495e;
}

nav .nav-links .btn-logout {
    background: none;
    border: 1px solid #ecf0f1;
    color: #ecf0f1;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

nav .nav-links .btn-logout:hover {
    background: #34495e;
}

nav .nav-links .user-greeting {
    color: #bdc3c7;
    font-size: 14px;
}

/* ── Layout ── */
.container {
    max-width: 960px;
    margin: 32px auto;
    padding: 0 16px;
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c3e50;
}

h2 {
    font-size: 20px;
    margin: 20px 0 12px;
    color: #2c3e50;
}

h3 {
    font-size: 17px;
    margin: 16px 0 8px;
    color: #2c3e50;
}

h4 {
    font-size: 15px;
    margin: 12px 0 6px;
    color: #2c3e50;
}

p {
    line-height: 1.6;
    margin-bottom: 10px;
}

a {
    color: #2980b9;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
}

/* ── Buttons ── */
button,
.btn {
    background: #2980b9;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover,
.btn:hover {
    background: #2471a3;
}

button.btn-danger {
    background: #e74c3c;
}

button.btn-danger:hover {
    background: #c0392b;
}

/* ── Forms ── */
.form-card {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    padding: 28px;
    max-width: 420px;
    margin: 0 auto;
}

.form-card h1 {
    margin-bottom: 20px;
}

.form-card p {
    margin-bottom: 14px;
}

.form-card label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #555;
}

.form-card input[type="text"],
.form-card input[type="password"],
.form-card input[type="email"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 4px;
}

.form-card input:focus {
    outline: none;
    border-color: #2980b9;
}

.form-card button {
    width: 100%;
    margin-top: 8px;
    padding: 10px;
}

.form-card .form-footer {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #666;
}

/* ── Home: course grid ── */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.course-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.course-card img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background: #f5f5f5;
}

.course-card-body {
    padding: 14px;
}

.course-card-body h2 {
    font-size: 16px;
    margin: 0 0 8px;
}

.course-card-body p {
    font-size: 14px;
    color: #666;
}

/* ── Course detail ── */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 12px;
}

.status-badge.enrolled  { background: #d5f5e3; color: #1e8449; }
.status-badge.pending   { background: #fef9e7; color: #b7950b; }
.status-badge.rejected  { background: #fde8e8; color: #c0392b; }
.status-badge.archived  { background: #eaecee; color: #555; }

.module-block {
    background: #fff;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.lesson-list {
    list-style: none;
    margin-top: 8px;
    padding: 0;
}

.lesson-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.lesson-list li:last-child {
    border-bottom: none;
}

.lesson-progress {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Lesson detail ── */
.step-list {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.step-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.step-list li:last-child {
    border-bottom: none;
}

/* ── Step detail ── */
.steps-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.steps-nav a {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.2s;
}

.steps-nav a:hover {
    background: #eee;
    text-decoration: none;
}

.steps-nav a.active {
    font-weight: bold;
    border-color: #2980b9;
    color: #2980b9;
}

.steps-nav a.completed {
    background: #27ae60;
    color: #fff;
    border-color: #1e8449;
}

.steps-nav a.active.completed {
    outline: 2px solid #2980b9;
}

.step-content {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    line-height: 1.7;
}

video {
    max-width: 100%;
    border-radius: 6px;
    margin-top: 8px;
}

.question {
    background: #fff;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.question label {
    display: block;
    padding: 4px 0;
    cursor: pointer;
    font-size: 14px;
}

pre {
    background: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    font-size: 13px;
    overflow-x: auto;
    margin: 8px 0;
}

textarea[name="code"] {
    width: 100%;
    font-family: monospace;
    font-size: 13px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    background: #1e1e1e;
    color: #d4d4d4;
}

.result-correct { color: #27ae60; font-weight: bold; margin-top: 10px; }
.result-wrong   { color: #e74c3c; font-weight: bold; margin-top: 10px; }

.next-step {
    margin-top: 24px;
}

/* ── Profile ── */
.profile-card {
    background: #fff;
    border-radius: 6px;
    padding: 24px;
    max-width: 420px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.profile-card p {
    margin-bottom: 16px;
    font-size: 15px;
}

.empty-message {
    color: #888;
    font-size: 15px;
}



/* ── Course detail new layout ── */

.course-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 24px;
    align-items: start;
}

.course-main {
    min-width: 0;
}

/* прячем radio */
.course-main input[type="radio"] {
    display: none;
}

.course-panel {
    display: none;
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

#tab-description:checked ~ .panel-description {
    display: block;
}

#tab-content:checked ~ .panel-content {
    display: block;
}

#tab-reviews:checked ~ .panel-reviews {
    display: block;
}

.course-detail-image {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 18px;
    background: #f5f5f5;

}

.course-description {
    font-size: 15px;
    color: #444;
    line-height: 1.7;
}

.course-price {
    margin-top: 14px;
    font-size: 16px;
}

.course-price.free {
    color: #1e8449;
}

.course-students {
    margin-top: 8px;
    font-size: 14px;
    color: #555;
}

.course-action-box {
    margin-top: 20px;
}

.course-action-box form {
    margin-top: 10px;
}

/* правая сторона */
.course-sidebar {
    position: sticky;
    top: 24px;
}

.course-sidebar-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.course-sidebar-card h3 {
    margin-top: 0;
    margin-bottom: 14px;
}

.course-menu-item {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 8px;
    transition: background 0.2s, color 0.2s;
}

.course-menu-item:hover {
    background: #eef5fb;
    color: #2980b9;
}

.course-menu-item.active {
    background: #2980b9;
    color: #fff;
}


@media (max-width: 768px) {
    .course-page-layout {
        grid-template-columns: 1fr;
    }

    .course-sidebar {
        position: static;
        order: -1;
    }

    .course-sidebar-card {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    .course-sidebar-card h3 {
        width: 100%;
    }

    .course-menu-item {
        margin-bottom: 0;
    }
}
/* ── Reviews ── */

.review-form-block,
.reply-form-block {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.review-form-block h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.review-form-block textarea,
.reply-form-block textarea {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.review-rating-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
    margin-bottom: 10px;
}

.review-rating-stars input[type="radio"] {
    display: none;
}

.review-rating-stars label {
    font-size: 1.8rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.15s;
}

.review-rating-stars input:checked ~ label,
.review-rating-stars label:hover,
.review-rating-stars label:hover ~ label {
    color: #f5a623;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.review-author {
    font-weight: 600;
}

.review-stars {
    color: #f5a623;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.review-date {
    color: #888;
    font-size: 0.82rem;
    margin-left: auto;
}

.review-text {
    margin: 0 0 10px;
    line-height: 1.5;
}

.review-reply {
    background: #eaf2fb;
    border-left: 3px solid #2980b9;
    border-radius: 0 6px 6px 0;
    padding: 10px 14px;
    margin-top: 10px;
}

.review-reply strong {
    font-size: 0.85rem;
    color: #2471a3;
}

.review-reply p {
    margin: 6px 0 4px;
    line-height: 1.5;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.82rem;
}

.reviews-count {
    font-size: 0.85rem;
    color: #666;
    margin-left: 4px;
}

/* ── Sidebar course action block ── */

.sidebar-course-action {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-course-action .course-price {
    margin: 0;
    font-size: 1rem;
}

.sidebar-course-action form {
    margin: 0;
}

.sidebar-course-action button {
    width: 100%;
}

.sidebar-course-action .status-badge {
    display: block;
    text-align: center;
}

.btn-login-hint {
    display: block;
    text-align: center;
    padding: 8px 12px;
    background: #ecf0f1;
    border-radius: 6px;
    color: #2980b9;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-login-hint:hover {
    background: #d5e8f5;
}

/* ── Language switcher ── */
.lang-switcher {
    display: flex;
    gap: 4px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.lang-switcher button {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #ecf0f1;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.lang-switcher button:hover {
    background: #34495e;
}

.lang-switcher button.lang-active {
    background: #2980b9;
    border-color: #2980b9;
}
