/* writing.css v2 — İngilizce Yazma Pratiği Modu */

/* ── Shell & Topbar ──────────────────────────────── */
.wr-shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 120px;
  min-height: 100vh;
  box-sizing: border-box;
}
.wr-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.wr-back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text-2, #94a3b8);
  font-size: 0.85rem;
  padding: 6px 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.wr-back-btn:hover { background: rgba(255,255,255,0.06); }

.wr-hist-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: var(--text-3, #64748b);
  font-size: 0.78rem;
  padding: 5px 10px;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
  transition: background 0.15s;
}
.wr-hist-btn:hover { background: rgba(255,255,255,0.06); color: var(--text-2,#94a3b8); }

.wr-topbar-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1, #f1f5f9);
  letter-spacing: 0.3px;
}
.wr-lv-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 1px;
  flex-shrink: 0;
}

/* ── Seviye Seçim ─────────────────────────────────── */
.wr-intro-sub {
  font-size: 0.85rem;
  color: var(--text-3, #64748b);
  line-height: 1.55;
  margin: 0 0 18px;
}
.wr-level-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 480px) {
  .wr-level-grid { grid-template-columns: repeat(3, 1fr); }
}
.wr-lv-btn {
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 14px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  text-align: left;
}
.wr-lv-btn:hover {
  border-color: var(--lvc, #22d3ee);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}
.wr-lv-btn.wr-lv-mine {
  border-color: var(--lvc, #22d3ee);
  background: color-mix(in srgb, var(--lvc, #22d3ee) 7%, transparent);
}
.wr-lv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.wr-lv-badge {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--lvc, #22d3ee);
  letter-spacing: 1px;
}
.wr-lv-me {
  font-size: 0.62rem;
  color: var(--lvc, #22d3ee);
  font-weight: 700;
}
.wr-lv-desc {
  font-size: 0.68rem;
  color: var(--text-3, #64748b);
  line-height: 1.3;
}
.wr-lv-prog-bar {
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}
.wr-lv-prog-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s;
}
.wr-lv-cnt {
  font-size: 0.65rem;
  color: var(--text-3, #64748b);
}

/* ── Boş durum ───────────────────────────────────── */
.wr-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3, #64748b);
  font-size: 0.9rem;
}

/* ── Geçmiş Ekranı ────────────────────────────────── */
.wr-hist-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wr-hist-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 13px 15px;
}
.wr-hi-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.wr-hi-lv {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.wr-hi-prompt {
  font-size: 0.82rem;
  color: var(--text-2, #94a3b8);
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wr-hi-text {
  font-size: 0.78rem;
  color: var(--text-3, #64748b);
  line-height: 1.5;
  margin-bottom: 8px;
  font-style: italic;
}
.wr-hi-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wr-hi-score { font-size: 0.8rem; font-weight: 800; }
.wr-hi-xp {
  font-size: 0.75rem;
  color: #34d399;
  font-weight: 700;
}
.wr-hi-date { font-size: 0.72rem; color: var(--text-3, #64748b); margin-left: auto; }

/* ── Görev Kartı ──────────────────────────────────── */
.wr-task-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.wr-task-prompt {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-1, #f1f5f9);
  line-height: 1.55;
  margin-bottom: 10px;
}
.wr-done-badge {
  display: inline-block;
  font-size: 0.72rem;
  color: #34d399;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: 20px;
  padding: 2px 10px;
  margin-bottom: 8px;
}
.wr-toggle-hint {
  background: none;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  color: var(--text-3, #64748b);
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.wr-toggle-hint:hover { background: rgba(255,255,255,0.06); }
.wr-hint-text {
  margin-top: 10px;
  font-size: 0.84rem;
  color: #38bdf8;
  font-style: italic;
  line-height: 1.5;
}

/* ── Mod Toggle ───────────────────────────────────── */
.wr-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.wr-mt-btn {
  flex: 1;
  padding: 9px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text-3, #64748b);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.wr-mt-btn:hover { background: rgba(255,255,255,0.07); color: var(--text-2,#94a3b8); }
.wr-mt-btn.wr-mt-active {
  background: rgba(167,139,250,0.12);
  border-color: #a78bfa;
  color: #a78bfa;
}

/* ── Şablonlu Mod ─────────────────────────────────── */
.wr-guided-wrap { margin-bottom: 14px; }
.wr-guided-intro {
  font-size: 0.8rem;
  color: var(--text-3, #64748b);
  margin: 0 0 10px;
}
.wr-guided-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.wr-guided-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  line-height: 2;
}
.wr-gt {
  font-size: 0.92rem;
  color: var(--text-2, #94a3b8);
}
.wr-blank {
  border: none;
  border-bottom: 2px solid #a78bfa;
  background: transparent;
  color: var(--text-1, #f1f5f9);
  font-size: 0.92rem;
  padding: 2px 6px;
  min-width: 80px;
  max-width: 200px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.wr-blank:focus { border-color: #c084fc; background: rgba(167,139,250,0.06); }
.wr-blank::placeholder { color: rgba(255,255,255,0.2); font-style: italic; }

.wr-guided-extra { margin-bottom: 12px; }
.wr-ge-label {
  font-size: 0.78rem;
  color: var(--text-3, #64748b);
  margin-bottom: 6px;
}
.wr-ge-hint { opacity: 0.6; }
.wr-textarea-small {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text-1, #f1f5f9);
  font-size: 0.88rem;
  padding: 10px 12px;
  resize: none;
  font-family: inherit;
  line-height: 1.55;
}
.wr-textarea-small:focus { outline: none; border-color: #a78bfa; }

/* ── Serbest Mod ──────────────────────────────────── */
.wr-free-wrap { margin-bottom: 14px; }

/* Başlangıç cümleleri */
.wr-starters-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.wr-sb-label {
  font-size: 0.72rem;
  color: var(--text-3, #64748b);
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wr-starter {
  font-size: 0.82rem;
  color: #a78bfa;
  background: rgba(167,139,250,0.07);
  border: 1px solid rgba(167,139,250,0.15);
  border-radius: 7px;
  padding: 6px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-style: italic;
  line-height: 1.4;
  transition: background 0.15s, opacity 0.2s;
  user-select: none;
}
.wr-starter:hover { background: rgba(167,139,250,0.14); }
.wr-starter.wr-starter-used {
  opacity: 0.45;
  text-decoration: line-through;
}

/* Yazı alanı */
.wr-input-area { margin-bottom: 14px; }
.wr-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  color: var(--text-1, #f1f5f9);
  font-size: 0.95rem;
  line-height: 1.65;
  padding: 14px;
  resize: vertical;
  min-height: 130px;
  transition: border-color 0.2s;
  font-family: inherit;
}
.wr-textarea:focus {
  outline: none;
  border-color: #a78bfa;
  background: rgba(167,139,250,0.04);
}
.wr-textarea::placeholder { color: rgba(255,255,255,0.16); }

.wr-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding: 0 2px;
}
.wr-wc { font-size: 0.78rem; color: #94a3b8; transition: color 0.3s; }
.wr-wc-min { opacity: 0.6; }
.wr-xp-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(52,211,153,0.10);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: 20px;
  padding: 2px 10px;
}

/* Canlı kontroller */
.wr-live-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.wr-lc-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-3, #64748b);
  transition: all 0.25s;
}
.wr-lc-chip.wr-lc-pass {
  background: rgba(52,211,153,0.12);
  border-color: rgba(52,211,153,0.35);
  color: #34d399;
}

/* ── Gramer İpucu Bölümü ──────────────────────────── */
.wr-scaffold {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}
.wr-scaffold-sum {
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2, #94a3b8);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.wr-scaffold-sum::-webkit-details-marker { display: none; }
.wr-scaffold-sum::after {
  content: '›';
  margin-left: auto;
  font-size: 1rem;
  transition: transform 0.2s;
}
.wr-scaffold[open] .wr-scaffold-sum::after { transform: rotate(90deg); }
.wr-grammar-tip {
  padding: 10px 16px;
  font-size: 0.8rem;
  color: #fb923c;
  background: rgba(251,146,60,0.07);
  line-height: 1.55;
}
.wr-kw-row {
  padding: 10px 16px 14px;
  font-size: 0.78rem;
  color: var(--text-3, #64748b);
  line-height: 2;
}
.wr-kw-label { font-weight: 600; margin-right: 4px; }
.wr-kw {
  display: inline-block;
  background: rgba(56,189,248,0.09);
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 5px;
  padding: 1px 8px;
  margin: 2px 3px;
  color: #38bdf8;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.wr-kw:hover { background: rgba(56,189,248,0.18); }

/* ── Gönder Butonu ────────────────────────────────── */
.wr-submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.3px;
}
.wr-submit-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.wr-submit-btn:not(:disabled):hover { opacity: 0.9; transform: translateY(-1px); }
.wr-submit-btn:not(:disabled):active { transform: scale(0.98); }

/* ── Sonuç Ekranı ─────────────────────────────────── */
.wr-result-top {
  text-align: center;
  padding: 22px 16px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  margin-bottom: 14px;
}
.wr-result-grade { font-size: 1.5rem; font-weight: 900; margin-bottom: 4px; }
.wr-result-score { font-size: 2.6rem; font-weight: 900; line-height: 1; margin-bottom: 6px; }
.wr-result-xp { font-size: 0.9rem; font-weight: 700; color: #34d399; margin-bottom: 6px; }
.wr-result-lvprog { font-size: 0.75rem; font-weight: 600; opacity: 0.8; }

.wr-result-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.wr-rs-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3, #64748b);
  margin-bottom: 9px;
}
.wr-chk { font-size: 0.83rem; padding: 4px 0; line-height: 1.45; }
.wr-chk-pass { color: #34d399; }
.wr-chk-miss { color: #f43f5e; }
.wr-grammar-note { font-size: 0.82rem; color: #fb923c; padding: 3px 0; line-height: 1.45; }
.wr-user-text {
  font-size: 0.88rem;
  color: var(--text-2, #94a3b8);
  line-height: 1.65;
  background: rgba(255,255,255,0.02);
  border-radius: 7px;
  padding: 8px 10px;
}
.wr-model-text {
  font-size: 0.88rem;
  color: #a78bfa;
  line-height: 1.65;
  background: rgba(167,139,250,0.06);
  border-radius: 7px;
  padding: 8px 10px;
  font-style: italic;
}

/* ── Aksiyon Butonları ────────────────────────────── */
.wr-actions {
  display: flex;
  gap: 10px;
  padding-bottom: 20px;
}
.wr-btn-pri, .wr-btn-sec {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.wr-btn-pri { background: linear-gradient(135deg,#7c3aed,#a855f7); color:#fff; }
.wr-btn-sec {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-2, #94a3b8);
}
.wr-btn-pri:hover, .wr-btn-sec:hover { opacity: 0.88; transform: translateY(-1px); }
