/* ══════════════════════════════════════
   HOMEWORK.CSS — Homework page styles
══════════════════════════════════════ */

/* ─── Page hero ─── */
.hw-hero {
  padding: 36px 22px 28px;
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.hw-hero::before {
  content: ''; position: absolute;
  left: 0; top: 0; width: 4px; height: 100%;
  background: var(--red);
}
.hw-eye {
  font-size: 9px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--red);
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px;
}
.hw-eye::before { content: ''; width: 16px; height: 2px; background: var(--red); }
.hw-title {
  font-size: 30px; font-weight: 900; color: var(--black);
  line-height: 1.1; letter-spacing: -0.5px; margin-bottom: 10px;
}
.hw-title em { font-style: italic; font-weight: 300; color: var(--red); }
.hw-sub { font-size: 12px; color: var(--mid); line-height: 1.6; font-weight: 400; }

/* ─── HUD — stats strip ─── */
.hw-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.hw-hud-cell {
  padding: 16px 10px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.hw-hud-cell:last-child { border-right: none; }
.hw-hud-n {
  font-size: 22px; font-weight: 900; line-height: 1;
}
.hw-hud-n.total  { color: var(--blue); }
.hw-hud-n.done   { color: var(--green); }
.hw-hud-n.pending{ color: var(--red); }
.hw-hud-l {
  font-size: 9px; color: var(--mid); margin-top: 4px;
  font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
}

/* ─── HUD — overall progress bar ─── */
.hw-progress-wrap {
  padding: 14px 22px 0;
}
.hw-progress-label {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--mid); margin-bottom: 6px; font-weight: 600;
}
.hw-progress-outer {
  background: var(--border); border-radius: 10px; height: 6px; overflow: hidden;
}
.hw-progress-inner {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--blue), var(--red));
  transition: width 0.5s ease;
}

/* ─── Level filter tabs ─── */
.hw-level-tabs {
  display: flex; gap: 8px; padding: 18px 22px 4px;
  overflow-x: auto; scrollbar-width: none;
}
.hw-level-tabs::-webkit-scrollbar { display: none; }
.hw-level-btn {
  flex-shrink: 0; padding: 7px 16px;
  border-radius: 20px; border: 1.5px solid var(--border);
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  background: var(--off); color: var(--mid);
  transition: all 0.15s;
}
.hw-level-btn:hover { border-color: var(--mid); color: var(--text); }
.hw-level-btn.active-all          { background: var(--black);  color: var(--white); border-color: var(--black); }
.hw-level-btn.active-basico       { background: var(--green);  color: var(--white); border-color: var(--green); }
.hw-level-btn.active-intermediario{ background: var(--blue);   color: var(--white); border-color: var(--blue); }
.hw-level-btn.active-avancado     { background: var(--red);    color: var(--white); border-color: var(--red); }

/* ─── Level section header ─── */
.hw-section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 22px 10px;
}
.hw-section-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.hw-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--mid); flex: 1;
}
.hw-section-count {
  font-size: 10px; font-weight: 700; color: var(--mid);
  background: var(--off); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px;
}

/* ─── Homework cards ─── */
.hw-list {
  padding: 0 22px; display: flex; flex-direction: column; gap: 10px;
}
.hw-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 14px; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.hw-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}
.hw-card.hw-done {
  background: #f7fdf9;
  border-color: #c3e6d0;
}

/* card top accent bar */
.hw-card-accent {
  height: 3px; width: 100%;
}

/* card body */
.hw-card-body {
  padding: 16px 18px 14px;
}
.hw-card-top {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px;
}
.hw-card-check {
  width: 22px; height: 22px; border-radius: 6px;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--white);
  transition: all 0.2s; margin-top: 1px;
  background: var(--white);
}
.hw-card.hw-done .hw-card-check {
  background: var(--green); border-color: var(--green);
}
.hw-card-titles { flex: 1; }
.hw-card-title {
  font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3;
}
.hw-card.hw-done .hw-card-title {
  color: var(--green); text-decoration: line-through;
  text-decoration-color: rgba(45,160,90,0.4);
}
.hw-card-topic-badge {
  display: inline-block; font-size: 8px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; margin-top: 4px;
}
.hw-card-desc {
  font-size: 11px; color: #666; line-height: 1.75;
  font-weight: 400; margin-bottom: 10px;
  white-space: pre-line; /* preserves line breaks from the data file */

  /* collapsed by default */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.2s;
}
.hw-card-desc.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* link button */
.hw-card-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--blue); text-decoration: none;
  padding: 5px 0; margin-bottom: 6px;
}
.hw-card-link:hover { text-decoration: underline; }

/* feedback box */
.hw-card-feedback {
  display: flex; gap: 8px; align-items: flex-start;
  background: #fff8e6; border: 1px solid #fde9a0;
  border-radius: 8px; padding: 10px 12px; margin-top: 8px;
}
.hw-card-feedback-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.hw-card-feedback-text {
  font-size: 11px; color: #7a5a00; line-height: 1.5; font-weight: 500;
}

/* expand toggle */
.hw-card-toggle {
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--mid);
  background: none; border: none; cursor: pointer;
  font-family: 'Montserrat', sans-serif; padding: 0;
  display: block; margin-top: 2px;
}
.hw-card-toggle:hover { color: var(--blue); }

/* ─── Empty state ─── */
.hw-empty {
  padding: 32px 22px;
  text-align: center;
  font-size: 12px; color: var(--mid);
}
.hw-empty-icon { font-size: 32px; margin-bottom: 10px; }