@import "./base.css";

.hero {
  padding: 28px 0 20px;
}

.hero h1 {
  font-size: 26px;
  margin: 0 0 8px;
  line-height: 1.3;
}

.hero .subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 20px;
}

.hero .tagline {
  font-size: 13px;
  color: var(--accent-gold);
  margin-top: 12px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0;
}

.stat-mini {
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.stat-mini .val {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.stat-mini .lbl {
  font-size: 12px;
  color: var(--text-secondary);
}

.history-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-elevated);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  margin-bottom: 10px;
  cursor: pointer;
}

.history-score {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  flex: 0 0 auto;
}

.history-card .meta {
  flex: 1;
  min-width: 0;
}

.history-card .title {
  font-size: 15px;
  font-weight: 600;
}

.history-card .sub {
  font-size: 13px;
  color: var(--text-secondary);
}

.history-delete {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid #e5d8d0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  flex: 0 0 auto;
}

.history-delete:hover,
.history-delete:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

.history-delete:disabled {
  opacity: 0.45;
  cursor: wait;
}

.empty-illus {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
}

.empty-illus .icon {
  font-size: 48px;
  opacity: 0.35;
  margin-bottom: 8px;
  font-weight: 700;
}

.setup-group {
  margin-bottom: 22px;
}

.setup-group h3 {
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--text-secondary);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #e0d6cc;
  background: var(--bg-elevated);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.chip small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chip.selected {
  border-color: var(--accent);
  background: #fdf5f5;
}

.fixed-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px 20px;
  background: linear-gradient(transparent, var(--bg-base) 30%);
  max-width: 480px;
  margin: 0 auto;
}

.fixed-cta .summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-align: center;
}

.session-full {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-base);
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid #ebe3da;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.bubble {
  max-width: 85%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 18px 18px 4px 18px;
  font-size: 16px;
  animation: fadeUp 0.28s ease;
}

.bubble.customer {
  background: var(--customer-bubble);
  border-radius: 18px 18px 18px 4px;
  margin-right: auto;
}

.bubble.student {
  background: var(--student-bubble);
  border: 1px solid rgba(158, 61, 61, 0.25);
  margin-left: auto;
}

.bubble.system {
  text-align: center;
  margin: 8px auto;
  font-size: 13px;
  color: var(--accent-gold);
  background: transparent;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}

.typing span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

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

.chat-composer {
  padding: 10px 12px 20px;
  border-top: 1px solid #ebe3da;
  background: var(--bg-elevated);
}

.turn-hint {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 6px;
}

.composer-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.btn-voice {
  width: auto;
  min-width: 56px;
  padding: 10px 12px;
  background: var(--bg-warm);
  color: var(--text-primary);
  border: 1px solid #e0d6cc;
  flex: 0 0 auto;
}

.btn-voice.recording {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.composer-row textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-family: inherit;
  font-size: 17px;
  resize: none;
}

.voice-status {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-warm);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.hint-sheet {
  position: fixed;
  inset: 0;
  background: rgba(61, 50, 41, 0.35);
  z-index: 50;
  display: flex;
  align-items: flex-end;
}

.hint-sheet .sheet {
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 32px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.outcome-badge {
  text-align: center;
  padding: 12px;
  margin: 8px 0;
  border-radius: 12px;
  font-weight: 600;
}

.outcome-badge.positive {
  background: #eef4ef;
  color: var(--success);
  border: 1px solid var(--success);
}

.outcome-badge.negative {
  background: var(--bg-warm);
  color: var(--text-secondary);
}

.intro-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.score-header {
  text-align: center;
  padding: 24px 0;
}

.coach-section {
  border-left: 3px solid var(--accent-gold);
  padding-left: 14px;
  margin-bottom: 20px;
}

.coach-section h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.replay-line {
  padding: 10px 0;
  border-bottom: 1px solid #f0ebe4;
}

.replay-line .quote {
  font-style: italic;
  color: var(--text-primary);
}

.replay-line .verdict.good { color: var(--success); }
.replay-line .verdict.bad { color: var(--accent); }

.oral-block {
  background: var(--bg-warm);
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.6;
}

.embed .top-bar .nav-links { display: none; }

@media (min-width: 900px) {
  body {
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0)),
      var(--bg-base);
  }

  .app-shell {
    max-width: 1120px;
    padding: 0 32px 112px;
  }

  .top-bar {
    padding: 20px 0;
  }

  .brand {
    font-size: 16px;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    align-items: end;
    column-gap: 48px;
    padding: 52px 0 36px;
  }

  .hero h1 {
    font-size: 40px;
    max-width: 680px;
  }

  .hero .subtitle {
    font-size: 18px;
  }

  .hero .btn-primary {
    max-width: 260px;
  }

  .hero .tagline {
    align-self: end;
    justify-self: end;
    font-size: 14px;
  }

  .stat-row {
    max-width: 640px;
  }

  #history {
    max-width: 760px;
  }

  .setup-group {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px 24px;
    align-items: start;
    margin-bottom: 28px;
  }

  .setup-group h3 {
    padding-top: 12px;
    font-size: 16px;
  }

  .chip-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }

  .fixed-cta {
    max-width: 1120px;
    padding: 14px 32px 24px;
  }

  .fixed-cta .btn-primary {
    max-width: 360px;
    margin: 0 auto;
  }

  .session-full {
    max-width: 1160px;
    height: 100vh;
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 16px;
    background: transparent;
  }

  .chat-header {
    grid-column: 1 / -1;
    background: var(--bg-elevated);
    border: 1px solid #ebe3da;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
  }

  .chat-thread {
    background: var(--bg-elevated);
    border: 1px solid #ebe3da;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 24px;
  }

  .bubble {
    max-width: 68%;
  }

  .chat-composer {
    border: 1px solid #ebe3da;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .composer-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .composer-row textarea {
    min-height: 160px;
    max-height: 260px;
  }

  .composer-row #btn-send {
    width: 100% !important;
  }

  .btn-voice {
    width: 100%;
  }

  .hint-sheet {
    align-items: center;
  }

  .hint-sheet .sheet {
    max-width: 520px;
    border-radius: var(--radius-card);
    padding: 24px;
  }

  .score-header {
    padding: 32px 0;
  }

  #content {
    display: grid;
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }

  .score-header {
    grid-row: span 2;
    background: var(--bg-elevated);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-soft);
  }

  .coach-section {
    background: var(--bg-elevated);
    border: 1px solid #f0ebe4;
    border-left: 3px solid var(--accent-gold);
    border-radius: var(--radius-card);
    padding: 16px 18px;
    margin-bottom: 0;
  }
}
