/* =============================================================================
   HỆ THỐNG GIAO DIỆN APPLE MINIMALIST - 100% THUẦN CSS (KHÔNG FRAMEWORK)
   Nguyên tắc: Thác nước Cascading - Tuyệt đối không dùng !important
============================================================================= */

/* --- 1. BẢNG MÀU THƯƠNG HIỆU & BIẾN HỆ THỐNG --- */
:root {
    /* Brand Colors */
    --mau-chinh: #0047FF;          /* Electric Royal Blue */
    --mau-chinh-hover: #0037A8;
    --mau-phu: #FFC700;            /* Vivid Amber Yellow */
    --mau-canh-bao: #DC2626;       /* Crimson Red - Khóa thi 3 lần */
    --mau-thanh-cong: #16A34A;     /* Emerald Green - Đạt bài thi */
    --mau-gradient-toi: #001F66;   /* Deep Navy */

    /* Neutral & Surface */
    --mau-nen: #F8FAFC;            /* Slate Light */
    --mau-the: rgba(255, 255, 255, 0.88);
    --mau-chu: #0F172A;            /* Slate 900 */
    --mau-chu-phu: #64748B;        /* Slate 500 */
    --mau-vien: rgba(226, 232, 240, 0.85);

    /* Spacing & Radius */
    --bo-goc-the: 20px;
    --bo-goc-nut: 12px;
}

/* --- 2. RESET CƠ BẢN & TYPOGRAPHY --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--mau-nen);
    color: var(--mau-chu);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- 3. BỐ CỤC CHUẨN (FLEXBOX & GRID THUẦN) --- */
.khung-chinh {
    max-width: 1140px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 20px;
    flex: 1;
}

.hang-ngang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cot-doc {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.can-giua {
    display: flex;
    align-items: center;
    justify-content: center;
}

.luoi-2-cot {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.luoi-3-cot {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Cột bài học chiếm 2 phần, sidebar 1 phần */
    gap: 32px;
}

/* Responsive di động thuần CSS */
@media (max-width: 768px) {
    .luoi-2-cot,
    .luoi-3-cot {
        grid-template-columns: 1fr;
    }
    .hang-ngang {
        flex-wrap: wrap;
    }
}

/* --- 4. CÁC THÀNH PHẦN APPLE MINIMALIST (COMPONENTS) --- */

/* Thẻ kính mờ Apple Card */
.the-apple {
    background: var(--mau-the);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--mau-vien);
    border-radius: var(--bo-goc-the);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.04);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.the-apple:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 71, 255, 0.07);
}

/* Nút bấm Apple Button */
.nut-bam {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--bo-goc-nut);
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nut-bam:hover {
    transform: scale(0.985);
}

.nut-chinh {
    background-color: var(--mau-chinh);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(0, 71, 255, 0.25);
}
.nut-chinh:hover {
    background-color: var(--mau-chinh-hover);
}

.nut-phu {
    background-color: #E2E8F0;
    color: #334155;
}
.nut-phu:hover {
    background-color: #CBD5E1;
}

.nut-canh-bao {
    background-color: var(--mau-canh-bao);
    color: #FFFFFF;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.25);
}

/* Banner Gradient chuẩn nhận diện */
.banner-gradient {
    background: linear-gradient(135deg, var(--mau-chinh) 0%, var(--mau-gradient-toi) 100%);
    color: #FFFFFF;
    border-radius: var(--bo-goc-the);
    padding: 36px 32px;
}

/* Ô nhập liệu Form Apple */
.o-nhap-lieu {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--bo-goc-nut);
    border: 1px solid var(--mau-vien);
    background-color: #F8FAFC;
    font-family: inherit;
    font-size: 14px;
    color: var(--mau-chu);
    outline: none;
    transition: all 0.2s ease;
}

.o-nhap-lieu:focus {
    border-color: var(--mau-chinh);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(0, 71, 255, 0.1);
}

/* Huy hiệu trạng thái (Badges) */
.huy-hieu {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.huy-hieu-vang {
    background-color: rgba(255, 199, 0, 0.15);
    color: #854D0E;
    border: 1px solid rgba(255, 199, 0, 0.3);
}

.huy-hieu-xanh {
    background-color: rgba(22, 163, 74, 0.15);
    color: var(--mau-thanh-cong);
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.huy-hieu-do {
    background-color: rgba(220, 38, 38, 0.15);
    color: var(--mau-canh-bao);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

/* Khung Video 16:9 bo góc mượt mà */
.khung-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background-color: #000;
}
.khung-video iframe {
    width: 100%;
    height: 100%;
    border: none;
}
