/* CSS riêng cho trang làm bài test */

/* 1. Layout tập trung */
.test-container {
    max-width: 1200px;
    /* Mở rộng layout cho PC */
    margin: 40px auto;
    padding: 0 20px;
    min-height: 60vh;
}

.layout-grid {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    /* Để sticky hoạt động tốt */
}

/* Cột biểu đồ */
.chart-col {
    flex: 1;
    min-width: 350px;
    position: sticky;
    top: 100px;
    /* Dính cách top 100px thay vì giữa màn hình để tránh bị lệch thấp quá */
    z-index: 10;
}

/* Cột câu hỏi */
.quiz-col {
    flex: 1.5;
}

/* Biểu đồ Radar */
.chart-wrapper {
    width: 100%;
    /* Giữ nguyên tỉ lệ hình vuông cho chart */
    max-width: 100%;
    /* Mobile full width */
    margin: 0 auto 20px auto;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-sm);
}

/* Giải thích dưới chart */
.chart-explanation {
    /* margin-top: 16px; handled by PC query or default */
    margin: 16px auto 0 auto;
    /* Default centering if width restricted, margin top 16 */
    padding: 16px;
    background: #F7F9FA;
    border-left: 3px solid var(--color-secondary);
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--color-text-main);
    line-height: 1.5;
    display: none;
    /* Ẩn mặc định, hiện khi có nội dung */
    text-align: justify;
}

/* PC Specific styles for horizontal centering */
@media (min-width: 901px) {
    .chart-wrapper {
        max-width: 450px;
        margin: 0 auto;
    }

    .chart-explanation {
        max-width: 450px;
        margin: 16px auto 0 auto;
    }
}

/* 2. Header nút Close */
/* 2. Header nút Close */
.btn-close {
    font-size: 1rem;
    /* Smaller text size */
    color: rgba(255, 255, 255, 0.8);
    /* White for dark header */
    text-decoration: none;
    padding: 8px 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Space between text and icon */
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 3. Thanh tiến độ (Progress Bar) */
.progress-container {
    width: 100%;
    height: 8px;
    /* Dày hơn xíu cho rõ */
    background-color: #E2E8F0;
    border-radius: 4px;
    margin-bottom: 40px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--color-primary);
    width: 0%;
    /* JS sẽ cập nhật */
    transition: width 0.5s ease;
    border-radius: 3px;
}

/* 4. Thẻ câu hỏi (Quiz Card) */
.quiz-card {
    padding: 40px 48px;
    text-align: center;
    background-color: #F0F9FF;
    /* Light blue tint to distinguish from radar chart */
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.question-text {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 32px;
    font-weight: 600;
    background-color: var(--color-primary);
    /* Dark Teal Block */
    padding: 24px;
    /* Increased padding for better look */
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    position: relative;
}

/* Style for the "Câu X/12" label inside the question text */
.question-text span {
    color: var(--color-icon-bg) !important;
    /* Light Yellow for contrast on Teal */
}

/* 5. Danh sách lựa chọn (Options) */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.option-btn {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--color-bg);
    /* Viền mờ mặc định */
    background-color: #fff;
    border-radius: 8px;
    text-align: left;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-btn:hover {
    background-color: var(--color-bg);
    border-color: var(--color-border);
}

/* Trạng thái được chọn */
.option-btn.selected {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-weight: 500;
}

/* 6. Navigation Buttons */
.quiz-nav {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-text {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    cursor: pointer;
    text-decoration: underline;
}

.btn:disabled {
    background-color: #E2E8F0;
    color: #A0AEC0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 7. Animation nhẹ nhàng */
.question-fade-wrapper {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .layout-grid {
        flex-direction: column;
        gap: 20px;
    }

    .chart-col {
        position: relative; /* Đổi từ sticky sang relative để người dùng có thể trượt xuống dưới */
        z-index: 1;
        background-color: var(--color-bg);
        /* Nền đè lên nội dung khi scroll */
        /* da xoa transform o PC nen khong can reset */
        padding-top: 10px;
        padding-bottom: 10px;
        min-width: 100%;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        /* Bóng đổ ngăn cách */
        margin-left: -20px;
        /* Hack để full width màn hình */
        margin-right: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .chart-wrapper {
        max-width: 300px;
        /* Thu nhỏ chart trên mobile */
        margin: 0 auto;
        padding: 5px;
    }

    .quiz-card {
        padding: 24px;
        min-height: auto;
    }

    .question-text {
        font-size: 1.15rem;
    }

    .option-btn {
        padding: 12px 16px;
        /* Gọn hơn trên mobile */
    }
}