/* --- 1. CẤU HÌNH CHUNG --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff;
    --dark-color: #1a1a1a;
    --text-muted: #6c757d;
    --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

body {
    font-family: "Inter", sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #ffffff;
    background-image: 
        radial-gradient(at 0% 0%, rgba(0, 123, 255, 0.05) 0px, transparent 50%), 
        radial-gradient(at 100% 100%, rgba(255, 0, 150, 0.03) 0px, transparent 50%),
        url("https://www.toptal.com/designers/subtlepatterns/patterns/double-bubble-outline.png");
    background-attachment: fixed;
}

/* ------------------ 2. NAVIGATION BAR ------------------ */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 6%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 25px rgba(0,0,0,0.06);
}

.logo-img {
    width: 120px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo-img:hover { transform: scale(1.15); }

.menu ul { display: flex; align-items: center; gap: 25px; list-style: none; padding: 0; margin:0; }

.nav-button {
    text-decoration: none;
    color: var(--dark-color);
    margin-left: 30px;
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

.nav-button::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(90deg, #007bff, #00c6ff);
    transition: var(--transition);
}

.nav-button:hover { color: var(--primary-color); }
.nav-button:hover::after { width: 100%; bottom: -3px; }

/* ----------------------3.DROPDOWN------------------------- */
.dropdown { position: relative; }
.dropdown > .nav-button { background: none; border: none; outline: none; }

.dropdown-content {
    display: block;
    opacity: 0;
    visibility: hidden; 
    transform: translateY(10px);
    transition: var(--transition);
    position: absolute;
    background-color: white;
    min-width: 150px;
    border-radius: 10px;
    box-shadow: 0px 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
}

.dropdown-content a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-content a:hover {
    background: rgba(0,123,255,0.08);
    color: var(--primary-color);
    transform: translateX(5px);
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ---------------- 4. HERO SECTION ------------------- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image-wrapper { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }

.hero-image-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
    transform: scale(1.05);
    opacity: 0;
    animation: fadeVideo 1.5s ease forwards;
}

.hero-text {
    position: relative;
    text-align: center;
    color: #fff;
    max-width: 800px;
    padding: 40px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(3px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(40px, 7vw, 90px);
    text-transform: uppercase;
    letter-spacing: 8px;
    font-weight: 800;
    margin-bottom: 10px;
    animation: fadeInUp 1s ease;
}

.hero-sub-hero {
    font-size: clamp(14px, 2vw, 20px);
    font-weight: 300;
    letter-spacing: 6px;
    text-transform: uppercase;
    opacity: 0.9;
    animation: fadeInUp 1.2s ease;
}





/*-------------------- CSS FOR QUIZ PAGE-------------------------*/
/*-----------------Title-----------------------------------------*/

.quiz-title {
    text-align: center;
    margin: 80px auto 40px; /* tạo khoảng cách trên + dưới */
    font-size: 42px;
    font-weight: 700;
    color: #1a1a1a;
}

.quiz-card{
    max-width: 50%;
    margin: 30px auto;
    padding: 20px;
    border-radius: 25px;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.quiz-card .quiz-title {
    display: block;
    width: 100%;
    text-align: center;
}

.option{
    display: block;
    padding: 12px;
    margin-top: 10px;
    background: #f1f1f1;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;


}
.option:hover{
    background: #dbeafe;
}

.option input{
    accent-color: blue;
    transform: scale(1.2);
}
.option input:checked + span {
  color: white;
  background: blue;
  padding: 5px 10px;
  border-radius: 5px;
}
.question{
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}
/*--------------------CTA Button---------------*/
.btn-container {
    display: flex;
    justify-content: center; /* căn giữa ngang */
    margin-top: 30px;    /* Tăng margin-top để đẩy nút xuống xa câu hỏi hơn */
    margin-bottom: 30px; /* Thêm margin-bottom để tạo khoảng trống với mép dưới card */
}

.cta-btnquiz {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 85px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s ease;
    font-size: 16px;
}

.cta-btnquiz:hover {
    background: black;
    transform: scale(1.05);
}


/* ------------------------ . FOOTER --------------------------------- */
footer {
    background: var(--dark-color); color: #fff;
    padding: 40px 20px; text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
footer p { font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); }
footer strong { color: var(--primary-color); }

/* --- 9. KEYFRAMES & RESPONSIVE --- */
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeVideo { to { opacity: 1; } }
@keyframes floating {
    0%, 100% { transform: rotate(-4deg) translateY(0px); }
    50% { transform: rotate(-4deg) translateY(-15px); }
}

@media (max-width: 768px) {
    .navbar-custom { padding: 10px 5%; }
    .nav-button { margin-left: 15px; font-size: 0.85rem; }
    .impact-columns { flex-direction: column; }
    .image-stack { height: auto; display: flex; flex-direction: column; gap: 30px; }
    .image-stack__item { position: relative; width: 100%; transform: none !important; animation: none !important; }
}


/* ==========================================================================
   5. BỔ SUNG ĐỊNH DẠNG CHO TRANG CONTACT & POPUP THÔNG BÁO
   ========================================================================== */

/* Thù hình lại kích thước của thẻ card trên trang Contact */
.contact-card {
    max-width: 550px !important;
    padding: 35px;
}

/* Định dạng các ô nhập liệu mượt mà, bo góc đồng bộ */
.form-control-custom {
    width: 100%;
    padding: 12px 20px;
    margin-top: 8px;
    margin-bottom: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 25px;
    font-family: "Inter", sans-serif;
    outline: none;
    transition: var(--transition);
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.form-label-custom {
    font-weight: 500;
    color: var(--dark-color);
    margin-left: 15px;
}

/* Ô nhập nội dung lớn */
.textarea-custom {
    border-radius: 18px !important;
}

/* Tùy chỉnh riêng cho ô checkbox dựa trên class .option sẵn có */
.checkbox-option {
    background: transparent !important;
    padding: 0 10px !important;
    margin-bottom: 25px;
    cursor: default !important;
}
.checkbox-option label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
}
.checkbox-option input {
    margin: 0;
}

/* Nút Submit dàn đều chiều ngang card */
.full-width-btn {
    width: 100%;
}

/* --- ĐỊNH DẠNG BOX THÔNG BÁO (SUCCESS POPUP) --- */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

/* Trạng thái khi kích hoạt hiển thị */
.success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.success-box {
    background: #ffffff;
    padding: 40px;
    border-radius: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    transform: scale(0.75);
    transition: var(--transition);
}

.success-overlay.active .success-box {
    transform: scale(1);
}

/* Icon tích xanh chuyển động */
.success-icon {
    width: 75px;
    height: 75px;
    background: rgba(0, 123, 255, 0.08);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
}

.success-box h3 {
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.success-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.success-box .cta-btnquiz {
    padding: 8px 45px;
    font-size: 0.9rem;
}

/* ==========================================================================
   --- 12. MODERN QUIZ RESULT BOX (HIỆU ỨNG HỘP KẾT QUẢ HIỆN ĐẠI) ---
   ========================================================================== */

/* Ẩn hộp kết quả mặc định khi người dùng chưa bấm nút Submit */
#result {
    display: none; 
}

/* Khung viền chính của hộp kết quả sử dụng phong cách đổ bóng mờ kính */
.result-box {
    display: block !important;
    max-width: 650px;
    margin: 50px auto;
    padding: 45px 35px;
    background: rgba(255, 255, 255, 0.85); /* Nền trắng trong suốt */
    backdrop-filter: blur(15px);           /* Làm mờ các chi tiết phía sau hộp */
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px;                  /* Bo tròn góc hiện đại */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08); /* Đổ bóng nhẹ nhàng, sang trọng */
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);  /* Viền trắng mảnh tạo độ nổi */
    
    /* Thiết lập trạng thái ẩn ban đầu để phục vụ animation */
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1); /* Sử dụng transition mượt giống Index */
}

/* Class được kích hoạt bằng JS sau khi bấm Submit để tạo hiệu ứng phóng to mượt mà */
.result-box.active {
    transform: scale(1);
    opacity: 1;
}

/* Định dạng tiêu đề hiển thị điểm số */
.result-score {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Số điểm lớn hiển thị nổi bật ở giữa */
.result-score span {
    font-size: 3.5rem;
    font-weight: 800;
    display: block;
    margin-top: 5px;
    font-family: 'Inter', sans-serif;
}

/* Định dạng chữ trạng thái (Ví dụ: HEALTHY LIFESTYLE) */
.result-status {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- THANH TIẾN TRÌNH ĐỘNG (PROGRESS BAR) --- */
.result-progress-bar {
    width: 100%;
    height: 10px;
    background: #eef2f5; /* Màu nền của thanh tổng thể */
    border-radius: 10px;
    overflow: hidden;
    margin: 30px 0;
}

/* Thanh màu chạy bên trong đại diện cho phần trăm điểm */
.result-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 10px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1); /* Tạo hiệu ứng thanh chạy tăng dần từ 0% */
}

/* Đoạn văn miêu tả lời khuyên chi tiết */
.result-desc {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    color: #4a4a4a;
    line-height: 1.7;
    margin-bottom: 35px;
    padding: 0 15px;
}

/* --- NÚT BẤM LÀM LẠI BÀI TEST (BUTTON RETRY) --- */
.btn-retry {
    background: var(--dark-color);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px; /* Nút bo tròn thon gọn */
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Hiệu ứng hover nút bấm giống phong cách trang Index */
.btn-retry:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.3);
}

/* ==========================================================================
   --- 13. DYNAMIC COLOR STYLES (ĐỔI MÀU THEO KẾT QUẢ TRẠNG THÁI) ---
   ========================================================================== */

/* --- TRƯỜNG HỢP 1: AN TOÀN (HEALTHY) -> MÀU XANH LÁ --- */
.result-healthy .result-status, 
.result-healthy .result-score span { 
    color: #28a745; 
}
.result-healthy .result-progress-fill { 
    background: linear-gradient(90deg, #28a745, #a3e635); /* Gradient xanh lá cây */
}
/* Tự động chèn Icon Tích xanh bằng FontAwesome thông qua thuộc tính content */
.result-healthy .result-icon::before {
    content: "\f058"; 
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 4.5rem;
    color: #28a745;
    display: inline-block;
    margin-bottom: 15px;
}

/* --- TRƯỜNG HỢP 2: TRUNG BÌNH (MODERATE) -> MÀU VÀNG --- */
.result-moderate .result-status, 
.result-moderate .result-score span { 
    color: #ffc107; 
}
.result-moderate .result-progress-fill { 
    background: linear-gradient(90deg, #ffc107, #ff9800); /* Gradient cam vàng */
}
/* Tự động chèn Icon Chấm than cảnh báo vòng tròn */
.result-moderate .result-icon::before {
    content: "\f06a"; 
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 4.5rem;
    color: #ffc107;
    display: inline-block;
    margin-bottom: 15px;
}

/* --- TRƯỜNG HỢP 3: NGUY HIỂM (HIGH SCREEN DEPENDENCY) -> MÀU ĐỎ --- */
.result-danger .result-status, 
.result-danger .result-score span { 
    color: #dc3545; 
}
.result-danger .result-progress-fill { 
    background: linear-gradient(90deg, #dc3545, #f43f5e); /* Gradient đỏ rực */
}
/* Tự động chèn Icon Tam giác nguy hiểm */
.result-danger .result-icon::before {
    content: "\f071"; 
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 4.5rem;
    color: #dc3545;
    display: inline-block;
    margin-bottom: 15px;
}

/* --- RESPONSIVE MOBILE MENU --- */
.hamburger {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
}

@media (max-width: 992px) {
    .hamburger { display: block; }

    .menu {
        display: none; 
        position: absolute;
        top: 100%; /* Đảm bảo nằm ngay dưới thanh nav */
        left: 0;
        width: 100%;
        background: #fff; /* Nên để màu trắng đục hoặc trắng hoàn toàn để dễ đọc */
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        flex-direction: column;
        align-items: center;
        z-index: 1000;
    }

    .menu.active { 
        display: flex !important; 
    }
    
    .menu ul { 
        flex-direction: column; /* Xếp dọc */
        gap: 20px;              /* Tạo khoảng cách giữa các chữ */
        width: 100%;
        align-items: center;
        padding: 0;
    }

    .nav-button { 
        margin-left: 0; 
        font-size: 1.2rem; /* Tăng size chữ cho dễ bấm trên mobile */
    }
}