/* ===== NAV XP BADGE (shared) ===== */
.nav-xp {
  background: linear-gradient(135deg, #5b5ef4, #7209b7);
  color: white; font-weight: 800; font-size: 0.8rem;
  padding: 0.3rem 0.8rem; border-radius: 50px;
  box-shadow: 0 2px 8px rgba(91,94,244,0.25);
}

/* ===== HERO ===== */
.hw-hero {
  padding: 3.5rem 4rem 2.5rem;
  background:
    radial-gradient(ellipse 55% 50% at 15% 20%, rgba(91,94,244,0.10) 0%, transparent 70%),
    radial-gradient(ellipse 50% 55% at 85% 35%, rgba(236,72,153,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 35% 35% at 50% 80%, rgba(124,58,237,0.06) 0%, transparent 70%),
    linear-gradient(145deg, #eef0ff 0%, #f5e8ff 35%, #fce7ff 55%, #fff0e8 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hw-hero::before {
  content: '';
  position: absolute; top: -60px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(91,94,244,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hw-hero::after {
  content: '';
  position: absolute; bottom: -35px; left: -35px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(236,72,153,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hw-hero h1 {
  font-size: 2.2rem; font-weight: 900; margin-bottom: 0.5rem;
  position: relative; z-index: 1;
}
.hw-hero p {
  color: var(--muted); font-size: 1.05rem;
  max-width: 600px; margin: 0 auto;
  position: relative; z-index: 1;
}

/* ===== CONTAINER ===== */
.hw-container { max-width: 820px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ===== UPLOAD CARD ===== */
.hw-upload-card {
  background: white; border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(91,94,244,0.06);
  border: 1px solid rgba(91,94,244,0.08);
  position: relative;
  overflow: hidden;
}
.hw-upload-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5b5ef4, #7c3aed, #ec4899);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hw-upload-card:hover::after { transform: scaleX(1); }
.hw-title-row { margin-bottom: 1.25rem; }
.hw-label {
  font-weight: 800; font-size: 0.85rem; display: block;
  margin-bottom: 0.4rem; color: var(--text);
}
.hw-input {
  width: 100%; padding: 0.75rem 1rem;
  border: 2px solid #e8eaff; border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-size: 0.95rem; font-weight: 700;
  outline: none; color: var(--text);
  transition: all 0.25s;
}
.hw-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(91,94,244,0.08);
}

/* ===== DROPZONE ===== */
.hw-dropzone {
  border: 3px dashed #d0d4f8; border-radius: 20px;
  padding: 2.5rem 1.5rem; text-align: center;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: rgba(91,94,244,0.02);
  position: relative;
}
.hw-dropzone:hover {
  border-color: rgba(91,94,244,0.35);
  background: rgba(91,94,244,0.04);
  transform: translateY(-2px);
}
.hw-dropzone.dragover {
  border-color: var(--primary); background: rgba(91,94,244,0.06);
  transform: scale(1.01);
  box-shadow: 0 8px 32px rgba(91,94,244,0.12);
}
.dropzone-icon { font-size: 3rem; margin-bottom: 0.75rem; display: block; }
.dropzone-text { font-weight: 800; font-size: 1.05rem; color: var(--text); margin-bottom: 0.3rem; }
.dropzone-sub { font-size: 0.82rem; color: var(--muted); margin-bottom: 1rem; }
.dropzone-btn { pointer-events: none; }

/* ===== FILE PREVIEW ===== */
.hw-file-preview {
  display: flex; align-items: center; gap: 0.75rem;
  background: linear-gradient(135deg, #f0f2ff, #f5f0ff);
  border-radius: 14px; padding: 0.75rem 1rem;
  margin-top: 1rem;
  border: 1px solid rgba(91,94,244,0.08);
}
.fp-icon { font-size: 1.2rem; }
.fp-name {
  font-weight: 800; font-size: 0.9rem; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-size { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.fp-remove {
  background: rgba(220,38,38,0.1); border: none; color: #dc2626;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fp-remove:hover {
  background: rgba(220,38,38,0.2);
  transform: scale(1.1);
}

/* ===== UPLOAD BUTTON ===== */
.hw-upload-btn {
  width: 100%; margin-top: 1.25rem; justify-content: center;
  font-size: 1.05rem; padding: 1rem;
  background: linear-gradient(135deg, #5b5ef4, #7c3aed);
  box-shadow: 0 4px 16px rgba(91,94,244,0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hw-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(91,94,244,0.4);
}
.hw-upload-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.spinner {
  width: 18px; height: 18px; border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white; border-radius: 50%;
  animation: spin 0.6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== FEEDBACK SECTION ===== */
.hw-feedback-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.hw-feedback-header h2 {
  text-align: left; font-size: 1.6rem;
}
.hw-score-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white; border-radius: 18px; padding: 0.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 6px 24px rgba(91,94,244,0.35);
}
.score-label {
  font-size: 0.7rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1px; display: block; opacity: 0.8;
}
.score-value { font-size: 2rem; font-weight: 900; line-height: 1; }

/* ===== FEEDBACK CARDS ===== */
.hw-feedback-list { display: flex; flex-direction: column; gap: 1rem; }
.fb-card {
  background: white; border-radius: 18px; padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(91,94,244,0.06);
  border: 1px solid rgba(91,94,244,0.08);
  border-left: 5px solid;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.fb-card:hover {
  transform: translateX(4px);
  box-shadow: 0 8px 32px rgba(91,94,244,0.1);
}
.fb-card.correct { border-left-color: var(--green); }
.fb-card.wrong { border-left-color: #f87171; }
.fb-q-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.fb-status-icon { font-size: 1.2rem; }
.fb-q-label { font-weight: 900; font-size: 0.95rem; color: var(--text); }
.fb-answer { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.3rem; }
.fb-answer strong { color: var(--text); }
.fb-explanation {
  font-size: 0.88rem; color: var(--text); line-height: 1.7;
  background: linear-gradient(135deg, #fafbff, #f8f5ff);
  border-radius: 12px; padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  border: 1px solid rgba(91,94,244,0.06);
}

/* ===== PRACTICE QUESTIONS ===== */
.hw-practice { margin-top: 2rem; }
.hw-practice h3 { font-size: 1.2rem; font-weight: 900; margin-bottom: 1rem; }
.hw-practice-list { display: flex; flex-direction: column; gap: 0.75rem; }
.practice-card {
  background: white; border-radius: 18px; padding: 1.25rem;
  box-shadow: 0 4px 24px rgba(91,94,244,0.06);
  border: 1px solid rgba(91,94,244,0.08);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.practice-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5b5ef4, #7c3aed, #ec4899);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.practice-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(91,94,244,0.1);
}
.practice-card:hover::after { transform: scaleX(1); }
.practice-card .pc-q { font-weight: 800; font-size: 0.92rem; margin-bottom: 0.5rem; }
.practice-card .pc-hint { font-size: 0.82rem; color: var(--muted); font-style: italic; }

/* ===== PAST HOMEWORK ===== */
.hw-past-section {
  background:
    radial-gradient(ellipse 50% 40% at 50% 70%, rgba(91,94,244,0.03) 0%, transparent 70%),
    #fafaff;
}
.hw-past-section h2 { font-size: 1.6rem; }
.hw-past-list {
  display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem;
}
.hw-empty {
  text-align: center; padding: 2.5rem; color: var(--muted);
  font-size: 0.95rem; font-weight: 700;
}
.past-card {
  display: flex; align-items: center; gap: 1rem;
  background: white; border-radius: 18px; padding: 1rem 1.25rem;
  box-shadow: 0 4px 24px rgba(91,94,244,0.06);
  border: 1px solid rgba(91,94,244,0.08);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.past-card:hover {
  border-color: rgba(91,94,244,0.15);
  transform: translateX(4px);
  box-shadow: 0 8px 32px rgba(91,94,244,0.1);
}
.past-icon { font-size: 1.5rem; }
.past-info { flex: 1; }
.past-title { font-weight: 800; font-size: 0.95rem; }
.past-date { font-size: 0.78rem; color: var(--muted); }
.past-score {
  font-weight: 900; font-size: 1.1rem; padding: 0.35rem 0.85rem;
  border-radius: 50px; min-width: 60px; text-align: center;
  border: 1px solid transparent;
}
.past-score.high {
  background: linear-gradient(135deg, rgba(6,214,160,0.15), rgba(16,185,129,0.1));
  color: #059669; border-color: rgba(6,214,160,0.2);
}
.past-score.mid {
  background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(245,158,11,0.1));
  color: #b45309; border-color: rgba(251,191,36,0.2);
}
.past-score.low {
  background: linear-gradient(135deg, rgba(248,113,113,0.15), rgba(239,68,68,0.1));
  color: #dc2626; border-color: rgba(248,113,113,0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hw-hero { padding: 2rem 1.5rem 1.5rem; }
  .hw-hero h1 { font-size: 1.6rem; }
  .hw-container { padding: 1.5rem 1rem; }
  .hw-upload-card { padding: 1.25rem; }
  .hw-dropzone { padding: 1.5rem 1rem; }
  .hw-feedback-header { flex-direction: column; align-items: flex-start; }
}

/* ===== AI HOMEWORK SECTION ===== */
.hw-ai-section { padding: 0 0 2rem; }
.hw-ai-card {
  background: #fff; border-radius: 20px;
  border: 1px solid #e2e8f0; padding: 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}
.hw-ai-header { margin-bottom: 1.5rem; }
.hw-ai-header h2 { font-size: 1.4rem; font-weight: 900; color: #1e293b; margin-bottom: 4px; }
.hw-ai-header p { font-size: 0.9rem; color: #64748b; font-weight: 600; }

/* Topic Grid */
.hw-topics-lang-label {
  font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.2px; color: #94a3b8; margin-bottom: 12px;
}
.hw-topics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 0;
}
.hw-topic-card {
  border-radius: 16px; padding: 16px;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  border: 2px solid transparent; position: relative;
}
.hw-topic-card:hover { transform: translateY(-3px); }
.hw-topic-unlocked {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #86efac;
}
.hw-topic-unlocked:hover { box-shadow: 0 8px 24px rgba(34,197,94,0.2); border-color: #4ade80; }
.hw-topic-locked {
  background: #f8fafc; border-color: #e2e8f0; opacity: 0.75;
}
.hw-topic-locked:hover { opacity: 1; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.hw-topic-lock-icon { font-size: 1.2rem; margin-bottom: 8px; }
.hw-topic-name { font-size: 0.88rem; font-weight: 800; color: #1e293b; margin-bottom: 6px; line-height: 1.3; }
.hw-topic-cta {
  font-size: 0.75rem; font-weight: 700;
  color: #22c55e;
}
.hw-topic-locked .hw-topic-cta { color: #94a3b8; }

/* Generated HW section */
.hw-gen-header { display: flex; align-items: center; justify-content: space-between; margin: 1.5rem 0 1rem; flex-wrap: wrap; gap: 8px; }
.hw-gen-title { font-size: 1.05rem; font-weight: 900; color: #1e293b; }
.hw-gen-status { font-size: 0.85rem; font-weight: 700; color: #6366f1; display: flex; align-items: center; gap: 8px; }
.hw-questions-box {
  background: #f8fafc; border-radius: 14px; padding: 16px;
  margin-bottom: 16px; border: 1px solid #e2e8f0;
}
.hw-q-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9;
}
.hw-q-item:last-child { border-bottom: none; }
.hw-q-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; font-size: 0.78rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.hw-q-text { font-size: 0.95rem; font-weight: 700; color: #334155; line-height: 1.5; }
.hw-ans-label { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: #6366f1; margin-bottom: 8px; }
.hw-answers-textarea {
  width: 100%; min-height: 160px; padding: 14px 16px;
  border: 2px solid #e2e8f0; border-radius: 14px;
  font-family: 'Nunito', sans-serif; font-size: 0.95rem; color: #1e293b;
  resize: vertical; outline: none; transition: border-color 0.2s;
  margin-bottom: 14px; display: block;
}
.hw-answers-textarea:focus { border-color: #6366f1; }
.hw-submit-ans-btn { width: 100%; }

/* PPT Prerequisite Popup */
.hw-prereq-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(15,23,42,0.75); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.hw-prereq-box {
  background: #fff; border-radius: 24px; padding: 40px 36px;
  max-width: 420px; width: 90%; text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  animation: cardPop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes cardPop {
  0% { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.hw-prereq-icon { font-size: 3rem; margin-bottom: 12px; }
.hw-prereq-box h3 { font-size: 1.3rem; font-weight: 900; color: #1e293b; margin-bottom: 10px; }
.hw-prereq-box p { font-size: 0.9rem; color: #64748b; font-weight: 600; line-height: 1.6; margin-bottom: 24px; }
.hw-prereq-actions { display: flex; gap: 10px; flex-direction: column; }
