/* ── Practice page: scenario picker + conversation UI ── */

/* Picker screen */
.picker-screen {
  padding: 120px 32px 80px;
  min-height: 100vh;
}

.picker-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.picker-header {
  max-width: 640px;
  margin-bottom: 40px;
}

.picker-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 16px;
}

.picker-title {
  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: 14px;
}

.picker-sub {
  font-size: 17px;
  color: var(--fg-muted);
}

/* Level chooser */
.level-chooser {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.level-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.level-pills {
  display: flex;
  gap: 8px;
}

.level-pill {
  background: var(--bg-card);
  border: 1px solid var(--bg-accent);
  border-radius: 50px;
  padding: 8px 20px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.level-pill:hover {
  border-color: rgba(240, 168, 48, 0.4);
  color: var(--fg);
}

.level-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Scenarios grid */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.scenario-loading,
.scenario-error {
  color: var(--fg-dim);
  font-style: italic;
  grid-column: 1 / -1;
  padding: 24px 0;
}

.scenario-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-accent);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scenario-card:hover {
  border-color: rgba(240, 168, 48, 0.35);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.scenario-card.loading {
  opacity: 0.6;
  pointer-events: none;
}

.scenario-emoji {
  font-size: 32px;
  line-height: 1;
}

.scenario-lang-badge {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--teal);
  background: rgba(78, 205, 196, 0.1);
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
}

.scenario-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.3px;
}

.scenario-setting {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.scenario-cta {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-display);
}

/* ── Conversation view ── */
.conversation-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 73px; /* nav height */
}

.chat-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px 32px;
  gap: 24px;
}

/* Sidebar */
.chat-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scene-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-accent);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
}

.scene-emoji {
  font-size: 36px;
  margin-bottom: 12px;
  line-height: 1;
}

.scene-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}

.scene-setting {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-muted);
}

.scene-divider {
  border: none;
  border-top: 1px solid var(--bg-accent);
  margin: 16px 0;
}

.scene-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--fg-muted);
}

.scene-meta.mt-4 { margin-top: 8px; }

.scene-meta-label {
  color: var(--fg-dim);
  font-size: 12px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.scene-meta-value {
  font-weight: 500;
  color: var(--teal);
}

/* Buttons */
.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--bg-accent);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: rgba(240, 168, 48, 0.3);
  color: var(--fg);
}

.btn-block { width: 100%; }

/* Main chat */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--bg-accent);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Message bubbles */
.message-wrapper {
  display: flex;
}

.message-ai {
  justify-content: flex-start;
}

.message-user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 78%;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
}

.message-ai .message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--bg-accent);
  border-left: 3px solid var(--accent);
}

.message-user .message-bubble {
  background: var(--accent-soft);
  border: 1px solid rgba(240, 168, 48, 0.25);
}

.message-speaker {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
}

.message-user .message-speaker {
  color: var(--fg);
}

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

.message-translation {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fg-dim);
  font-style: italic;
  line-height: 1.5;
  border-top: 1px solid var(--bg-accent);
  padding-top: 8px;
}

.message-cultural-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--teal);
  background: rgba(78, 205, 196, 0.08);
  padding: 8px 12px;
  border-radius: 8px;
  line-height: 1.5;
}

.cultural-note-icon {
  flex-shrink: 0;
  font-style: normal;
}

.message-error {
  text-align: center;
  font-size: 13px;
  color: var(--coral);
  padding: 8px;
  border-radius: 8px;
  background: rgba(232, 114, 90, 0.1);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 24px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--fg-dim);
  border-radius: 50%;
  animation: bounce 1.2s 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: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Input area */
.chat-input-area {
  border-top: 1px solid var(--bg-accent);
  padding: 16px 20px 12px;
  background: var(--bg-surface);
}

.chat-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--bg-accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg);
  resize: none;
  line-height: 1.55;
  transition: border-color 0.2s;
  min-height: 48px;
  max-height: 160px;
}

.chat-textarea:focus {
  outline: none;
  border-color: rgba(240, 168, 48, 0.5);
}

.chat-textarea::placeholder {
  color: var(--fg-dim);
}

.chat-textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-send {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0c0f1a;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-send:hover {
  background: #f5b840;
  transform: scale(1.05);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chat-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--fg-dim);
}

.chat-hint kbd {
  background: var(--bg-card);
  border: 1px solid var(--bg-accent);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-body);
  font-size: 11px;
}

/* Utility */
.hidden { display: none !important; }

/* Mobile */
@media (max-width: 768px) {
  .picker-screen { padding: 100px 20px 60px; }

  .chat-layout {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }

  .chat-sidebar {
    width: 100%;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
  }

  .scene-card {
    flex: 1;
    padding: 16px;
  }

  .scene-setting { display: none; }

  .btn-secondary {
    width: auto;
    white-space: nowrap;
  }

  .message-bubble { max-width: 90%; }

  .messages-list { padding: 16px; }
}
