/* ─── CSS VARIABLES ──────────────────────────────────────────────────────── */
:root {
  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface2: #f8faff;
  --primary: #4338ca;
  --primary-light: #6366f1;
  --accent: #06b6d4;
  --success: #10b981;
  --error: #f43f5e;
  --warning: #f59e0b;
  --text: #1e1b4b;
  --text-muted: #6b7280;
  --border: #e0e7ff;
  --shadow: 0 4px 24px rgba(67,56,202,0.08);
  --shadow-lg: 0 12px 40px rgba(67,56,202,0.14);
  --radius: 18px;
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── BASE ───────────────────────────────────────────────────────────────── */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Decorative background blobs */
body::before {
  content: '';
  position: fixed;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -150px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(6,182,212,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 1;
}

/* ─── HEADER ─────────────────────────────────────────────────────────────── */
header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeDown 0.7s ease both;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: var(--primary);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

header p {
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── CARD ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.card-body {
  padding: 24px 28px;
}

/* ─── INPUT CARD ─────────────────────────────────────────────────────────── */
.input-card {
  margin-bottom: 32px;
  animation: fadeDown 0.8s 0.1s ease both;
}

textarea {
  width: 100%;
  min-height: 160px;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}
textarea::placeholder {
  color: #9ca3af;
}

code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

.input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── BUTTON ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  border: none;
  border-radius: 12px;
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(67,56,202,0.35);
  margin-top: 18px;
  width: 100%;
  justify-content: center;
  font-size: 16px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(67,56,202,0.45);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}

/* ─── RESULTS ────────────────────────────────────────────────────────────── */
.results {
  display: none;
  flex-direction: column;
  gap: 20px;
}
.results.visible {
  display: flex;
}

.result-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.result-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ─── TAGS ───────────────────────────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 8px;
}
.tag-green  { background: #dcfce7; color: #166534; }
.tag-blue   { background: #dbeafe; color: #1e40af; }
.tag-red    { background: #ffe4e6; color: #9f1239; }
.tag-gray   { background: #f1f5f9; color: #475569; }
.tag-purple { background: #ede9fe; color: #5b21b6; }

/* ─── GRAMMAR DISPLAY ────────────────────────────────────────────────────── */
.grammar-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  font-family: 'DM Mono', monospace;
  font-size: 13.5px;
  line-height: 2;
}

.rule-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rule-var   { color: var(--primary); font-weight: 500; }
.rule-arrow { color: var(--text-muted); }
.rule-prod  { color: var(--text); }

.rule-line.removed {
  background: #fff1f2;
  border-radius: 6px;
  padding: 2px 8px;
}
.rule-line.removed .rule-var,
.rule-line.removed .rule-prod {
  color: var(--error);
  text-decoration: line-through;
}
.rule-line.kept {
  background: #f0fdf4;
  border-radius: 6px;
  padding: 2px 8px;
}

/* ─── VERIFICATION ───────────────────────────────────────────────────────── */
.verify-box {
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.verify-box.success { background: #f0fdf4; border: 2px solid #bbf7d0; }
.verify-box.warning { background: #fffbeb; border: 2px solid #fde68a; }

.verify-icon  { font-size: 36px; }
.verify-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.verify-detail {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.strings-compare {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.strings-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.strings-box h4 {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.strings-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.str-tag {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: white;
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 6px;
  color: var(--text);
}

/* ─── ERROR ──────────────────────────────────────────────────────────────── */
.error-box {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 12px;
  padding: 16px 20px;
  color: var(--error);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── STEP INDICATOR ─────────────────────────────────────────────────────── */
.steps-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0.5;
  transition: opacity 0.4s;
}
.step-item.active {
  opacity: 1;
  color: var(--primary);
}
.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.step-arrow {
  font-size: 10px;
  color: var(--border);
}

/* ─── SECTION LABEL ──────────────────────────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ─── DIVIDER ────────────────────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ─── ANIMATIONS ─────────────────────────────────────────────────────────── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .strings-compare { grid-template-columns: 1fr; }
  .card-body { padding: 18px 18px; }
}
