/* ============================================================
   style.css — CSS chung toàn site
   Màu chủ đạo: Cờ Hoa Kỳ (Old Glory Blue + Red + White)
   - Old Glory Blue (Pantone 282C): #002147
   - Old Glory Red (PMS 193C): #BB133E
   ============================================================

   --color-blue   : Old Glory Blue  #002147  (header, link hover, tiêu đề)
   --color-red    : Old Glory Red   #BB133E  (nút phụ, badge rớt, accent)
   --color-white  : Trắng           #FFFFFF  (nền chính, chữ trên nền tối)
   --color-text   : Chữ chính       #2c3e50
   --color-text-2 : Chữ phụ         #444444
   --color-muted  : Xám nhạt        #6b7280  (chữ phụ, border nhẹ)
   --color-bg     : Nền trang       #f8f9fa
   --color-bg-2   : Nền card nhạt   #f8fafc
   --color-border : Border mặc định #e0e0e0
   --color-green  : Badge đậu       #28a745
   ============================================================ */

:root {
    --color-blue:   #002147;
    --color-red:    #BB133E;
    --color-white:  #FFFFFF;
    --color-text:   #2c3e50;
    --color-text-2: #444444;
    --color-muted:  #6b7280;
    --color-bg:     #f8f9fa;
    --color-bg-2:   #f8fafc;
    --color-border: #e0e0e0;
    --color-green:  #28a745;
    --color-bg-states: #f0f4f8;

    --shadow-blue:        rgba(0, 33, 71, 0.15);
    --shadow-blue-strong: rgba(0, 33, 71, 0.30);
    --red-glow:           rgba(187, 19, 62, 0.15);
    --blue-hero-dark:     #001030;
    --blue-gradient:      linear-gradient(90deg, var(--color-blue), #1e3a8a);
    --blue-light:         #06f;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--blue-hero-dark);
    background: var(--color-bg);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
    color: var(--color-blue);
    margin-bottom: 24px;
    font-weight: 700;
}

h1 {
    font-size: 1.9rem;
    padding-bottom: 10px;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--color-red);
    padding-bottom: 8px;
    display: table;
}

h3 {
    font-size: 1.3rem;
    padding-bottom: 6px;
    display: inline-block;
}

h4 {
    font-size: 1.1rem;
    padding-bottom: 5px;
    display: inline-block;
}

p {
    color: var(--blue-hero-dark);
    margin-bottom: 12px;
    font-size: 1.05rem;
}

ul, ol {
    padding-left: 20px;
    color: var(--blue-hero-dark);
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.text-center {
    text-align: center;
}

a {
    color: var(--blue-light);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--color-red);
}

/* ===== HEADER ===== */
.site-header {
    background: var(--color-blue);
    color: var(--color-white);
    box-shadow: 0 2px 10px var(--shadow-blue);
    position: sticky;
    top: 0;
    z-index: 1000;
}
 
.header-inner {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 0;
    min-height: 56px;
}
 
/* ── Logo ── */
.logo { flex-shrink: 0; }
.logo img { display: block; }
 
/* ── Nav ── */
.main-menu-nav {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}
 
.menu-track {
    display: flex;
    gap: 28px;
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
}
.menu-track::-webkit-scrollbar { display: none; }
 
.menu-item {
    color: var(--color-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: color 0.3s;
    flex-shrink: 0;
    white-space: nowrap;
}
.menu-item:hover { color: var(--color-red); }
 
/* Home icon */
.menu-item--home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}
.menu-item--home svg { display: block; transition: transform 0.18s ease; }
.menu-item--home:hover svg,
.menu-item--home:focus svg { transform: translateY(-2px); }
 
/* Arrow buttons */
.menu-arrow {
    flex-shrink: 0;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 33, 71, 0.9);
    color: var(--color-white);
    padding: 0;
    transition: all 0.2s ease;
}
.menu-arrow:hover { background: var(--color-red); transform: scale(1.1); }
.arrow-icon {
    width: 24px; height: 24px;
    stroke: var(--color-white); stroke-width: 2.8;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.menu-arrow.hidden { opacity: 0; pointer-events: none; }
 
/* ── User icon ── */
.user-icon { flex-shrink: 0; margin-left: 8px; }
 
/* Icon chưa đăng nhập */
.user-link--guest {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--color-white);
    text-decoration: none;
    transition: background 0.2s;
}
.user-link--guest:hover { background: rgba(255,255,255,0.15); color: var(--color-white); }
 
/* Avatar đã đăng nhập */
.user-link--avatar {
    display: block;
    text-decoration: none;
    border-radius: 50%;
}
.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-red);
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.35);
    transition: border-color 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.user-link--avatar:hover .user-avatar {
    border-color: var(--color-white);
    transform: scale(1.08);
}
 
/* ── Header Mobile ── */
@media (max-width: 768px) {
    .menu-arrow.left { display: none !important; }
    .menu-arrow { width: 18px; height: 18px; }
    .arrow-icon { width: 16px; height: 16px; stroke-width: 2.5; }
    .header-inner {
        flex-wrap: nowrap;
        padding: 0 8px;
        min-height: 48px;
    }
    .logo img { width: 36px; height: 36px; }
    .main-menu-nav { padding: 0 4px; }
    .menu-track { gap: 14px; }
    .menu-item { font-size: 0.85rem; }
    .menu-item--home { padding: 0 }
    .logo { margin-right: 4px; }
    .user-icon { margin-left: 4px; }
    .user-avatar { width: 32px; height: 32px; font-size: 0.9rem; }
    .user-link--guest { width: 32px; height: 32px; }
}

/* ===== FORM ===== */
.form-group { margin-bottom: 20px; }

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #34495e;
}

input, select {
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 15px;
    background: var(--color-white);
}

input:focus,
select:focus {
    border-color: var(--color-blue);
    box-shadow: 0 0 0 4px rgba(0, 33, 71, 0.15);
    outline: none;
}

select {
    padding-right: 36px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23002147' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
}

/* ===== BUTTONS ===== */
.auth-buttons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 10px 22px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--shadow-blue-strong);
}

.btn-primary {
    background: var(--blue-gradient);
    color: var(--color-white);
}

.btn-primary:hover {
    background: linear-gradient(90deg, #001530, var(--color-blue));
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow-blue-strong);
}

.btn-secondary,
.btn-register,
.btn-logout {
    background: var(--color-red);
    color: var(--color-white);
}

.btn-secondary:hover,
.btn-register:hover,
.btn-logout:hover {
    background: var(--color-white);
}

.btn-login {
    background: var(--color-white);
    color: var(--color-blue);
    border: 2px solid var(--color-white);
}

.btn-login:hover {
    background: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn-outline {
    background: transparent;
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.6);
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--color-white);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* ===== ALERT ===== */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ===== REVIEW / CÂU HỎI HAY SAI ===== */
.review-item {
    margin: 32px 0;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--color-bg);
    border-left: 6px solid var(--color-red);
}

.review-item h4 {
    margin-bottom: 12px;
    font-size: 1.25rem;
    color: var(--color-blue);
}

.answer-item {
    padding: 6px 10px;
    margin-bottom: 5px;
    border-radius: 10px;
    background: var(--color-white);
    border: 2px solid #e2e8f0;
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.2s ease;
    position: relative;
}

.question-wrap {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.question-content { flex: 2; }

.question-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--color-blue);
    font-weight: 700;
}

.question-title p {
    all: unset;
    display: block;
}
.question-content label img{
    width:100px;
}
.question-image img {
    width:200px;
    max-height:250px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    object-fit: contain;
    background: var(--color-white);
}

.missed-stats { font-size: 1.2rem; margin-bottom: 15px; }
.missed-stats span {
    color: var(--color-red);
    font-weight: 700;
}

@media (max-width: 768px) {
    .question-wrap {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }

    .question-content {
        width: 100%;
        text-align: left;
    }

    .question-image {
        max-width: 100%;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .question-image img { max-width: 90%; }
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--color-blue);
    color: var(--color-white);
    padding: 60px 0 40px;
    margin-top: 60px;
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-logo h3 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--color-white);
}

.footer-logo p {
    font-size: 0.95rem;
    opacity: 0.8;
}

.footer-links h4,
.footer-support h4,
.footer-social h4 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--color-white);
}

.footer-links ul,
.footer-support ul {
    list-style: none;
    padding: 0;
}

.footer-links li,
.footer-support li { margin-bottom: 10px; }

.footer-links a,
.footer-support a {
    color: var(--color-white);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover,
.footer-support a:hover { color: var(--color-red); }

.social-icons {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.social-link {
    color: var(--color-white);
    font-size: 0.95rem;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s;
}

.social-link:hover { background: rgba(187, 19, 62, 0.3); }

.footer-social .credit {
    margin-top: 16px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-inner p,
.footer-bottom p { color: var(--color-white); }

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-icons { justify-content: center; }
    .site-footer {
        margin-top: 20px;
    }
}