/* Palette. Only these variables change between light and dark mode. */
:root {
  --lk-navy: #1f2a44;
  --lk-accent: #f08a24;
  --lk-accent-hover: #d97812;
  --lk-bg: #f6f4f0;
  --lk-surface: #ffffff;
  --lk-surface-soft: #efeae1;
  --lk-text: #1c2333;
  --lk-muted: #616b7d;
  --lk-shadow: 0 1px 2px rgba(31, 42, 68, 0.05), 0 10px 24px rgba(31, 42, 68, 0.07);
  --lk-radius: 1rem;

  --bs-body-bg: var(--lk-bg);
  --bs-body-color: var(--lk-text);
  --bs-secondary-color: var(--lk-muted);
  --bs-border-radius: 0.7rem;
  --bs-border-radius-lg: 0.9rem;
}

[data-bs-theme="dark"] {
  --lk-bg: #10141f;
  --lk-surface: #1a2130;
  --lk-surface-soft: #232b3c;
  --lk-text: #e9edf5;
  --lk-muted: #a3adc0;
  --lk-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.4);

  --bs-body-bg: var(--lk-bg);
  --bs-body-color: var(--lk-text);
  --bs-secondary-color: var(--lk-muted);
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* One comfortable reading column for the whole app, top bar included. */
.container {
  max-width: 900px;
}

/* Top bar */
.lk-navbar {
  background: var(--lk-navy);
  --bs-navbar-color: rgba(255, 255, 255, 0.72);
  --bs-navbar-hover-color: #ffffff;
  --bs-navbar-active-color: #ffffff;
  --bs-navbar-brand-color: #ffffff;
  --bs-navbar-brand-hover-color: #ffffff;
}

.lk-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lk-navbar .nav-link {
  font-weight: 600;
  padding-inline: 0.85rem;
  border-bottom: 3px solid transparent;
}

.lk-navbar .nav-link.active {
  border-bottom-color: var(--lk-accent);
}

/* Shared pieces */
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--lk-muted);
  margin-bottom: 0.75rem;
}

.today-line {
  color: var(--lk-muted);
  margin-bottom: 0.15rem;
}

.lk-panel,
.card {
  background: var(--lk-surface);
  border: 0;
  border-radius: var(--lk-radius);
  box-shadow: var(--lk-shadow);
}

.lk-panel {
  padding: 1.5rem;
}

.alert {
  border: 0;
  border-radius: var(--lk-radius);
}

/* Lines the banner up with the content column instead of spanning the window. */
#health-banner {
  max-width: min(900px, calc(100% - 2rem));
  margin-inline: auto !important;
  box-shadow: var(--lk-shadow);
}

.subject-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex: 0 0 auto;
}

.btn-accent {
  --bs-btn-color: var(--lk-navy);
  --bs-btn-bg: var(--lk-accent);
  --bs-btn-border-color: var(--lk-accent);
  --bs-btn-hover-color: var(--lk-navy);
  --bs-btn-hover-bg: var(--lk-accent-hover);
  --bs-btn-hover-border-color: var(--lk-accent-hover);
  --bs-btn-active-color: var(--lk-navy);
  --bs-btn-active-bg: var(--lk-accent-hover);
  --bs-btn-active-border-color: var(--lk-accent-hover);
  --bs-btn-disabled-color: var(--lk-navy);
  --bs-btn-disabled-bg: var(--lk-accent);
  --bs-btn-disabled-border-color: var(--lk-accent);
  --bs-btn-focus-shadow-rgb: 240, 138, 36;
  font-weight: 600;
}

.big-button {
  min-height: 5rem;
  font-size: 1.5rem;
}

.empty-state {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--lk-muted);
}

.empty-state-emoji {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

/* Task rows, shared by the task list and the lesson view */
.task-group + .task-group {
  margin-top: 1.75rem;
}

.task-group-overdue .eyebrow {
  color: var(--bs-danger-text-emphasis);
}

.task-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
  background: var(--lk-surface);
  border-radius: var(--lk-radius);
  box-shadow: var(--lk-shadow);
  cursor: pointer;
}

.task-check {
  width: 2rem;
  height: 2rem;
  margin: 0;
  flex: 0 0 auto;
  border-radius: 0.5rem;
}

.task-row-body {
  flex: 1 1 auto;
  min-width: 0;
}

.task-row-subject {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lk-muted);
}

.task-row-text {
  display: block;
  font-size: 1.2rem;
  line-height: 1.35;
}

.due-badge {
  flex: 0 0 auto;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--lk-surface-soft);
  color: var(--lk-muted);
}

.due-badge-overdue {
  background: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
}

.due-badge-today {
  background: var(--bs-warning-bg-subtle);
  color: var(--bs-warning-text-emphasis);
}

.task-star {
  flex: 0 0 auto;
  font-size: 1.3rem;
  color: var(--lk-accent);
}

/* Subjects */
.subject-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  height: 100%;
  padding: 1.25rem;
  border-radius: var(--lk-radius);
  background: var(--subject-bg);
  color: #ffffff;
  text-decoration: none;
  box-shadow: var(--lk-shadow);
  transition: transform 0.12s ease-out;
}

.subject-card:hover,
.subject-card:focus {
  color: #ffffff;
  transform: translateY(-2px);
}

.subject-card.selected {
  outline: 3px solid var(--lk-text);
  outline-offset: 3px;
}

.subject-card-name {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
}

.subject-card-meta {
  font-size: 0.9rem;
  opacity: 0.85;
}

.lesson-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem 0.9rem 1.6rem;
  background: var(--lk-surface);
  border-radius: var(--lk-radius);
  box-shadow: var(--lk-shadow);
  color: var(--bs-body-color);
  text-decoration: none;
  font-weight: 500;
}

/* A colored edge as a pill, so the card's rounded corners do not eat it. */
.lesson-card::before {
  content: "";
  position: absolute;
  inset: 0.6rem auto 0.6rem 0.6rem;
  width: 6px;
  border-radius: 999px;
  background: var(--subject-bg);
}

.lesson-card:hover {
  color: var(--bs-body-color);
  background: var(--lk-surface-soft);
}

/* Lesson */
.subject-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lk-muted);
  text-decoration: none;
}

.subject-link:hover {
  color: var(--bs-body-color);
}

.summary-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 1.2rem;
  background: var(--lk-surface);
  border-radius: var(--lk-radius);
  box-shadow: var(--lk-shadow);
}

.summary-icon {
  font-size: 1.35rem;
  line-height: 1.4;
}

.transcript > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--lk-muted);
}

/* Recording, a focus mode that takes over the whole view */
.recording-focus {
  margin-top: 1.5rem;
  padding-inline: 1.5rem;
  /* Keeps the dark panel off the viewport edge on a narrow screen. */
  max-width: min(900px, calc(100% - 1.5rem));
  background: var(--lk-navy);
  border-radius: var(--lk-radius);
  box-shadow: var(--lk-shadow);
  color: #ffffff;
}

.recording-focus .text-secondary {
  color: rgba(255, 255, 255, 0.65) !important;
}

.recording-focus .text-danger {
  color: #ffa39b !important;
}

.recording-focus .text-warning {
  color: #ffd479 !important;
}

.recording-focus .meeting-audio-toggle .form-check-label {
  color: rgba(255, 255, 255, 0.85);
}

.meeting-audio-toggle .form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

.meeting-audio-toggle .form-check-input:disabled,
.meeting-audio-toggle .form-check-input:disabled + .form-check-label {
  opacity: 0.5;
}

.recording-subject {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.elapsed-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #ef4b45;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.75); }
}

.record-button {
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  font-size: 1.75rem;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.marker-button {
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.live-text {
  min-height: 10rem;
  max-height: 40vh;
  overflow-y: auto;
  padding: 1rem;
  border-radius: var(--lk-radius);
  font-size: 1.25rem;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.28);
  color: #ffffff;
}

.live-text .interim {
  color: rgba(255, 255, 255, 0.6);
}

.flash {
  animation: flash 0.6s ease-out;
}

@keyframes flash {
  from { box-shadow: 0 0 0 3px #198754; }
  to { box-shadow: 0 0 0 3px rgba(25, 135, 84, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-dot,
  .flash {
    animation: none;
  }

  .subject-card {
    transition: none;
  }
}
