/* ============================================================
   BrainBase - Global Stylesheet
   Dark mode only. All colors and spacing defined as variables.
   ============================================================ */

/* --- Color and spacing variables --- */
:root {
  --bg-primary:       #0d0d0f;
  --bg-card:          #141417;
  --bg-surface:       #1a1a1f;
  --text-primary:     #f0f0f2;
  --text-secondary:   #c8c8ce;
  --text-muted:       #6b6b76;
  --text-faint:       #4a4a54;
  --border-subtle:    rgba(255,255,255,0.06);
  --border-container: rgba(255,255,255,0.08);
  --purple:           #7c3aed;
  --purple-light:     #a78bfa;
  --teal:             #5eead4;
  --amber:            #fbbf24;

  --radius-outer:  24px;
  --radius-card:   16px;
  --radius-row:    10px;
  --radius-pill:   20px;
  --radius-small:  8px;

  --nav-height: 80px;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Base body --- */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* Prevent content from hiding behind the fixed bottom nav */
  padding-bottom: var(--nav-height);
}

/* --- Main content container --- */
.app-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Custom scrollbar (WebKit / macOS) --- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.18);
}

/* ============================================================
   Utility classes
   ============================================================ */

/* Generic card surface */
.card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 22px 18px;
}

/* Small rounded badge / pill */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Section label - "RECENT", "CLASSES" etc. */
.section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  margin-bottom: 12px;
}

/* Flex row helper */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* All clickable interactive things get a smooth transition */
a, button, [role="button"],
.feature-card, .btn-new-idea, .recent-row {
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}

/* ============================================================
   Landing page
   ============================================================ */

/* Header: logo + tagline */
.home-header {
  padding-top: 48px;
  padding-bottom: 40px;
}

.home-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.home-logo-text {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
}

.home-tagline {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* "New idea" primary button */
.btn-new-idea {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
  border: none;
  border-radius: var(--radius-card);
  padding: 28px 24px;
  margin-bottom: 14px;
  color: white;
  text-align: left;
}

.btn-new-idea:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(124,58,237,0.3);
}

.btn-new-idea:active {
  transform: scale(0.99);
}

.btn-new-idea-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-new-idea-title {
  font-size: 18px;
  font-weight: 500;
  color: white;
}

.btn-new-idea-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
}

.btn-new-idea-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Feature cards grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 36px;
}

.feature-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-card:hover {
  border-color: rgba(255,255,255,0.12);
  background: #1e1e24;
}

.feature-card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.feature-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Recent activity list */
.recent-section {
  margin-bottom: 24px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-row);
  padding: 12px 14px;
}

.recent-row:hover {
  background: #18181c;
}

.recent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.recent-content {
  flex: 1;
  min-width: 0;
}

.recent-title {
  font-size: 13px;
  color: #e0e0e4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-date {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

.recent-chevron {
  color: var(--text-faint);
  flex-shrink: 0;
}

/* Empty state for recent section */
.recent-empty {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}

/* ============================================================
   Placeholder pages (Homework, Ideas)
   ============================================================ */

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 56px;
  padding-bottom: 32px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-small);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  color: var(--text-primary);
  flex-shrink: 0;
}

.back-btn:hover {
  background: #202026;
  border-color: rgba(255,255,255,0.1);
}

.page-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
}

.placeholder-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 24px;
  text-align: center;
}

.placeholder-icon {
  opacity: 0.25;
  margin-bottom: 8px;
}

.placeholder-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-secondary);
}

.placeholder-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   Bottom navigation bar
   ============================================================ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  /* Gradient so content scrolls smoothly behind it */
  background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 40%);
  padding: 16px 0 28px;
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0;
}

.nav-btn:hover {
  color: var(--text-secondary);
}

.nav-btn.active {
  color: var(--text-primary);
}

/* ============================================================
   Homework page
   ============================================================ */

/* Override the default page-header so the add button can sit on the right */
.hw-page-header {
  justify-content: space-between;
}

/* Spacer so the title doesn't collapse when the add button is on the right */
.hw-page-header .page-title {
  flex: 1;
  margin-left: 4px;
}

/* Teal circle add button in the page header */
.hw-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  border: none;
  color: #0d0d0f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.hw-add-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(94,234,212,0.3);
}
.hw-add-btn:active {
  transform: scale(0.95);
}

/* Filter pills row - horizontal scroll on narrow screens */
.hw-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hw-filter-row::-webkit-scrollbar { display: none; }

/* Individual filter pill button */
.hw-filter-pill {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  border: 0.5px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
}
.hw-filter-pill.active {
  background: var(--teal);
  color: #0d0d0f;
  font-weight: 500;
  border-color: transparent;
}

/* Cards container */
.hw-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* Each class card */
.hw-card {
  background: var(--bg-card);
  border-radius: 0 14px 14px 0;   /* flat left edge, rounded everywhere else */
  border-left: 3px solid;          /* color is set via inline style on each card */
  padding: 16px;
  transition: opacity 0.2s ease;
}

/* Card top row: class name on left, due-date badge on right */
.hw-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hw-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Due-date badge (e.g. "Due Wed", "4 items") */
.hw-due-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  /* background and color are set via inline style per-card */
}

/* List of task rows inside a card */
.hw-task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Individual task row */
.hw-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-small);
  position: relative;
  transition: background 0.15s ease;
}
.hw-task-row:hover {
  background: #1e1e24;
}

/* The checkbox circle */
.hw-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #3a3a42;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative;
}
.hw-checkbox:hover {
  border-color: var(--teal);
}

/* Task description text */
.hw-task-desc {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hw-task-desc:hover {
  color: var(--text-primary);
}

/* Short due date on the right of a task row (e.g. "3/22") */
.hw-task-due {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

/* Trash icon button - hidden by default, revealed on row hover */
.hw-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: none;
  border: none;
  color: var(--text-faint);
  flex-shrink: 0;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.hw-task-row:hover .hw-delete-btn {
  opacity: 1;
}
.hw-delete-btn:hover {
  color: #f09595;
}

/* Inline delete confirmation buttons */
.hw-delete-confirm {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.hw-delete-yes,
.hw-delete-no {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.hw-delete-yes {
  background: rgba(240,149,149,0.15);
  color: #f09595;
}
.hw-delete-yes:hover { opacity: 0.8; }
.hw-delete-no {
  background: var(--bg-primary);
  color: var(--text-muted);
}
.hw-delete-no:hover { opacity: 0.8; }

/* Inline edit input - replaces the description span when editing */
.hw-task-edit-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  border-radius: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  padding: 0 0 2px;
  outline: none;
  min-width: 0;
}
.hw-task-edit-input:focus {
  border-bottom-color: var(--teal);
}

/* Task completing: strikethrough + faded while waiting to animate out */
.hw-task-completing .hw-task-desc,
.hw-task-completing .hw-task-edit-input {
  text-decoration: line-through;
  opacity: 0.45;
}
.hw-task-completing {
  opacity: 0.6;
}

/* Checked state for checkbox while completing */
.hw-task-completing .hw-checkbox {
  background: var(--teal);
  border-color: var(--teal);
}
.hw-task-completing .hw-checkbox::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 4px;
  width: 8px;
  height: 5px;
  border-left: 1.5px solid #0d0d0f;
  border-bottom: 1.5px solid #0d0d0f;
  transform: rotate(-45deg) translateY(-1px);
}

/* Class note row (the teal info bar, e.g. "Spring break - time to catch up") */
.hw-class-note {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(94,234,212,0.06);
  border-radius: var(--radius-small);
  font-size: 12px;
  color: var(--teal);
}

/* ---- Empty classes section ---- */

.hw-empty-section {
  margin-top: 8px;
  margin-bottom: 24px;
}

/* The collapsed toggle button */
.hw-empty-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #111114;
  border: 0.5px solid rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.hw-empty-toggle:hover {
  background: #151518;
}

.hw-empty-count {
  font-size: 13px;
  color: var(--text-faint);
}

.hw-chevron {
  color: var(--text-faint);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.hw-empty-toggle[aria-expanded="true"] .hw-chevron {
  transform: rotate(180deg);
}

/* The expanded list of empty classes */
.hw-empty-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 6px;
  padding: 8px 0;
}

/* Each empty class row */
.hw-empty-class-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.hw-empty-class-row:hover {
  background: var(--bg-card);
}

/* Colored dot identifying the class */
.hw-empty-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hw-empty-class-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
}

/* "Add task" button inside an empty class row */
.hw-empty-add-task-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.hw-empty-add-task-btn:hover {
  background: #202026;
  color: var(--text-secondary);
}

/* ---- Add task modal ---- */

.hw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* The [hidden] attribute sets display:none, but we override with flex
     by removing the attribute in JS. The overlay uses display:flex by default
     when not hidden. */
}
/* Hide via attribute rather than class so we can use `hidden` HTML attribute */
.hw-modal-overlay[hidden] {
  display: none;
}

.hw-modal {
  background: #1a1a20;
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
}

.hw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.hw-modal-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.hw-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.hw-modal-close:hover { color: var(--text-primary); }

/* Form groups */
.hw-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.hw-form-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.hw-form-optional {
  font-weight: 400;
  color: var(--text-faint);
}

.hw-form-input,
.hw-form-select {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-container);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.hw-form-input:focus,
.hw-form-select:focus {
  border-color: rgba(94,234,212,0.4);
}
.hw-form-input.error {
  border-color: rgba(240,149,149,0.5);
}
.hw-form-input::placeholder {
  color: var(--text-faint);
}

/* Date input: use system colors but match the rest */
.hw-form-date::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

/* Select arrow icon */
.hw-form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpolyline points='2 4 6 8 10 4' fill='none' stroke='%236b6b76' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.hw-form-select option {
  background: #1a1a20;
  color: var(--text-primary);
}

/* Submit button */
.hw-form-submit {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--teal);
  border: none;
  color: #0d0d0f;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.hw-form-submit:hover { opacity: 0.9; transform: scale(1.01); }
.hw-form-submit:active { transform: scale(0.98); }
.hw-form-submit:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* ============================================================
   Page fade-in animation
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.app-container {
  animation: fadeIn 0.2s ease forwards;
}

/* ============================================================
   Ideas list page
   ============================================================ */

/* Header layout - same pattern as homework */
.ideas-page-header {
  justify-content: space-between;
}
.ideas-page-header .page-title {
  flex: 1;
  margin-left: 4px;
}

/* Purple circle add button */
.ideas-add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}
.ideas-add-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(124,58,237,0.35);
}
.ideas-add-btn:active {
  transform: scale(0.95);
}

/* Search bar wrapper: positions the icon inside the input */
.ideas-search-wrap {
  position: relative;
  margin-bottom: 16px;
}
.ideas-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;  /* so clicking the icon focuses the input */
}
.ideas-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-row);
  padding: 10px 12px 10px 34px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.ideas-search-input:focus {
  border-color: rgba(167,139,250,0.3);
}
.ideas-search-input::placeholder {
  color: var(--text-faint);
}

/* The ideas list */
.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

/* Each idea card - same structure as homework class cards */
.idea-card {
  display: block;
  background: var(--bg-card);
  border-radius: 0 14px 14px 0;
  border-left: 3px solid var(--purple-light);
  padding: 16px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.idea-card:hover {
  background: #181820;
}

.idea-card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

/* CSS line-clamp: limits text to 2 lines and adds "..." at the end.
   This is a webkit feature (-webkit prefix) but works in all modern browsers. */
.idea-card-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.idea-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.idea-card-time {
  font-size: 11px;
  color: var(--text-faint);
}

/* "No ideas match your search" message */
.ideas-no-results {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 40px 0;
}

/* Empty state */
.ideas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 10px;
}
.ideas-empty-icon {
  margin-bottom: 8px;
  opacity: 0.7;
}
.ideas-empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.ideas-empty-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   New idea page
   ============================================================ */

.idea-new-form-wrap {
  padding-bottom: 120px; /* room for the fixed save button */
}

/* Title input: large and borderless, feels like a blank document */
.idea-new-title {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 18px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-primary);
  padding: 8px 0;
  margin-bottom: 4px;
}
.idea-new-title::placeholder {
  color: var(--text-faint);
  font-weight: 400;
}

/* Thin divider between title and body */
.idea-new-divider {
  height: 0.5px;
  background: var(--border-subtle);
  margin: 8px 0 16px;
}

/* Body textarea: borderless, grows with content */
.idea-new-body {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-secondary);
  line-height: 1.6;
  resize: none;       /* hide the resize handle */
  overflow: hidden;   /* prevents scrollbar; JS adjusts height instead */
  min-height: 200px;
  padding: 0;
}
.idea-new-body::placeholder {
  color: var(--text-faint);
}

/* Fixed save button wrapper - sits above the bottom nav */
.idea-save-btn-wrap {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 0;
  right: 0;
  padding: 0 20px;
  z-index: 50;
  /* Fade the content behind the button as it scrolls under */
  pointer-events: none;
}
.idea-save-btn {
  display: block;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 12px;
  background: var(--purple);
  border: none;
  color: white;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  pointer-events: all;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.idea-save-btn:hover:not(:disabled) {
  opacity: 0.9;
  transform: scale(1.01);
}
.idea-save-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.idea-save-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ============================================================
   Idea detail page
   ============================================================ */

/* Header layout: same as other inner pages */
.ideas-detail-header {
  justify-content: space-between;
}
.ideas-detail-header .page-title {
  flex: 1;
  margin-left: 4px;
}

/* Delete button in the header */
.idea-detail-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-small);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.idea-detail-delete-btn:hover { color: #f09595; }

/* Inline delete confirmation bar */
.idea-detail-delete-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(240,149,149,0.08);
  border: 0.5px solid rgba(240,149,149,0.2);
  border-radius: var(--radius-row);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.idea-detail-delete-confirm[hidden] { display: none; }
.idea-detail-delete-msg {
  font-size: 13px;
  color: #f09595;
}
.idea-detail-delete-actions {
  display: flex;
  gap: 8px;
}
.idea-delete-yes, .idea-delete-no {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease;
}
.idea-delete-yes {
  background: rgba(240,149,149,0.2);
  color: #f09595;
}
.idea-delete-yes:hover { opacity: 0.75; }
.idea-delete-no {
  background: var(--bg-surface);
  color: var(--text-muted);
}
.idea-delete-no:hover { opacity: 0.75; }

/* Main content */
.idea-detail-content {
  padding-bottom: 32px;
}

/* Title: large, editable on click */
.idea-detail-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 16px;
  cursor: text;
  word-break: break-word;
}
.idea-detail-title:hover {
  opacity: 0.85;
}

/* Inline title edit input */
.idea-title-edit-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  border-radius: 0;
  outline: none;
  font-size: 22px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-primary);
  padding: 0 0 4px;
  margin-bottom: 16px;
  display: block;
}
.idea-title-edit-input:focus {
  border-bottom-color: rgba(167,139,250,0.5);
}

/* Body: editable on click */
.idea-detail-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  cursor: text;
  white-space: pre-wrap;  /* preserve line breaks */
  word-break: break-word;
}
.idea-detail-body:hover {
  opacity: 0.85;
}
.idea-detail-body-empty {
  color: var(--text-faint);
  font-style: italic;
}

/* Inline body edit textarea */
.idea-body-edit-textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  border-radius: 0;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-secondary);
  line-height: 1.6;
  resize: none;
  overflow: hidden;
  padding: 0 0 8px;
  margin-bottom: 20px;
  display: block;
  min-height: 80px;
}
.idea-body-edit-textarea:focus {
  border-bottom-color: rgba(167,139,250,0.3);
}

/* Timestamp below the body */
.idea-detail-time {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 24px;
}

/* ---- Milestone 6 placeholder sections ---- */
.idea-placeholder-divider {
  height: 0.5px;
  background: var(--border-subtle);
  margin: 32px 0;
}

.idea-placeholder-section {
  margin-bottom: 28px;
}

.idea-placeholder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.idea-placeholder-header span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.idea-placeholder-text {
  font-size: 13px;
  color: var(--text-faint);
  font-style: italic;
  padding-left: 20px;
}

/* ============================================================
   Ideas - view toggle (Recent / Grouped)
   ============================================================ */

.ideas-view-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.ideas-view-pill {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  border: 0.5px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  transition: background 0.2s ease, color 0.2s ease;
}
.ideas-view-pill.active {
  background: var(--purple);
  color: white;
  font-weight: 500;
  border-color: transparent;
}

/* ============================================================
   Ideas - grouped clusters
   ============================================================ */

.ideas-cluster {
  margin-bottom: 24px;
}

.ideas-cluster-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.ideas-cluster-header svg {
  color: var(--purple-light);
  opacity: 0.7;
}

.ideas-cluster-count {
  margin-left: 2px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.ideas-cluster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   Idea detail - AI suggestions section
   ============================================================ */

.idea-ai-section {
  margin-bottom: 28px;
}

/* "Get suggestions" button */
.ai-suggestion-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(124,58,237,0.15);
  border: 0.5px solid rgba(167,139,250,0.25);
  color: var(--purple-light);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ai-suggestion-btn:hover {
  background: rgba(124,58,237,0.25);
}
.ai-suggestion-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Spinner animation for the loading state */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.ai-spinner {
  animation: spin 0.9s linear infinite;
}

/* Error message */
.ai-error-msg {
  margin-top: 10px;
  font-size: 12px;
  color: #f09595;
  line-height: 1.5;
}

/* Steps container */
.ai-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* Individual step row */
.ai-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-small);
  padding: 12px;
}

/* Purple numbered circle */
.ai-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.ai-step-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

/* Regenerate button */
.ai-regenerate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: none;
  border: 0.5px solid var(--border-subtle);
  color: var(--text-faint);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.ai-regenerate-btn:hover {
  color: var(--text-muted);
  border-color: rgba(255,255,255,0.1);
}
.ai-regenerate-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ============================================================
   Idea detail - Related ideas section
   ============================================================ */

.related-ideas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

/* Each related idea card */
.related-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface);
  border-radius: var(--radius-row);
  padding: 12px 14px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.related-card:hover {
  background: #1e1e24;
}

.related-title {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Similarity percentage badge (e.g. "87% similar") */
.related-sim-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(167,139,250,0.12);
  color: var(--purple-light);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============================================================
   Milestone 7 - Phase 1 additions
   ============================================================ */

/* ---- A1: Nav plus button purple hover glow ---- */
.nav-btn-plus {
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-btn-plus:hover {
  background: rgba(124,58,237,0.2);
  color: var(--purple-light);
}
.nav-btn-plus.active {
  color: var(--purple-light);
}

/* ---- A2: Quick-switch drawer ---- */

/* Dark scrim behind the drawer */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 149;
  pointer-events: none;
  transition: background 0.2s ease;
}
.nav-drawer-overlay.active {
  background: rgba(0,0,0,0.5);
  pointer-events: all;
}

/* The drawer: slides up from below the screen */
.nav-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: #141417;
  border-radius: 16px 16px 0 0;
  border-top: 0.5px solid rgba(255,255,255,0.08);
  padding: 8px 0 calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateY(110%);
  transition: transform 0.2s ease;
  max-width: 640px;
  margin: 0 auto;
}
.nav-drawer.open {
  transform: translateY(0);
}

/* Each option row inside the drawer */
.nav-drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 14px;
  transition: background 0.15s ease;
}
.nav-drawer-item:hover {
  background: rgba(255,255,255,0.04);
}
.nav-drawer-item:active {
  background: rgba(255,255,255,0.07);
}

/* Small icon circle on the left */
.nav-drawer-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-drawer-label {
  font-size: 14px;
  color: var(--text-primary);
}

/* ---- A3: Completed task strikethrough in Recent section ---- */
.recent-row.completed .recent-title {
  text-decoration: line-through;
  opacity: 0.5;
}
.recent-row.completed .recent-dot {
  opacity: 0.4;
}

/* ---- A4: Collapsible Recent section ---- */

/* Header row: "RECENT" label on left, toggle arrow on right */
.recent-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 12px;
  user-select: none;
}
/* Override section-label margin since it's now in a flex row */
.recent-section-header .section-label {
  margin-bottom: 0;
}

/* The toggle chevron arrow */
.recent-toggle-arrow {
  color: var(--text-faint);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
/* When collapsed, the arrow rotates to point up */
.recent-toggle-arrow.collapsed {
  transform: rotate(180deg);
}

/* Wraps the list so max-height can animate */
.recent-list-wrap {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

/* ============================================================
   Milestone 7 - Phase 2: Homework upgrades
   ============================================================ */

/* ---- C1: Gear icon (manage classes) ---- */
.hw-manage-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-small);
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.15s ease;
  flex-shrink: 0;
}
.hw-manage-btn:hover {
  color: var(--text-secondary);
}

/* ---- C2: Calendar icon + date pill ---- */

/* Task input row: description input + calendar icon side by side */
.hw-task-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}
.hw-task-desc-input {
  flex: 1;
  border-radius: 10px 0 0 10px !important;
  border-right: none !important;
}
.hw-cal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-container);
  border-left: none;
  border-radius: 0 10px 10px 0;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.hw-cal-btn:hover {
  color: var(--teal);
  background: #1e1e24;
}
/* The native date input: hidden visually, triggered by the calendar button */
.hw-date-hidden {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  right: 44px;
  top: 0;
}
/* Row that holds the selected date pill */
.hw-date-pill-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
/* The teal pill showing the selected date (e.g. "Mar 28") */
.hw-date-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(94,234,212,0.15);
  color: var(--teal);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}
/* X button to clear the date */
.hw-date-pill-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-subtle);
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.15s ease;
}
.hw-date-pill-clear:hover {
  color: var(--text-secondary);
}

/* ---- C3: Overdue task styling ---- */

/* Red badge replacing the normal date badge when overdue */
.hw-task-due-overdue {
  color: #e24b4a !important;
  background: rgba(226,75,74,0.12) !important;
  padding: 2px 7px !important;
  border-radius: var(--radius-pill) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
/* In the Due soon filter, overdue cards get a red border + subtle red tint */
.hw-card-overdue {
  border-left-color: #e24b4a !important;
  background: rgba(226,75,74,0.03) !important;
}
/* "OVERDUE" section label that appears above the due-soon cards */
.hw-overdue-section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #e24b4a;
  margin-bottom: 10px;
  margin-top: 4px;
}

/* ---- C1: Manage classes modal ---- */

/* Wider modal for the manage view */
.hw-manage-modal {
  max-width: 460px;
  max-height: 80vh;
  overflow-y: auto;
}

/* List of class rows */
.hw-manage-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

/* Each class row in the manage view */
.hw-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--bg-primary);
  transition: background 0.15s ease;
  cursor: default;
}
.hw-manage-row:hover {
  background: #111114;
}
.hw-manage-row.hw-manage-dragging {
  opacity: 0.5;
}
.hw-manage-row.hw-manage-drag-over {
  background: rgba(167,139,250,0.08);
  outline: 1px dashed rgba(167,139,250,0.3);
}

/* Drag handle (three lines, grabbable) */
.hw-manage-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  color: var(--text-faint);
  cursor: grab;
  flex-shrink: 0;
}
.hw-manage-drag-handle:active {
  cursor: grabbing;
}

/* Color circle button */
.hw-manage-color-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.hw-manage-color-btn:hover {
  transform: scale(1.15);
}

/* Editable class name */
.hw-manage-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hw-manage-name:hover {
  opacity: 0.8;
}

/* Inline name edit input */
.hw-manage-name-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(167,139,250,0.4);
  border-radius: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  padding: 0 0 2px;
  outline: none;
  min-width: 0;
}

/* Delete button inside a manage row */
.hw-manage-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.hw-manage-row:hover .hw-manage-delete-btn {
  opacity: 1;
}
.hw-manage-delete-btn:hover {
  color: #f09595;
}

/* Color picker popover */
.hw-color-picker {
  position: absolute;
  z-index: 10;
  background: #1a1a20;
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.hw-color-picker[hidden] { display: none; }

.hw-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 6px;
}
.hw-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.hw-color-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.4);
}

/* Delete confirmation inside the manage modal */
.hw-manage-delete-confirm {
  background: rgba(240,149,149,0.06);
  border: 0.5px solid rgba(240,149,149,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.hw-manage-delete-confirm[hidden] { display: none; }
.hw-manage-delete-msg {
  font-size: 13px;
  color: #f09595;
  margin-bottom: 10px;
}
.hw-manage-delete-actions {
  display: flex;
  gap: 8px;
}
.hw-manage-delete-yes,
.hw-manage-delete-no {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease;
}
.hw-manage-delete-yes {
  background: rgba(240,149,149,0.2);
  color: #f09595;
}
.hw-manage-delete-yes:disabled { opacity: 0.5; cursor: default; }
.hw-manage-delete-no {
  background: var(--bg-surface);
  color: var(--text-muted);
}

/* "Add class" button at the bottom of the manage modal */
.hw-manage-add-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: 0.5px dashed rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  margin-top: 4px;
}
.hw-manage-add-btn:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
}



/* ============================================================
   PHASE 3 — THOUGHTS (D3, D5, D6, D7, D8, D10)
   ============================================================ */

/* ---- D6: Thought cards ---- */
.thought-card {
  display: block;
  border-radius: 12px;
  border: 0.5px solid rgba(255,255,255,0.07);
  border-left-width: 3px;
  background: var(--bg-surface);
  padding: 12px 14px 10px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.thought-card:hover {
  background: rgba(255,255,255,0.04);
}

.thought-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

/* ---- D6: Type badge (top-right of each card) ---- */
.thought-type-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}
.thought-type-badge-idea {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
}
.thought-type-badge-action {
  background: rgba(232,93,48,0.12);
  color: #e85d30;
}

/* ---- D7: Type toggle pill (detail page) ---- */
.thought-type-toggle-row {
  display: flex;
  margin-bottom: 12px;
}
.thought-type-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.thought-type-toggle-idea {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
}
.thought-type-toggle-idea:hover {
  background: rgba(251,191,36,0.2);
}
.thought-type-toggle-action {
  background: rgba(232,93,48,0.12);
  color: #e85d30;
}
.thought-type-toggle-action:hover {
  background: rgba(232,93,48,0.2);
}
.thought-type-toggle-pill:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---- D3: Classification toast ---- */
.classification-toast {
  position: fixed;
  bottom: calc(var(--nav-height, 64px) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  background: #1e1e28;
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  white-space: nowrap;
}
.classification-toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.classification-toast.toast-hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}
.toast-msg {
  flex: 1;
}
.toast-change-btn {
  font-size: 12px;
  font-weight: 600;
  color: #a78bfa;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: opacity 0.15s ease;
}
.toast-change-btn:hover {
  opacity: 0.75;
}

/* ---- D7: Related thoughts remove button ---- */
.related-card-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.related-card-wrap .related-card {
  flex: 1;
  min-width: 0;
}
.related-remove-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.related-card-wrap:hover .related-remove-btn {
  opacity: 1;
}
.related-remove-btn:hover {
  background: rgba(240,149,149,0.1);
  color: #f09595;
}

/* ---- D7: Add to group ---- */
.related-add-group-wrap {
  margin-top: 10px;
}
.related-add-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: none;
  border: 0.5px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.related-add-group-btn:hover {
  color: var(--text-secondary);
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.03);
}
.related-add-search-wrap {
  margin-top: 8px;
}
.related-add-search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.related-add-search-input:focus {
  border-color: rgba(167,139,250,0.4);
}
.related-add-results {
  margin-top: 6px;
}
.related-add-result-row {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s ease;
}
.related-add-result-row:hover {
  background: rgba(255,255,255,0.05);
}
.related-add-no-results {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- D10: Load more button ---- */
.thoughts-load-more-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 8px 0 16px;
  background: var(--bg-surface);
  border: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.thoughts-load-more-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
}
.thoughts-load-more-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ============================================================
   Auth pages (login / signup)
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: var(--bg-primary);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 40px 32px;
}

.auth-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-container);
  border-radius: var(--radius-small);
  color: var(--text-primary);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s;
}

.auth-input:focus {
  border-color: var(--purple-light);
}

.auth-error {
  font-size: 13px;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-small);
  padding: 10px 14px;
  margin-bottom: 20px;
}

.auth-btn {
  width: 100%;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-small);
  font-size: 15px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}

.auth-btn:hover {
  background: #6d28d9;
}

.auth-link-row {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-link-row a {
  color: var(--purple-light);
  text-decoration: none;
}

/* Username badge in the bottom nav */
.nav-username-badge {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  background: rgba(255,255,255,0.05);
  border: 0.5px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  letter-spacing: 0.2px;
  transition: color 0.15s;
}

.nav-username-badge:hover {
  color: var(--text-secondary);
}
