/* ============================================================
   studio.css — Deutsch Studio · Module-page & component overrides
   Works with new top-header layout (no left sidebar).
   ============================================================ */

/* ── Reset residual sidebar/workspace grid styles ── */
.workspace { display: block !important; }
.course-sidebar { display: none !important; }
.sidebar-backdrop { display: none !important; }
.sidebar-toggle { display: none !important; }

/* ── App body fills full width ── */
.app-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.main-pane {
  width: 100%;
  min-width: 0;
}
.main-pane > .screen { max-width: 1100px; margin: 0 auto; }

/* ── Module breadcrumb path ── */
.module-breadcrumb {
  display: flex; align-items: center; gap: 7px;
  margin: 0 0 16px; color: var(--muted); font-size: 13px; font-weight: 700;
}
.module-breadcrumb a { color: var(--primary); text-decoration: none; }
.module-breadcrumb a:hover { text-decoration: underline; }
.module-breadcrumb .material-symbols-rounded { font-size: 17px; }

/* ── Review home cards ── */
.review-home .card { min-height: 110px; display: flex; flex-direction: column; }
.review-home .btn { margin-top: auto; }
.review-shortcuts { margin: 8px 0 18px; }
.review-shortcuts .btn { background: #fff; }

/* ── Tabs strip ── */
.tabs {
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0;
  gap: 4px;
  margin-bottom: 18px;
}
.tab {
  border-radius: 10px 10px 0 0;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 13px;
}
.tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--line);
  border-bottom-color: transparent;
}
.tab:hover:not(.active) { background: #f0f5ff; color: var(--primary); }

/* ── Home grid layout for home page ── */
body[data-page="home"] #home.screen.active {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr);
  gap: 16px 20px;
  align-items: start;
}
body[data-page="home"] #home > .welcome-row,
body[data-page="home"] #home > .hero,
body[data-page="home"] #home > .section-title,
body[data-page="home"] #home > .cards,
body[data-page="home"] #home > .review-shortcuts,
body[data-page="home"] #home > .listening-card {
  grid-column: 1 / -1;
}
body[data-page="home"] #home > .mix-banner {
  grid-column: 1;
  margin-top: 0;
  align-self: stretch;
}
body[data-page="home"] #home > .progress {
  grid-column: 2;
  margin-top: 0;
  align-self: stretch;
}

/* ── Topic cards full-height flex ── */
.topic-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 200px;
  border: 1px solid rgba(198,213,233,.8);
  border-radius: 18px;
  box-shadow: var(--shadow);
  background: #fff;
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.topic-card:nth-child(2) { background: linear-gradient(160deg, #fff 50%, #f2f7ff); }
.topic-card:nth-child(3) { background: linear-gradient(160deg, #fff 50%, #fff9e5); }
.topic-card h3 { margin: 10px 0 4px; font-size: 17px; }
.topic-card p { margin: 4px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.topic-card .course-label { color: var(--primary); opacity: .7; }
.topic-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; width: 100%; margin-top: auto;
  background: var(--primary); color: #fff; border: none; border-color: var(--primary);
}
.topic-cta:hover { background: var(--primary-dark); }
.topic-cta .material-symbols-rounded { font-size: 18px; }

/* ── Learning path (if used) ── */
.learning-path {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; margin-top: 16px; gap: 12px;
}
.learning-path > div { display: flex; gap: 12px; align-items: center; }
.path-number {
  color: var(--muted); background: var(--primary-soft);
  border-radius: 10px; width: 34px; height: 34px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}
.learning-path b { font-size: 13px; font-weight: 700; display: block; }
.learning-path small { font-size: 11px; color: var(--muted); display: block; }
.path-arrow { color: var(--muted); }

/* ── Practice setup panel (module pages) ── */
.practice-setup-panel { padding: 20px 22px 18px; }
.practice-setup-panel > h3 { margin: 0 0 16px; font-size: 20px; }
.practice-setup-grid { grid-template-columns: 150px minmax(0,1fr); gap: 16px; }
.practice-setup-field select, .practice-exercise-picker select { height: 42px; }

/* ── Score / exam ── */
.score { font-size: 44px; font-weight: 750; color: var(--primary); }

/* ── Audio buttons ── */
.btn.primary, .topic-cta { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.gold { background: var(--gold); color: #3d2b00; border-color: var(--gold); }
.progress .bar span, .hp-fill {
  background: linear-gradient(90deg, #1769c2, #f2bd35);
}

/* ── Verb picker ── */
.verb-picker .btn.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Profile dialog tweaks ── */
.profile-modal-card { border-radius: 18px; }
.profile-modal-head { padding: 15px 20px; }
.profile-modal-body { padding: 18px 20px; gap: 14px; }

/* ── Account panel in profile modal ── */
.api-account-panel {
  margin: 0 20px 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}

/* ── Module-specific vocab learn table header widths ── */
.vocab-learn th:nth-child(1), .vocab-learn th:nth-child(2) { width: 32%; }
.vocab-learn th:nth-child(3) { width: 24%; }

/* ── Review exercise ── */
.review-exercise { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.review-prompt { border-color: var(--line); background: var(--primary-soft); }
.spelling-prompt { color: #b46753; background: #fff8f4; border-color: #f2e3d9; }
.review-scopes .btn { padding: 8px 14px; font-size: 12px; }
.review-session-head .btn { font-size: 12px; padding: 8px 12px; }

/* ── Banner star icon ── */
.banner-star { vertical-align: middle; margin-right: 6px; }

/* ── Answer comparison ── */
.answer-wrong { background: #ffdcd7; color: #8a1812; font-weight: 700; text-decoration: underline; padding: 2px 5px; border-radius: 4px; }
.answer-fix { background: #d6f2df; color: #14532d; font-weight: 700; padding: 2px 5px; border-radius: 4px; }

/* ── Sidebar settings (now in voice panel) ── */
.sidebar-settings { display: none; } /* hide old sidebar settings */

/* ── Nav voice panel specifics ── */
.nav-voice-panel { position: relative; }
.nav-voice-body .voice-panel { padding: 14px 16px; }
.nav-voice-body .audio-select-two { grid-template-columns: 1fr 1fr; }
.nav-voice-body .audio-preset-row { grid-template-columns: 1fr 1fr; }

/* ── Scrolled header ── */
.app-header.scrolled {
  box-shadow: 0 4px 20px rgba(20,44,80,.09);
}

/* ── Home section: review-home cards ── */
.review-home { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }

/* ── Mix banner ── */
.mix-banner { background: linear-gradient(110deg, #e8f2ff, #f5f8ff 62%); border-color: #c6d5e9; }

/* ── Admin sidebar (hidden by default, shown by JS for admin) ── */
.admin-sidebar-active .app-body {
  display: flex;
  flex-direction: row;
}
.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  height: calc(100vh - var(--shell-h));
  position: sticky;
  top: var(--shell-h);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 10px;
}
.admin-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.admin-sidebar-head h2 { margin: 0; font-size: 15px; font-weight: 750; }
.admin-nav-label {
  font-size: 10px; letter-spacing: 1.6px; font-weight: 800;
  color: var(--muted); padding: 10px 12px 4px; display: block;
}
.admin-nav-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: none; border-radius: 12px;
  background: transparent; color: var(--text);
  text-align: left; font-weight: 700; font-size: 13px;
  transition: background .16s, color .16s;
  cursor: pointer;
}
.admin-nav-link .material-symbols-rounded { font-size: 20px; color: var(--muted); }
.admin-nav-link:hover { background: var(--primary-soft); color: var(--primary); }
.admin-nav-link.active { background: var(--primary-soft); color: var(--primary); }
.admin-nav-link.active .material-symbols-rounded { color: var(--primary); }

/* ── Responsive overrides ── */
@media (max-width: 1100px) {
  .main-pane > .screen { max-width: 100%; }
  body[data-page="home"] #home.screen.active { grid-template-columns: 1fr; }
  body[data-page="home"] #home > .mix-banner,
  body[data-page="home"] #home > .progress { grid-column: 1; }
}

@media (max-width: 900px) {
  .main-pane { padding: 16px 16px 44px; }
  .review-home { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .topic-card { min-height: 180px; padding: 18px; }
}

@media (max-width: 768px) {
  .review-home { grid-template-columns: 1fr 1fr; }
  .topic-card { min-height: 160px; }
  .listening-card { padding: 14px 16px; }
  .mix-banner { padding: 14px 18px; }
  .progress { padding: 14px 16px; }
  .review-exercise { padding: 16px; }
  .practice-setup-panel { padding: 16px; }
  .practice-setup-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .review-home { grid-template-columns: 1fr; }
  .review-type { padding: 14px; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 4px 10px; }
  .review-type > span { grid-row: 1/3; }
  .review-type small { grid-column: 2; }
  .topic-card { min-height: 0; padding: 18px; }
  .topic-card h3 { font-size: 16px; }
  .review-session-head { flex-wrap: wrap; }
  .review-exercise-actions { gap: 7px; }
  #reviewNext { margin-left: 0; }
  .vocab-learn > .panel { padding: 14px; }
  .vocab-learn .search { grid-template-columns: 1fr; }
  .vocab-learn .flash .big { font-size: 22px; }
  .vocab-learn .verb-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .vocab-learn #verbStudy { padding: 12px; }
  .vocab-learn .verb-cell { padding: 10px; }
  .admin-sidebar { display: none; }
}

/* ── Prefers reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto!important;
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
