/* =============================================
   StrideTalk Session UI
   Design tokens inherited from theme.css.
   ============================================= */

/* ---- SESSION LAYOUT ---- */
.session-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.session-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid rgba(42, 37, 32, 0.08);
  position: sticky;
  top: 0;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.session-nav .brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.session-nav .brand em {
  font-style: normal;
  color: var(--accent);
}

.session-step-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(42, 37, 32, 0.15);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.step-dot.done {
  background: var(--green);
}

/* ---- SITUATION FORM ---- */
.situation-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 40px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.situation-screen .eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 20px;
}

.situation-screen h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--fg);
  margin-bottom: 12px;
}

.situation-screen h1 em {
  font-style: normal;
  color: var(--accent);
}

.situation-screen .sub {
  font-size: 17px;
  color: var(--fg-soft);
  line-height: 1.65;
  margin-bottom: 40px;
  max-width: 540px;
}

.situation-textarea {
  width: 100%;
  min-height: 160px;
  background: var(--bg-warm);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.situation-textarea::placeholder {
  color: var(--fg-soft);
  opacity: 0.6;
}

.situation-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.char-count {
  font-size: 13px;
  color: var(--fg-soft);
  text-align: right;
  margin-top: 8px;
  opacity: 0.6;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 18px 36px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 20px rgba(196, 93, 62, 0.35);
}

.btn-start:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(196, 93, 62, 0.45);
}

.btn-start:active:not(:disabled) {
  transform: translateY(0);
}

.btn-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-start .arrow {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.btn-start:hover:not(:disabled) .arrow {
  transform: translateX(4px);
}

/* ---- COACHING SESSION ---- */
.coaching-screen {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  min-height: calc(100vh - 65px);
}

/* Left: coaching feed */
.coaching-main {
  padding: 48px 52px;
  overflow-y: auto;
  border-right: 1px solid rgba(42, 37, 32, 0.08);
}

.coaching-header {
  margin-bottom: 48px;
}

.coaching-header .situation-preview {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-soft);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.coaching-header .situation-text {
  font-size: 17px;
  color: var(--fg);
  line-height: 1.6;
  background: var(--bg-warm);
  border-radius: 12px;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
}

/* Message bubbles */
.message-feed {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.message-block {
  animation: slideUp 0.4s ease forwards;
  opacity: 0;
}

.message-block.shown {
  opacity: 1;
}

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

.message-block .step-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--accent);
  margin-bottom: 10px;
}

.coach-bubble {
  background: var(--fg);
  color: var(--bg);
  border-radius: 20px 20px 20px 4px;
  padding: 24px 28px;
  font-size: 17px;
  line-height: 1.7;
  max-width: 600px;
}

.user-bubble {
  background: var(--bg-warm);
  color: var(--fg);
  border-radius: 20px 20px 4px 20px;
  padding: 16px 22px;
  font-size: 16px;
  line-height: 1.65;
  max-width: 480px;
  margin-left: auto;
  font-style: italic;
  color: var(--fg-soft);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 18px 22px;
  background: var(--fg);
  border-radius: 20px 20px 20px 4px;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: rgba(250, 247, 242, 0.5);
  border-radius: 50%;
  animation: bounce 1.2s ease infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-6px); opacity: 1; }
}

/* Completion state */
.completion-block {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid rgba(74, 124, 89, 0.2);
  text-align: center;
  margin-top: 16px;
}

.completion-block .check {
  font-size: 40px;
  margin-bottom: 12px;
}

.completion-block h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
}

.completion-block p {
  font-size: 15px;
  color: var(--fg-soft);
  line-height: 1.65;
}

.btn-new-session {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 14px 28px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px rgba(74, 124, 89, 0.3);
}

.btn-new-session:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(74, 124, 89, 0.4);
}

/* Continue input area */
.continue-area {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(42, 37, 32, 0.08);
}

.continue-area label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-soft);
  margin-bottom: 12px;
  letter-spacing: 0.3px;
}

.continue-input {
  width: 100%;
  min-height: 80px;
  background: var(--bg-warm);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 16px 20px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.continue-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.continue-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-next {
  padding: 13px 28px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(196, 93, 62, 0.3);
}

.btn-next:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(196, 93, 62, 0.4);
}

.btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-skip {
  padding: 13px 20px;
  background: transparent;
  color: var(--fg-soft);
  font-family: var(--font-body);
  font-size: 15px;
  border: 1.5px solid rgba(42, 37, 32, 0.15);
  border-radius: 100px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-skip:hover {
  border-color: var(--fg-soft);
  color: var(--fg);
}

/* ---- RIGHT SIDEBAR: MOVEMENT ---- */
.movement-sidebar {
  background: var(--bg-warm);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.sidebar-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--fg-soft);
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(42, 37, 32, 0.1);
}

.movement-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  border-left: 3px solid var(--green);
  transition: transform 0.2s ease;
  animation: slideUp 0.4s ease forwards;
  opacity: 0;
}

.movement-card.shown {
  opacity: 1;
}

.movement-card:first-of-type {
  border-left-color: var(--accent);
}

.movement-card .step-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--green);
  margin-bottom: 8px;
}

.movement-card:first-of-type .step-tag {
  color: var(--accent);
}

.movement-card .prompt-text {
  font-size: 15px;
  color: var(--fg);
  line-height: 1.65;
}

.walk-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--green-light);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--green);
}

.walk-status .pulse {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.timer-display {
  text-align: center;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
}

.timer-display .time {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -2px;
}

.timer-display .timer-label {
  font-size: 13px;
  color: var(--fg-soft);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ---- VOICE CONTROLS ---- */
.voice-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* Large mic button — easy to tap while walking */
.mic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2.5px solid rgba(42, 37, 32, 0.15);
  background: var(--bg-warm);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  flex-shrink: 0;
}

.mic-btn:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.mic-btn.listening {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 8px var(--accent-glow);
  animation: micPulse 1.5s ease infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 8px var(--accent-glow); }
  50%       { box-shadow: 0 0 0 16px rgba(196, 93, 62, 0.06); }
}

.mic-icon {
  font-size: 24px;
  line-height: 1;
}

.mic-btn.listening .mic-icon {
  filter: brightness(10);
}

.mic-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-soft);
}

.mic-btn.listening .mic-label {
  color: #fff;
}

/* Voice status / waveform */
.voice-status {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 100px;
}

.voice-status-text {
  font-size: 13px;
  color: var(--fg-soft);
}

/* Animated waveform bars */
.voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.voice-wave span {
  display: inline-block;
  width: 4px;
  height: 6px;
  border-radius: 2px;
  background: rgba(42, 37, 32, 0.2);
  transition: background 0.2s;
}

.voice-wave.active span {
  background: var(--accent);
  animation: wave 0.8s ease infinite;
}

.voice-wave.active span:nth-child(1) { animation-delay: 0.0s; }
.voice-wave.active span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave.active span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave.active span:nth-child(4) { animation-delay: 0.3s; }
.voice-wave.active span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 100% { height: 6px;  opacity: 0.5; }
  50%       { height: 20px; opacity: 1;   }
}

/* Voice mode toggle (mute) */
.voice-mode-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1.5px solid rgba(42, 37, 32, 0.15);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-soft);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.voice-mode-toggle:hover {
  border-color: var(--fg-soft);
  color: var(--fg);
}

.voice-mode-toggle.muted {
  border-color: rgba(42, 37, 32, 0.1);
  opacity: 0.55;
}

/* ---- AUDIO PLAYER (sidebar) ---- */
.audio-player {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
}

.audio-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 10px;
}

.audio-player audio {
  width: 100%;
  border-radius: 8px;
  accent-color: var(--accent);
}

.btn-replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px;
  border: 1.5px solid rgba(42, 37, 32, 0.15);
  border-radius: 100px;
  background: transparent;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--fg-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-replay:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- ERROR ---- */
.error-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #2a2520;
  color: #faf7f2;
  padding: 14px 24px;
  border-radius: 100px;
  font-size: 15px;
  transition: transform 0.3s ease;
  z-index: 9999;
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  white-space: normal;
  text-align: center;
}

.error-toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ---- MEDITATION STYLES ---- */

/* Message block containing a meditation moment */
.message-block.meditation-step {
  /* Slight right-side accent for meditation steps */
}

/* Badge showing which meditation type is active */
.meditation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--meditation);
  margin-bottom: 10px;
  padding: 4px 10px 4px 6px;
  background: var(--meditation-light, rgba(109, 138, 115, 0.12));
  border-radius: 100px;
  border: 1px solid rgba(109, 138, 115, 0.25);
}

/* Calmer visual treatment for meditation coaching bubbles */
.coach-bubble--calm {
  background: var(--meditation-deep, #4a6741);
  color: #f0f5f0;
  border-left: 4px solid var(--meditation, #6b8a73);
  padding-left: 24px;
}

/* Standalone meditation prompt card — appears below the coaching bubble */
.meditation-card {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(109, 138, 115, 0.08), rgba(109, 138, 115, 0.04));
  border: 1.5px solid rgba(109, 138, 115, 0.2);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: meditationFadeIn 0.5s ease forwards;
  opacity: 0;
}

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

.meditation-card .meditation-icon {
  font-size: 28px;
  line-height: 1;
}

.meditation-card .meditation-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--meditation-deep, #4a6741);
  font-style: italic;
}

.meditation-card .meditation-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-soft);
  opacity: 0.65;
  font-style: normal;
  letter-spacing: 0.5px;
}

/* Movement cards during meditation — slower visual treatment */
.movement-card--slow {
  border-left-color: var(--meditation, #6b8a73);
  background: rgba(109, 138, 115, 0.04);
}

.movement-card--slow .step-tag {
  color: var(--meditation, #6b8a73);
}

.movement-card--slow .prompt-text {
  color: var(--meditation-deep, #4a6741);
}

.movement-card .step-tag:contains("Meditation") {
  /* Override for meditation cards — color handled via .movement-card--slow */
}
@media (max-width: 900px) {
  .coaching-screen {
    grid-template-columns: 1fr;
  }

  .coaching-main {
    padding: 32px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(42, 37, 32, 0.08);
  }

  .movement-sidebar {
    padding: 28px 24px;
  }
}

@media (max-width: 600px) {
  .session-nav {
    padding: 16px 20px;
  }

  .situation-screen {
    padding: 40px 20px;
  }

  .btn-start {
    width: 100%;
    justify-content: center;
  }

  .continue-actions {
    flex-direction: column;
  }

  .btn-next, .btn-skip {
    width: 100%;
    text-align: center;
  }
}
