/**
 * Lado Competition Core - Public CSS
 * Giao diện Front-end: Khu vực thi trắc nghiệm, bài Hiến kế và Widget AI Chatbot
 */

/* ==========================================================================
   1. BỐ CỤC CHÍNH (WRAPPER)
   ========================================================================== */
#lado-exam-wrapper {
    max-width: 900px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #fdfdfd;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    box-sizing: border-box;
    position: relative;
}

/* ==========================================================================
   2. HEADER & TIMER (Thanh trên cùng & Đồng hồ đếm ngược)
   ========================================================================== */
.lado-exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #ce2029;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.lado-exam-title h2 {
    margin: 0;
    color: #1a202c;
    font-size: 22px;
    font-weight: 700;
}

.lado-exam-title p {
    margin: 5px 0 0 0;
    color: #718096;
    font-size: 14px;
}

/* Đồng hồ đếm ngược dính chặt (Sticky) trên mobile */
#lado-timer {
    font-size: 26px;
    font-weight: 800;
    color: #ce2029;
    background: #fff0f0;
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid #ffcccc;
    letter-spacing: 1px;
    text-align: center;
    min-width: 100px;
}

/* ==========================================================================
   3. KHU VỰC CÂU HỎI TRẮC NGHIỆM
   ========================================================================== */
.lado-question-block {
    margin-bottom: 25px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.lado-question-block:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.lado-question-block h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 17px;
    line-height: 1.5;
}

/* Thẻ bọc đáp án (Làm thành dạng Card để dễ bấm trên điện thoại) */
.lado-options label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    transition: background 0.2s, border-color 0.2s;
    font-size: 15px;
    color: #4a5568;
}

.lado-options label:hover {
    background: #edf2f7;
    border-color: #a0aec0;
}

/* Khi người dùng click chọn đáp án (cần JS thêm class 'selected' hoặc dùng pseudo-class) */
.lado-options input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
    cursor: pointer;
}

.lado-options input[type="radio"]:checked + span {
    font-weight: 600;
    color: #ce2029;
}

/* ==========================================================================
   4. NÚT THAO TÁC (Nộp bài, Bắt đầu thi)
   ========================================================================== */
.lado-btn-primary {
    display: inline-block;
    background-color: #ce2029;
    color: #ffffff;
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    width: 100%;
    margin-top: 20px;
    text-transform: uppercase;
}

.lado-btn-primary:hover {
    background-color: #a0181f;
}

.lado-btn-primary:active {
    transform: translateY(2px);
}

.lado-btn-primary:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
}

/* ==========================================================================
   5. WIDGET CHATBOT AI (LaDo-AI)
   ========================================================================== */
#lado-chatbot-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 350px;
    max-height: 500px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.lado-chatbot-header {
    background: #ce2029;
    color: #ffffff;
    padding: 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lado-chatbot-header span {
    font-size: 16px;
}

.lado-chatbot-close {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
}

.lado-chatbot-close:hover {
    opacity: 1;
}

.lado-chatbot-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8fafc;
    min-height: 250px;
    max-height: 350px;
}

.lado-chatbot-input-area {
    display: flex;
    padding: 10px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.lado-chatbot-input-area input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
}

.lado-chatbot-input-area input[type="text"]:focus {
    border-color: #ce2029;
}

.lado-chatbot-input-area button {
    background: #ce2029;
    color: white;
    border: none;
    padding: 0 15px;
    margin-left: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* ==========================================================================
   6. RESPONSIVE (Cho Điện thoại và Máy tính bảng)
   ========================================================================== */
@media (max-width: 768px) {
    #lado-exam-wrapper {
        margin: 15px;
        padding: 20px;
    }

    .lado-exam-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #lado-timer {
        margin-top: 15px;
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    #lado-chatbot-widget {
        bottom: 0;
        right: 0;
        width: 100%;
        border-radius: 12px 12px 0 0;
    }
}