* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: #f0f2f5; color: #333; }
.demo-banner { background: linear-gradient(135deg, #6C3CE1, #4A1FB8); color: #fff; text-align: center; padding: 10px; font-size: 0.9rem; }
.demo-banner a { color: #FFD700; font-weight: 700; text-decoration: none; margin-left: 8px; }
.demo-banner a:hover { text-decoration: underline; }
.analysis-layout { display: flex; min-height: calc(100vh - 40px); }

/* Sidebar */
.sidebar { width: 260px; background: #1a1a2e; padding: 24px 0; flex-shrink: 0; }
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 16px; }
.sidebar-header h2 { color: #fff; font-size: 1.2rem; font-weight: 700; }
.sidebar-header p { color: rgba(255,255,255,0.5); font-size: 0.82rem; margin-top: 4px; }
.sidebar-tabs { display: flex; gap: 4px; margin: 16px 20px 0; background: rgba(255,255,255,0.08); border-radius: 8px; padding: 3px; }
.sidebar-tabs button { flex: 1; padding: 6px 10px; border: none; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; background: transparent; color: rgba(255,255,255,0.6); transition: all 0.2s; }
.sidebar-tabs button.active { background: #6C3CE1; color: #fff; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.6); font-size: 0.9rem; cursor: pointer; transition: all 0.2s; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(108,60,225,0.2); color: #fff; border-left-color: #6C3CE1; font-weight: 600; }
.nav-item i { width: 20px; text-align: center; font-size: 0.95rem; }

/* Main Content */
.main-content { flex: 1; padding: 28px 32px; overflow-y: auto; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.content-header h1 { font-size: 1.5rem; color: #1a1a2e; font-weight: 700; }
.header-actions { display: flex; gap: 10px; }
.btn-outline { padding: 8px 18px; border: 2px solid #6C3CE1; color: #6C3CE1; background: #fff; border-radius: 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.btn-outline:hover { background: #6C3CE1; color: #fff; }
.btn-primary { padding: 8px 18px; background: #6C3CE1; color: #fff; border: 2px solid #6C3CE1; border-radius: 8px; font-weight: 600; font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all 0.2s; }
.btn-primary:hover { background: #5A2FCA; }

/* Score Banner */
.score-banner { background: linear-gradient(135deg, #6C3CE1, #4A1FB8); border-radius: 16px; padding: 24px 32px; color: #fff; display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.score-main { display: flex; align-items: baseline; gap: 4px; }
.score-main .score { font-size: 3.5rem; font-weight: 800; line-height: 1; }
.score-main .total { font-size: 1.5rem; opacity: 0.7; }
.subject-scores { display: flex; gap: 24px; }
.subject-score { text-align: center; }
.subject-score .val { font-size: 1.3rem; font-weight: 700; }
.subject-score .max { font-size: 0.85rem; opacity: 0.6; }
.subject-score .lbl { font-size: 0.75rem; opacity: 0.7; margin-top: 2px; }

/* Cards */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stat-card .label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #888; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stat-card .label i { font-size: 0.8rem; }
.stat-card .value { font-size: 2rem; font-weight: 800; color: #1a1a2e; }
.stat-card .value span { font-size: 1rem; color: #888; font-weight: 500; }
.stat-card .bar { height: 6px; background: #eee; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.stat-card .bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

/* Tables */
.analysis-table { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden; margin-bottom: 24px; }
.table-header { padding: 20px 24px 16px; border-bottom: 2px solid #1a1a2e; }
.table-header h3 { font-size: 1.15rem; color: #1a1a2e; font-weight: 700; }
.subject-tabs { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.subject-tab { padding: 6px 14px; border: none; background: #f0f2f5; border-radius: 20px; font-size: 0.8rem; font-weight: 500; cursor: pointer; color: #666; transition: all 0.2s; display: flex; align-items: center; gap: 5px; }
.subject-tab.active { background: #6C3CE1; color: #fff; }
.subject-tab i { font-size: 0.75rem; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 20px; text-align: left; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; color: #888; background: #fafafa; letter-spacing: 0.3px; }
td { padding: 14px 20px; border-top: 1px solid #f0f0f0; font-size: 0.92rem; }
tr:hover { background: #f8f9ff; }
.subject-icon { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; margin-right: 8px; color: #fff; }
.icon-phy { background: #E67E22; }
.icon-chem { background: #E74C3C; }
.icon-math { background: #3498DB; }
.icon-eng { background: #9B59B6; }
.icon-overall { background: #1a1a2e; }
.bar-cell { display: flex; align-items: center; gap: 8px; }
.mini-bar { flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; max-width: 100px; }
.mini-bar-fill { height: 100%; border-radius: 4px; }
.correct { color: #27ae60; }
.wrong { color: #e74c3c; }

/* Chart placeholder */
.chart-container { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 24px; }
.chart-container h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; color: #1a1a2e; }
.chart-bar-group { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding: 0 20px; }
.chart-col { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 40px; border-radius: 4px 4px 0 0; transition: height 1s ease; position: relative; }
.chart-bar-label { font-size: 0.7rem; color: #666; margin-top: 6px; text-align: center; }
.chart-bar-value { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 0.72rem; font-weight: 700; color: #333; }
.chart-legend { display: flex; gap: 16px; margin-top: 16px; justify-content: center; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: #666; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.chart-categories { display: flex; justify-content: space-around; margin-top: 8px; border-top: 1px solid #eee; padding-top: 8px; }
.chart-categories span { font-size: 0.78rem; color: #888; font-weight: 500; }

/* CTA Section */
.cta-section { background: linear-gradient(135deg, #6C3CE1, #4A1FB8); border-radius: 16px; padding: 32px; text-align: center; color: #fff; margin-top: 32px; }
.cta-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.cta-section p { opacity: 0.8; margin-bottom: 20px; font-size: 0.95rem; }
.cta-section .cta-btn { display: inline-flex; align-items: center; gap: 8px; background: #FFD700; color: #1a1a2e; padding: 12px 32px; border-radius: 10px; font-weight: 700; font-size: 1rem; text-decoration: none; transition: all 0.3s; border: none; cursor: pointer; }
.cta-section .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(255,215,0,0.4); }

/* Responsive */
@media (max-width: 900px) {
  .analysis-layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 16px 0; }
  .nav-list { display: flex; overflow-x: auto; padding: 0 12px; gap: 4px; }
  .nav-item { padding: 8px 14px; white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
  .nav-item.active { border-bottom-color: #6C3CE1; border-left-color: transparent; }
  .main-content { padding: 16px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .score-banner { flex-direction: column; gap: 16px; text-align: center; }
  .subject-scores { flex-wrap: wrap; justify-content: center; }
  .content-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}
@media (max-width: 500px) {
  .cards-grid { grid-template-columns: 1fr; }
}
