/* Bilikids Teens Speed Writing Styles */

:root {
  --speed-primary: #6366f1;
  --speed-primary-dark: #4f46e5;
  --speed-accent: #10b981;
  --speed-bg: #f8fafc;
  --speed-card: #ffffff;
  --speed-text: #0f172a;
  --speed-muted: #64748b;
  --speed-border: #e2e8f0;
}

body.speed-body {
  background-color: var(--speed-bg);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.speed-wrapper {
  max-width: 1040px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.25rem;
  width: 100%;
  box-sizing: border-box;
}

/* Prompt selection pills */
.speed-prompts-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  scrollbar-width: thin;
}

.prompt-pill-btn {
  background: #ffffff;
  border: 1.5px solid var(--speed-border);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--speed-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.prompt-pill-btn:hover {
  border-color: var(--speed-primary);
  color: var(--speed-primary);
}

.prompt-pill-btn.active {
  background: var(--speed-primary);
  border-color: var(--speed-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Prompt Card Header */
.speed-card-box {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid var(--speed-border);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.speed-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.speed-badge-category {
  display: inline-block;
  background: #e0e7ff;
  color: #4338ca;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.speed-prompt-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #1e1b4b;
}

.speed-prompt-desc {
  margin: 0.6rem 0 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #334155;
}

/* 60s Digital Timer Widget */
.speed-timer-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f1f5f9;
  padding: 12px 20px;
  border-radius: 18px;
  min-width: 140px;
  border: 2px solid #e2e8f0;
}

.speed-timer-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: #4338ca;
  line-height: 1;
}

.speed-timer-sub {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-top: 4px;
}

.speed-progress-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  margin-top: 1rem;
  overflow: hidden;
}

.speed-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--speed-primary);
  border-radius: 999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Writing Area */
.speed-editor-box {
  position: relative;
  margin-top: 1rem;
}

.speed-textarea {
  width: 100%;
  min-height: 180px;
  box-sizing: border-box;
  padding: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #0f172a;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.speed-textarea:focus {
  outline: none;
  border-color: var(--speed-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.speed-textarea:disabled {
  background: #f8fafc;
  cursor: not-allowed;
  color: #94a3b8;
}

/* Live Stats Strip */
.speed-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.85rem;
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid var(--speed-border);
}

.speed-stats-group {
  display: flex;
  gap: 1.5rem;
}

.stat-chip {
  font-size: 0.9rem;
  color: var(--speed-muted);
}

.stat-chip strong {
  color: #0f172a;
  font-size: 1.05rem;
}

/* Action Buttons */
.speed-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
}

.speed-main-btn {
  background: var(--speed-primary);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
  transition: all 0.2s ease;
}

.speed-main-btn:hover {
  background: var(--speed-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.45);
}

.speed-submit-btn {
  background: var(--speed-accent);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.speed-submit-btn:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}

.speed-secondary-btn {
  background: transparent;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.speed-secondary-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Modals */
.speed-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.25rem;
}

.speed-modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 680px;
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.speed-modal-header {
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.speed-close-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.speed-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.speed-modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
}

.speed-score-card {
  background: #f8fafc;
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.speed-cefr-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
}

.speed-score-circle {
  text-align: right;
}

.speed-score-number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.speed-score-denom {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

.speed-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.25rem;
}

.speed-metric-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
}

.metric-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
}

.metric-val {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.metric-bar {
  height: 5px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.metric-bar div {
  height: 100%;
  border-radius: 999px;
}

.speed-original-text-box {
  background: #f1f5f9;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.feedback-items-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback-pill-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
}

.feedback-pill-card.good {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.feedback-pill-card.improve {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.speed-modal-footer {
  padding: 1rem 1.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
}

.speed-btn-primary {
  background: var(--speed-primary);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.speed-btn-secondary {
  background: transparent;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
