:root {
    --vn-red: #e62117;
    --vn-blue: #003466;
    --vn-correct-border: #008a3c;
    --vn-correct-bg: #e6f9ed;
    --vn-wrong-border: #e62117;
    --vn-wrong-bg: #fff1f0;
    --bar-gray: #f2f2f2;
    --border-color: #eee;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Roboto', sans-serif; margin: 0; background: #fff; color: #222; line-height: 1.6; overflow-x: hidden; }

/* --- HEADER & RESPONSIVE MENU --- */
header { border-bottom: 2px solid var(--vn-red); /*position: sticky;*/ top: 0; background: #fff; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; height: 64px; }
.logo { font-family: 'Merriweather', serif; color: var(--vn-red); font-size: 1.6rem; text-decoration: none; font-weight: bold; z-index: 1001; }

.menu-toggle { display: none; font-size: 1.8rem; cursor: pointer; color: var(--vn-blue); z-index: 1001; }

.nav-menu { display: flex; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a { padding: 20px 15px; display: block; text-decoration: none; color: var(--vn-blue); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; }

/* Dropdown Desktop */
.dropdown {
    position: absolute; top: 100%; left: 0; background: #fff; min-width: 220px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); list-style: none; padding: 10px 0;
    border-top: 2px solid var(--vn-red); opacity: 0; visibility: hidden;
    transform: translateY(10px); transition: 0.3s;
}
.dropdown li a { padding: 10px 20px; display: block; text-decoration: none; color: #333; font-size: 0.9rem; border-bottom: 1px solid #f9f9f9; }
.dropdown li a:hover { background: #f8f8f8; color: var(--vn-red); }
.nav-menu > li:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu > li:hover > a { color: var(--vn-red); }

/* --- LAYOUT 2 CỘT (STICKY BOUNDARY) --- */
.sticky-wrapper { max-width: 1200px; margin: 30px auto; display: grid; grid-template-columns: 1fr 320px; gap: 40px; padding: 0 20px; align-items: start; }
.main-content { min-width: 0; }
.sidebar { position: sticky; top: 84px; padding-bottom: 20px; }

/* --- BÀI VIẾT & QUIZ --- */
.breadcrumb { font-size: 0.75rem; color: var(--vn-red); font-weight: 700; text-transform: uppercase; margin-bottom: 10px; }
h1 { font-family: 'Merriweather', serif; font-size: 1.8rem; line-height: 1.3; margin: 0 0 20px 0; }
.sapo { font-size: 1.1rem; color: #555; border-left: 4px solid #ddd; padding-left: 20px; margin-bottom: 30px; font-weight: 300; }

.quiz-item { border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 40px; overflow: hidden; }
.quiz-header { padding: 15px 20px; background: #f8f9fa; font-weight: bold; font-size: 1.1rem; border-bottom: 1px solid var(--border-color); }
.quiz-body { padding: 20px; }

.option {
    position: relative; padding: 15px 50px 15px 20px; border: 1px solid #ddd; margin-bottom: 10px; 
    border-radius: 5px; cursor: pointer; display: flex; justify-content: space-between; overflow: hidden;
    z-index: 1; font-weight: 500; transition: background 0.2s;
}
.option::before { 
    content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 0; 
    background: var(--bar-gray); z-index: -1; transition: width 0.8s cubic-bezier(0.1, 0.5, 0.5, 1); 
}
.option.active::before { width: var(--p); }
.option.correct { border-color: var(--vn-correct-border) !important; background: var(--vn-correct-bg) !important; color: var(--vn-correct-border) !important; font-weight: bold; }
.option.wrong { border-color: var(--vn-wrong-border) !important; background: var(--vn-wrong-bg) !important; color: var(--vn-wrong-border) !important; font-weight: bold; }

.p-text { display: none; font-weight: bold; position: absolute; right: 15px; color: #666; }
.option.active .p-text { display: block; }
.explanation { display: none; padding: 15px; background: #fffde7; border: 1px dashed #fbc02d; margin-top: 15px; font-size: 0.95rem; border-radius: 4px; }

/* --- SIDEBAR WIDGETS --- */
.box-title { border-bottom: 2px solid var(--vn-blue); padding-bottom: 5px; font-weight: bold; margin-bottom: 20px; display: block; color: var(--vn-blue); font-size: 1rem; }
.card-link { display: flex; gap: 12px; margin-bottom: 20px; text-decoration: none; color: inherit; }
.card-link img { width: 100px; height: 65px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.card-link h4 { margin: 0; font-size: 0.85rem; line-height: 1.4; transition: 0.2s; }
.card-link:hover h4 { color: var(--vn-red); }

/* --- BOTTOM SECTION (OUTSIDE STICKY WRAPPER) --- */
.bottom-section { background: #f9f9f9; border-top: 1px solid var(--border-color); padding: 50px 0; }
.bottom-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.bottom-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 20px; }
.bottom-card { text-decoration: none; color: inherit; background: #fff; padding: 10px; border-radius: 8px; transition: 0.3s; }
.bottom-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.bottom-card img { width: 100%; height: 140px; object-fit: cover; border-radius: 4px; }
.bottom-card h4 { margin: 12px 0 0; font-size: 0.9rem; line-height: 1.4; font-weight: 700; }

/* --- FOOTER --- */
footer { background: #1a1a1a; color: #999; padding: 50px 0 30px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding: 0 20px; }
.footer-logo { font-family: 'Merriweather', serif; color: #fff; font-size: 1.5rem; margin-bottom: 15px; display: block; text-decoration: none; }
.footer-col h4 { color: #fff; text-transform: uppercase; font-size: 0.85rem; margin-bottom: 20px; border-left: 3px solid var(--vn-red); padding-left: 10px; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 10px; font-size: 0.85rem; }

/* --- MOBILE MENU OVERLAY --- */
.overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 998; }
.overlay.active { display: block; }

/* --- RESPONSIVE SETTINGS --- */
@media (max-width: 900px) {
    .menu-toggle { display: block; }
    .nav-menu {
position: fixed; top: 0; right: -100%; width: 280px; height: 100vh;
background: #fff; flex-direction: column; transition: 0.4s;
padding: 80px 20px 20px; z-index: 999; overflow-y: auto;
    }
    .nav-menu.active { right: 0; }
    .nav-menu > li { border-bottom: 1px solid #eee; }
    .nav-menu > li > a { padding: 15px 0; font-size: 1rem; }
    
    .dropdown { position: static; opacity: 1; visibility: visible; display: none; box-shadow: none; border: none; background: #f9f9f9; transform: none; padding-left: 15px; }
    .nav-menu li.open .dropdown { display: block; }
    .nav-menu li.has-child > a::after { content: " ▾"; }

    .sticky-wrapper { grid-template-columns: 1fr; margin: 15px auto; }
    .sidebar { display: none; }
    .bottom-grid { grid-template-columns: 1fr 1fr; }
    h1 { font-size: 1.7rem; }
    .footer-inner { grid-template-columns: 1fr; }
}
		.logo img{width: 120px;}
		@media (max-width: 768px) {
			.logo img{width: 200px;}
		}
		
		
		:root { --primary: #3498db; --success: #2ecc71; --danger: #e74c3c; }
		.quiz-card { background: white; width: 100%; max-width: 800px; border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.1); padding: 5px 30px; position: relative; }
		#prompt{ margin-top:5px; margin-bottom:5px;}
/* Chia cột phần Media */
.media-container {
    display: flex;
    gap: 20px;
    margin: 5px 0;
    align-items: center;
}

/* Cột 1: Hình ảnh */
.image-col {
    flex: 1;
    background: #f8f9fa;
    border-radius: 12px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #f1f1f1;
}
.image-col img { max-width: 90%; max-height: 220px; border-radius: 5px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

/* Cột 2: Điều khiển */
.control-col {
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Widget thông số */
.stat-box {
    background: var(--dark);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}
.timer-val { font-size: 2rem; font-weight: bold; font-family: monospace; color: #f1c40f; }
.score-val {
    font-size: 1.2rem;
    margin-top: 5px;
    color: #3498db;
    font-weight: bold;
}

/* Nút điều khiển */
.btn-action {
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-pause { background: #95a5a6; color: white; }
.btn-reset { background: #e67e22; color: white; }

/* Đáp án */
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt-btn {
    padding: 18px;
    border: 2px solid #edf2f7;
    border-radius: 12px;
    background: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.opt-btn:hover:not(:disabled) { border-color: var(--primary); background: #f0f7ff; transform: translateY(-2px); }
.correct { background: var(--success) !important; color: white; border-color: #27ae60 !important; }
.wrong { background: var(--danger) !important; color: white; border-color: #c0392b !important; }

/* Giải thích */
		
		
		
		#explanation-panel { 
    max-height: 0; 
    overflow-y: auto; /* Cho phép cuộn dọc khi nội dung dài */
    transition: all 0.5s ease-in-out; 
    background: #f0f9ff; 
    border-radius: 12px; 
    opacity: 0;
    margin-top: 0;
    padding: 0 20px; /* Chỉnh lại padding để mượt hơn khi trượt */
}

/* Khi Panel hiện lên */
#explanation-panel.show { 
    max-height: 400px; /* Giới hạn chiều cao tối đa của vùng cuộn */
    margin-top: 20px; 
    padding: 20px; 
    opacity: 1; 
    border: 1px solid #d0e8ff; 
}

/* --- Tùy chỉnh thanh cuộn (Scrollbar) cho đẹp và mỏng --- */
/* Độ rộng của thanh cuộn */
#explanation-panel::-webkit-scrollbar {
    width: 6px;
}

/* Phần nền của thanh cuộn */
#explanation-panel::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 10px;
}

/* Phần thanh trượt (cục chạy lên xuống) */
#explanation-panel::-webkit-scrollbar-thumb {
    background: #bdc3c7; 
    border-radius: 10px;
    transition: background 0.3s;
}

/* Khi di chuột vào thanh trượt */
#explanation-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary); /* Đổi sang màu xanh thương hiệu của Kiên khi rê chuột */
}
		
		

.next-btn { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: 8px; margin-top: 10px; cursor: pointer; font-weight: bold; }

.overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: rgba(255,255,255,0.9);
    display: none; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 20px; z-index: 10;
}
		
		/* Nút câu tiếp theo trong cột control */
.next-btn-control {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.4s ease; /* Hiệu ứng mượt mà */
    opacity: 1;
    transform: scale(1);
}

/* Trạng thái khi bị khóa */
.next-btn-control:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.5; /* Mờ đi */
    transform: scale(0.95); /* Thu nhỏ nhẹ để tạo cảm giác bị lún xuống */
}
.btn-pause:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1); /* Làm nút thành màu xám khi bị khóa */
}
#famous-text table {
    border: 1px solid #dee2e6;
    background-color: #ffffff;
}
#famous-text tr:nth-child(even) {
    background-color: #f8f9fa; /* Màu nền xen kẽ cho dễ đọc */
}
#famous-text td {
    border-bottom: 1px solid #eee;
}