/* RadarPrep App Page Styles */

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 96px;
}

.app-section {
  margin-bottom: 0;
}

.hidden { display: none !important; }

/* Section Header */
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
}
.section-icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 4px;
}
.section-header h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}
.section-header p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Input Area */
.input-area {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.study-textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
  resize: vertical;
  min-height: 200px;
  outline: none;
}
.study-textarea::placeholder { color: var(--text-muted); }
.input-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
#char-count {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.char-limit-note { font-size: 13px; color: var(--text-muted); }

/* Controls Row */
.controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.num-questions-label {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.num-questions-label select {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

/* Buttons */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--border); }

/* Loading */
.loading-state {
  text-align: center;
  padding: 80px 0;
}
.radar-spinner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(245, 158, 11, 0.15);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin: 0 auto 32px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}
.loading-sub { font-size: 15px; color: var(--text-muted); }

/* Weakness Cards */
.weakness-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.weakness-card {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.weakness-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 6px;
}
.weakness-topic {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.weakness-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.weakness-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.weakness-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.weakness-pct {
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}
.no-weaknesses {
  color: var(--text-muted);
  font-size: 15px;
  grid-column: 1 / -1;
}

/* Question Cards */
.questions-list { display: flex; flex-direction: column; gap: 24px; }
.question-card {
  background: var(--bg-alt);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  gap: 20px;
}
.question-num {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: rgba(13,27,42,0.2);
  flex-shrink: 0;
  width: 40px;
}
.question-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.5;
}
.options-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.option-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.option-label:hover { border-color: var(--accent); }
.option-label.selected { border-color: var(--accent); background: var(--accent-soft); }
.option-label.correct-answer { border-color: var(--green); background: rgba(34,197,94,0.08); }
.option-label.wrong-answer { border-color: var(--red); background: rgba(239,68,68,0.06); }
.option-label input[type="radio"] { margin-top: 2px; accent-color: var(--accent); }
.option-letter {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  width: 20px;
}
.option-text { line-height: 1.5; }
.rationale-box {
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 10px;
  padding: 16px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-top: 12px;
}
.rationale-box strong { color: var(--green); }
.no-questions { color: var(--text-muted); font-size: 15px; }

/* Try Again */
.try-again-row {
  margin-top: 48px;
  text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
  .app-container { padding: 32px 20px 64px; }
  .controls-row { flex-direction: column; align-items: stretch; }
  .btn-primary { width: 100%; text-align: center; }
  .question-card { flex-direction: column; }
  .question-num { width: auto; }
}