﻿

:root {
    --surface: #ffffff;
    --muted: #6b7280;
    --primary: #004071;
    --success: #22c55e;
    --warning: #f59e0b;
    --bg: #f4f6f8;
    --chip: #eef2ff;
    --shadow: 0 10px 24px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .04);
    --radius: 18px;
    --nav-h: 80px; /* chiều cao navbar thực tế của bạn */
    --gap-h: 16px; /* khoảng cách dưới navbar */
}

body {
    background: var(--bg);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
.page-wrap {
    padding: 2rem 2rem;
}

.card-surface {
    background: var(--surface);
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.btn-chip {
    background: var(--chip);
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: .35rem .7rem;
    font-weight: 600;
    font-size: .8rem;
}

.btn-action {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: .50rem .75rem;
    font-weight: 600;
}

    .btn-action i {
        margin-right: .45rem;
    }

.divider {
    height: 1px;
    background: #eef2f7;
}

.badge-free {
    background: #e8fff2;
    color: #16a34a;
    font-weight: 700;
}

.badge-beginner {
    background: #ecfeff;
    color: #0891b2;
    font-weight: 700;
}

.badge-premium {
    background: #f1eeff;
    color: #6d28d9;
    font-weight: 700;
}

/* Sidebar tự cuộn trong khung */
.sidebar-scroll {
    /* chiều cao tối đa = chiều cao viewport trừ navbar và khoảng cách */
    max-height: calc(100vh - var(--nav-h) - var(--gap-h));
    overflow: auto; /* bật scrollbar cho riêng khung này */
    padding-right: 6px; /* chừa tí cho scrollbar */
}

    /* (tuỳ chọn) nếu bạn có margin-top cho sidebar, cộng vào công thức trên
   ví dụ sidebar có mt-3 ~ 16px → tăng var(--gap-h) cho đủ */

    /* Làm scrollbar đẹp (WebKit) */
    .sidebar-scroll::-webkit-scrollbar {
        width: 8px;
    }

    .sidebar-scroll::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 8px;
    }

    .sidebar-scroll::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 8px;
    }

        .sidebar-scroll::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

/* Firefox */
.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Mobile: bỏ giới hạn để khối tự chảy, không ép cuộn trong khung */
@media (max-width: 991.98px) {
    .sidebar-scroll {
        max-height: none;
        overflow: visible;
    }
}
    .sidebar .section {
        padding: 18px;
        border-radius: 16px;
        border: 1px solid #eef2f7;
        background: #fff;
        box-shadow: 0 2px 6px rgba(16, 24, 40, .04);
    }

    .sidebar h6 {
        font-weight: 800;
        margin: 0 0 .25rem;
        font-size: .9rem;
    }

.lesson {
    display: grid;
    grid-template-columns: 1fr 24px;
    column-gap: 8px;
    align-items: center; /* nội dung dọc giữa */
    padding: 10px 12px;
    border-radius: 12px;
    transition: .15s ease;
    cursor: pointer;
}

    .lesson > .d-flex {
        margin: 0; /* xoá ảnh hưởng khoảng cách thừa */
    }

    .lesson:hover {
        background: #f8fafc;
    }

    .lesson.is-current {
        background: #eef2ff;
        border: 1px solid #e0e7ff;
    }

    .lesson .title {
        font-weight: 600;
        font-size: .92rem;
        color: #111827;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 4; /* tối đa 2 dòng */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .lesson .meta {
        color: var(--muted);
        font-size: .8rem;
        margin-top: 2px;
    }

    .lesson .ic {
        width: 28px;
        height: 28px;
        display: inline-flex; /* chắc chắn là flex box riêng */
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: #f3f4f6;
        margin-right: 10px;
        flex: 0 0 28px; /* không co giãn */
    }
        .lesson .ic i {
            font-size: 14px; /* icon trái đồng cỡ */
            line-height: 1;
        }
    .lesson > i {
        width: 24px;
        height: 24px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px; /* đồng cỡ icon phải */
        line-height: 1;
        flex: 0 0 24px; /* không co giãn theo nội dung */
        align-self: center; /* luôn giữa theo chiều dọc */
    }

    .lesson .ic.playing {
        background: #110842;
        color: #e0e7ff;
    }

/* Video block */
.player {
    border-radius: 18px;
    overflow: hidden;
    position: relative;
}

    .player video,
    .player iframe {
        width: 100%;
        height: auto;
        display: block;
        background: #000;
        aspect-ratio: 16 / 9;
        /* giữ đúng 16:9 */
    }

/* progress rail + markers */
.rail {
    position: relative;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    margin-top: -8px;
}

    .rail .bar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        background: var(--primary);
        border-radius: 999px;
        width: 22%;
    }

    .rail .marker {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #22c55e;
    }

        .rail .marker.m2 {
            left: 35%;
        }

        .rail .marker.m3 {
            left: 58%;
            background: #eab308;
        }

        .rail .marker.m4 {
            left: 83%;
            background: #ef4444;
        }

        .rail .marker.m1 {
            left: 12%;
        }

/* callout “Important” */
.callout {
    position: absolute;
    left: 50%;
    bottom: 78px;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
    font-size: .9rem;
}

    .callout small {
        display: block;
        opacity: .8;
        font-weight: 500;
    }

.controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

    .controls .time {
        font-variant-numeric: tabular-nums;
        font-weight: 700;
    }

/* Tabs under player */
.download-list .item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed #eef2f7;
}

    .download-list .item:last-child {
        border-bottom: 0;
    }

.download-list .ext {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}


/* ====== Tab Báo Lỗi ====== */
#tab-error {
    /* tạo “thẻ” nổi nhẹ */
    background: #fff;
    padding: 18px;
}

    /* tiêu đề */
    #tab-error h4 {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 0 14px;
        font-weight: 800;
        letter-spacing: .2px;
    }

    /* thanh nhấn nhá dưới tiêu đề */
    #tab-error .spliter {
        flex: 1 1 auto;
        height: 3px;
        border-radius: 3px;
        background: linear-gradient(90deg, #6366f1, #22c55e);
        opacity: .8;
    }

    /* form gọn gàng */
    #tab-error form {
        display: grid;
        gap: 12px;
    }

    /* textarea */
    #tab-error textarea {
        width: 100%;
        min-height: 140px;
        resize: vertical;
        padding: 12px 14px;
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        color: #111827;
        line-height: 1.5;
        transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    }

        #tab-error textarea::placeholder {
            color: #9ca3af;
        }

        #tab-error textarea:focus {
            outline: none;
            background: #fff;
            border-color: #6366f1; /* primary */
            box-shadow: 0 0 0 4px rgba(99,102,241,.12);
        }

    /* nút gửi */
    #tab-error button[type="submit"] {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        border: 1px solid #6366f1;
        background: #6366f1;
        color: #fff;
        font-weight: 700;
        border-radius: 12px;
        transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
    }

        #tab-error button[type="submit"]:hover {
            background: #4f46e5;
            box-shadow: 0 8px 20px rgba(79,70,229,.24);
        }

        #tab-error button[type="submit"]:active {
            transform: translateY(1px);
        }

        /* nếu có icon <i> trong nút */
        #tab-error button[type="submit"] i {
            font-size: .95rem;
        }

/* responsive nhỏ */
@media (max-width: 575.98px) {
    #tab-error {
        border-radius: 14px;
        padding: 14px;
    }

        #tab-error textarea {
            min-height: 120px;
        }
}

/* ====== Locked Notice ====== */
.locked-notice {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    position: relative;
    overflow: hidden;
}

  

    /* Icon tròn */
    .locked-notice .ln-icon {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #eef2ff;
        color: #4338ca; /* tím nhẹ */
        font-size: 20px;
    }

    /* Nội dung */
    .locked-notice .ln-content h6 {
        margin: 0 0 4px;
        font-weight: 800;
        letter-spacing: .2px;
    }

    .locked-notice .ln-content p {
        margin: 0;
        color: #475569; /* slate-600 */
    }

    /* Nút */
    .locked-notice .ln-actions {
        margin-top: 10px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .locked-notice .ln-cta {
        font-weight: 700;
        border-radius: 10px;
    }

/* Responsive nhỏ */
@media (max-width: 575.98px) {
    .locked-notice {
        flex-direction: column;
        padding: 14px;
        border-radius: 14px;
    }

        .locked-notice .ln-icon {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            font-size: 18px;
        }
}

.card-surface .btn.btn-primary {
    background: #004071;
    border: unset;
}

#tab-comments .input-group-text img {
    margin-right: 8px;
}