/* ============================================================
   GENIE BOOK - Base CSS dùng chung cho mọi theme
   Theme file (nature/planet/pink) chỉ override các biến --gb-*
   ============================================================ */

:root {
    --gb-bg: #f5f7fa;
    --gb-bg-accent: #e8edf3;
    --gb-primary: #3b82f6;
    --gb-primary-dark: #2563eb;
    --gb-secondary: #10b981;
    --gb-danger: #ef4444;
    --gb-warning: #f59e0b;
    --gb-text: #1f2937;
    --gb-text-muted: #6b7280;
    --gb-card-bg: #ffffff;
    --gb-border: #d1d5db;
    --gb-radius: 16px;
    --gb-font-display: 'Baloo 2', 'Quicksand', 'Segoe UI', sans-serif;
    --gb-font-body: 'Quicksand', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--gb-font-body);
    background: var(--gb-bg);
    color: var(--gb-text);
    min-height: 100dvh;
}

.gb-app {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    width: 100%;
}

/* --- Topbar full-width --- */
.gb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--gb-card-bg);
    border-bottom: 3px solid var(--gb-primary);
    flex-wrap: wrap;
}

.gb-brand {
    font-family: var(--gb-font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--gb-primary-dark);
    text-decoration: none;
}

.gb-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.gb-nav a {
    color: var(--gb-text);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}

.gb-nav a:hover { background: var(--gb-bg-accent); }

.gb-user-chip {
    background: var(--gb-bg-accent);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
}

.gb-link-btn {
    background: none;
    border: none;
    color: var(--gb-text-muted);
    cursor: pointer;
    font-weight: 600;
    min-height: 48px;
    padding: 0 0.75rem;
    text-decoration: underline;
}

.gb-lang-switch { display: flex; gap: 0.25rem; }
.gb-lang-btn {
    border: 2px solid var(--gb-border);
    background: var(--gb-card-bg);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    font-weight: 700;
}
.gb-lang-btn.active { background: var(--gb-primary); color: #fff; border-color: var(--gb-primary); }

/* --- Main full-width, full-height content area --- */
.gb-main {
    flex: 1;
    width: 100%;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* --- Cards / Buttons / Forms dùng chung mọi trang (kể cả admin) --- */
.gb-card {
    background: var(--gb-card-bg);
    border-radius: var(--gb-radius);
    padding: 1.5rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.gb-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.gb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 56px;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: none;
    background: var(--gb-primary);
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none;
}
.gb-btn:hover { background: var(--gb-primary-dark); }
.gb-btn.secondary { background: var(--gb-secondary); }
.gb-btn.danger { background: var(--gb-danger); }
.gb-btn.outline { background: transparent; color: var(--gb-primary); border: 2px solid var(--gb-primary); }
.gb-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gb-input, .gb-select, .gb-textarea {
    width: 100%;
    min-height: 52px;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--gb-border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
}
.gb-textarea { min-height: 100px; }

.gb-form-group { margin-bottom: 1rem; }
.gb-form-group label { display: block; font-weight: 700; margin-bottom: 0.4rem; }

.gb-badge-pill {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--gb-bg-accent);
}
.gb-badge-pill.weak { background: #fee2e2; color: #b91c1c; }
.gb-badge-pill.strong { background: #dcfce7; color: #15803d; }
.gb-badge-pill.average { background: #fef3c7; color: #92400e; }

/* --- Câu hỏi trong lúc làm bài: chữ to, vùng chạm lớn --- */
.gb-question-card { max-width: 780px; margin: 0 auto; width: 100%; }
.gb-question-text { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.gb-question-image { max-width: 100%; border-radius: var(--gb-radius); margin-bottom: 1rem; }

.gb-option-list { display: flex; flex-direction: column; gap: 0.75rem; }
.gb-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 60px;
    padding: 0.75rem 1rem;
    border: 3px solid var(--gb-border);
    border-radius: var(--gb-radius);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
}
.gb-option:hover { border-color: var(--gb-primary); }
.gb-option input[type=radio] { width: 26px; height: 26px; }
.gb-option img { max-height: 90px; border-radius: 8px; }

.gb-timer {
    position: sticky; top: 0; z-index: 10;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    padding: 0.5rem;
    border-radius: 999px;
    background: var(--gb-bg-accent);
}
.gb-timer.warning { background: #fee2e2; color: #b91c1c; }

.gb-progress-bar { height: 12px; border-radius: 999px; background: var(--gb-bg-accent); overflow: hidden; }
.gb-progress-fill { height: 100%; background: var(--gb-primary); }

/* --- Responsive: điện thoại --- */
@media (max-width: 640px) {
    .gb-topbar { padding: 0.6rem 0.85rem; }
    .gb-main { padding: 0.85rem; }
    .gb-question-text { font-size: 1.15rem; }
    .gb-grid { grid-template-columns: 1fr; }
}

/* --- Bảng dữ liệu cho trang admin, cũng full-width --- */
.gb-table-wrap { width: 100%; overflow-x: auto; }
table.gb-table { width: 100%; border-collapse: collapse; background: var(--gb-card-bg); border-radius: var(--gb-radius); overflow: hidden; }
table.gb-table th, table.gb-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--gb-border); }
table.gb-table th { background: var(--gb-bg-accent); font-weight: 800; }

.gb-alert { padding: 1rem 1.25rem; border-radius: var(--gb-radius); font-weight: 600; }
.gb-alert.success { background: #dcfce7; color: #15803d; }
.gb-alert.error { background: #fee2e2; color: #b91c1c; }
.gb-alert.info { background: #dbeafe; color: #1d4ed8; }
