:root {
    --bg-main: #1a1a2e;
    --bg-side: #16213e;
    --bg-card: #0f3460;
    --accent: #e94560;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --font-sans: 'Inter', 'Noto Sans TC', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Master Fixed Nav Fix */
.hidden { display: none !important; }

/* Layout */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 280px;
    background-color: var(--bg-side);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.05);
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 20px 40px; /* Refined spacing */
    max-width: 1200px;
}

/* Sidebar Nav */
.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.logo-emoji { font-size: 2.2rem; }
.logo-text { font-size: 1.5rem; font-weight: 700; color: var(--accent); letter-spacing: 1.5px; }

.nav-menu { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 15px 20px;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 700;
}
.nav-btn.active, .nav-btn:hover { background-color: rgba(233, 69, 96, 0.15); color: var(--accent); }

.sponsor-btn {
    background-color: #6772e5;
    color: white;
    text-decoration: none;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    display: block;
    margin-top: auto;
    font-size: 0.95rem;
}

/* Hero Section Refactor */
.hero-usp-card {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    border: 1px solid rgba(233, 69, 96, 0.3);
    position: relative;
    overflow: hidden;
}

.usp-tag { display: inline-block; background: var(--accent); padding: 4px 12px; border-radius: 4px; font-size: 0.8rem; font-weight: 700; margin-bottom: 15px; }

.responsive-title {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-wrap: balance; 
    line-height: 1.2;
}

.usp-description { color: var(--text-muted); font-size: 1.2rem; margin-bottom: 20px; max-width: 800px; }
.blooms-summary { background: rgba(46, 204, 113, 0.1); padding: 15px; border-radius: 10px; color: #fff; font-size: 0.95rem; border-left: 4px solid var(--success); }

/* Milestone & Quest Grid */
.milestone-card { background: var(--bg-side); padding: 25px; border-radius: 15px; margin-bottom: 40px; }
.progress-container { height: 10px; background: #2b2e4a; border-radius: 5px; margin: 15px 0 10px; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 5px; transition: width 0.8s; box-shadow: 0 0 10px var(--accent); }
.progress-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); }

.quest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 40px; }
.quest-card { padding: 20px; border-radius: 12px; background: var(--bg-card); transition: all 0.3s; text-align: center; }
.quest-tag { font-size: 0.7rem; font-weight: 700; opacity: 0.6; margin-bottom: 8px; }
.quest-status { font-weight: 700; font-size: 1.2rem; }

.quest-active { border: 2px solid var(--accent); }
.quest-done { background: rgba(46, 204, 113, 0.05); border-bottom: 4px solid var(--success); }
.quest-locked { opacity: 0.3; filter: grayscale(1); }

/* Subject Grid */
.section-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 25px; border-left: 5px solid var(--accent); padding-left: 15px; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; }
.subject-btn { background: var(--bg-card); padding: 30px; border-radius: 15px; text-align: center; cursor: pointer; border: 1px solid rgba(255,255,255,0.05); }
.subject-btn:hover { background: #16213e; border-color: var(--accent); transform: translateY(-5px); transition: all 0.2s; }
.subject-btn .emoji { font-size: 2.8rem; display: block; margin-bottom: 10px; }

/* Overlays & Exams */
.exam-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 2000; display: flex; justify-content: center; padding-top: 50px; }
.overlay-content { background: var(--bg-main); width: 90%; max-width: 900px; border-radius: 20px; padding: 40px; height: 85vh; overflow-y: auto; border: 1px solid #333; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; margin: 15px 0 30px; }
.item-grid-group h3 { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 10px; border-bottom: 1px solid #333; padding-bottom: 5px; }
.exam-item { background: var(--bg-side); padding: 15px; border-radius: 10px; cursor: pointer; text-align: center; border: 1px solid transparent; }
.exam-item:hover { border-color: var(--accent); color: var(--accent); }

/* Fullscreen Exam Session View */
.fullscreen-view { position: fixed; inset: 0; background: var(--bg-main); z-index: 3000; padding: 40px; display: flex; flex-direction: column; }
.question-container { max-width: 850px; margin: 0 auto; width: 100%; flex: 1; overflow-y: auto; background: var(--bg-side); padding: 40px; border-radius: 20px; }

.context-box { background: rgba(0,0,0,0.3); padding: 25px; border-radius: 12px; margin-bottom: 25px; color: var(--text-muted); }
.question-text { font-size: 1.5rem; font-weight: 700; margin-bottom: 40px; }

.option-list { display: flex; flex-direction: column; gap: 15px; }
.option-item { background: var(--bg-card); border: 2px solid transparent; padding: 20px; border-radius: 10px; color: #fff; cursor: pointer; text-align: left; }
.option-item.selected { border-color: var(--accent); background: rgba(233, 69, 96, 0.1); }
.option-item.correct { border-color: var(--success); }
.option-item.wrong { border-color: var(--danger); }

/* Responsive Adjustments */
@media (max-width: 900px) {
    .sidebar { width: 100%; height: auto; position: relative; }
    .app-container { flex-direction: column; }
    .main-content { margin-left: 0; padding: 20px; }
    .responsive-title { font-size: 2.2rem; }
}
