/* ═══════════════════════════════════════════
   LinguaX — Azure Translator
   Style Sheet  ·  style.css
═══════════════════════════════════════════ */

/* ── Variables ─────────────────────────── */
:root {
  --bg-deep:      #030712;
  --bg-surface:   #0d1117;
  --bg-card:      #111827;
  --bg-input:     #1a2332;
  --border:       rgba(255,255,255,0.06);
  --border-glow:  rgba(0,212,255,0.3);

  --accent-1:     #00d4ff;   /* electric cyan   */
  --accent-2:     #ff3dff;   /* vivid magenta   */
  --accent-3:     #ffd600;   /* blazing gold    */
  --accent-4:     #00ff9f;   /* neon green      */

  --text-primary:   #f0f6ff;
  --text-secondary: #8899aa;
  --text-dim:       #445566;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --font-display: 'Orbitron', monospace;
  --font-body:    'Syne', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --shadow-glow-cyan: 0 0 40px rgba(0,212,255,0.18);
  --shadow-glow-mag:  0 0 40px rgba(255,61,255,0.18);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ── Canvas Background ──────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Pages ──────────────────────────────── */
.page {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translateY(20px);
}
.page.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.page.slide-out {
  opacity: 0;
  transform: scale(0.96) translateY(-30px);
}
.page.slide-in {
  opacity: 1;
  transform: translateY(0);
}

/* ══════════════════════════════════════════
   PAGE 1 — SETUP
══════════════════════════════════════════ */
#page-setup {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.setup-container {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 2;
}

/* Logo */
.logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeSlideDown 0.8s cubic-bezier(0.16,1,0.3,1) both;
}
.logo-icon {
  width: 72px;
  height: 72px;
  animation: logoSpin 12s linear infinite;
  filter: drop-shadow(0 0 16px var(--accent-1));
}
@keyframes logoSpin {
  0%   { filter: drop-shadow(0 0 16px var(--accent-1)); }
  33%  { filter: drop-shadow(0 0 16px var(--accent-2)); }
  66%  { filter: drop-shadow(0 0 16px var(--accent-3)); }
  100% { filter: drop-shadow(0 0 16px var(--accent-1)); }
}
.logo-text {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 60%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--accent-3);
  border: 1px solid rgba(255,214,0,0.3);
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,214,0,0.05);
}

/* Tagline */
.setup-tagline {
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-secondary);
  animation: fadeSlideUp 0.8s 0.1s cubic-bezier(0.16,1,0.3,1) both;
  line-height: 1.7;
}
.setup-tagline .highlight {
  color: var(--text-primary);
  font-weight: 600;
}

/* Setup Card */
.setup-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.8s 0.2s cubic-bezier(0.16,1,0.3,1) both;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), var(--shadow-glow-cyan);
}
.setup-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,212,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.card-glow {
  position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,212,255,0.12) 0%, transparent 70%);
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}
@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.2); }
}

/* Field Groups */
.field-group { margin-bottom: 24px; }

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--accent-1);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.label-icon {
  font-size: 0.9rem;
  opacity: 0.8;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.futuristic-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 44px 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  letter-spacing: 0.02em;
}
.futuristic-input::placeholder { color: var(--text-dim); font-family: var(--font-body); }
.futuristic-input:focus {
  border-color: var(--accent-1);
  background: rgba(0,212,255,0.04);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1), inset 0 0 0 1px rgba(0,212,255,0.15);
}
.input-line {
  position: absolute;
  bottom: 0; left: 16px; right: 16px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  border-radius: 2px;
}
.input-wrap:focus-within .input-line { transform: scaleX(1); }

.eye-btn {
  position: absolute; right: 12px;
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s;
}
.eye-btn:hover { color: var(--accent-1); }
.eye-btn svg { width: 18px; height: 18px; }

.field-hint {
  display: block;
  margin-top: 7px;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Enter Button */
.enter-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  color: #000;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  transition: transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 8px 32px rgba(0,212,255,0.3);
}
.enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,212,255,0.45);
}
.enter-btn:active { transform: translateY(0) scale(0.99); }
.btn-arrow svg { width: 18px; height: 18px; }
.btn-ripple {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.25) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
}
.enter-btn:active .btn-ripple { opacity: 1; }

.security-note {
  text-align: center;
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-top: 14px;
  letter-spacing: 0.02em;
}

/* Floating Pills */
.lang-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  animation: fadeSlideUp 1s 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
.pill {
  padding: 5px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  animation: floatPill 4s ease-in-out infinite;
}
.pill:nth-child(1)  { animation-delay: 0s;   }
.pill:nth-child(2)  { animation-delay: 0.3s; }
.pill:nth-child(3)  { animation-delay: 0.6s; }
.pill:nth-child(4)  { animation-delay: 0.9s; }
.pill:nth-child(5)  { animation-delay: 1.2s; }
.pill:nth-child(6)  { animation-delay: 0.15s; }
.pill:nth-child(7)  { animation-delay: 0.45s; }
.pill:nth-child(8)  { animation-delay: 0.75s; }
.pill:nth-child(9)  { animation-delay: 1.05s; }
.pill:nth-child(10) { animation-delay: 1.35s; }
@keyframes floatPill {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

/* ══════════════════════════════════════════
   TRANSITION OVERLAY
══════════════════════════════════════════ */
.transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.t-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: ringExpand 1.4s cubic-bezier(0.4,0,0.6,1) infinite;
}
.t-ring-1 {
  width: 80px; height: 80px;
  border-color: var(--accent-1);
  animation-delay: 0s;
}
.t-ring-2 {
  width: 140px; height: 140px;
  border-color: var(--accent-2);
  animation-delay: 0.2s;
  opacity: 0.6;
}
.t-ring-3 {
  width: 200px; height: 200px;
  border-color: var(--accent-3);
  animation-delay: 0.4s;
  opacity: 0.3;
}
@keyframes ringExpand {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.t-center-dot {
  width: 16px; height: 16px;
  background: var(--accent-1);
  border-radius: 50%;
  animation: dotPulse 0.8s ease-in-out infinite alternate;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 20px var(--accent-1);
}
@keyframes dotPulse {
  from { transform: scale(0.8); }
  to   { transform: scale(1.4); box-shadow: 0 0 30px var(--accent-1); }
}
.t-text {
  position: relative; z-index: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--text-secondary);
  margin-top: 130px;
  animation: textBlink 1s ease-in-out infinite alternate;
}
@keyframes textBlink {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

/* ══════════════════════════════════════════
   PAGE 2 — TRANSLATOR DASHBOARD
══════════════════════════════════════════ */
#page-translator {
  flex-direction: column;
  overflow-y: auto;
  position: fixed;
  inset: 0;
}

/* Nav */
.top-nav {
  position: sticky; top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(3,7,18,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo-icon {
  font-size: 1.2rem;
  -webkit-text-fill-color: var(--accent-1);
  animation: iconPulse 3s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { filter: drop-shadow(0 0 4px var(--accent-1)); }
  50%       { filter: drop-shadow(0 0 10px var(--accent-1)); }
}
.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}
.status-dot {
  width: 8px; height: 8px;
  background: var(--accent-4);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-4);
  animation: statusBlink 2s ease-in-out infinite;
}
@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.nav-btn-back {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.nav-btn-back:hover {
  color: var(--accent-1);
  border-color: var(--accent-1);
}

/* Dashboard */
.dashboard {
  padding: 28px 24px 60px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  gap: 0;
  animation: fadeSlideDown 0.6s cubic-bezier(0.16,1,0.3,1) both;
  overflow: hidden;
  position: relative;
}
.stats-bar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
}
.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stat-val {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.3s;
}
.stat-lbl {
  font-size: 0.67rem;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* Translator Card */
.translator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  animation: fadeSlideUp 0.6s 0.1s cubic-bezier(0.16,1,0.3,1) both;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}
.translator-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(0,212,255,0.03) 0%,
    transparent 40%,
    rgba(255,61,255,0.02) 100%);
  pointer-events: none;
}

/* Language Row */
.lang-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}
.lang-selector-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lang-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: var(--accent-1);
}
.lang-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23445566' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}
.lang-select:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.lang-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.swap-btn {
  width: 44px; height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
  margin-bottom: 0;
}
.swap-btn svg { width: 18px; height: 18px; }
.swap-btn:hover {
  background: rgba(0,212,255,0.1);
  border-color: var(--accent-1);
  color: var(--accent-1);
  transform: rotate(180deg);
}

/* Panels */
.panels-row {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  gap: 0;
  align-items: stretch;
  min-height: 280px;
}
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.3s;
}
.panel:focus-within { border-color: rgba(0,212,255,0.3); }
.panel-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.panel-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.panel-actions {
  display: flex;
  gap: 4px;
}
.icon-btn {
  width: 28px; height: 28px;
  background: none; border: none;
  color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { color: var(--accent-1); background: rgba(0,212,255,0.08); }

.text-area {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  padding: 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.7;
  resize: none;
  outline: none;
  min-height: 200px;
}
.text-area::placeholder { color: var(--text-dim); }

.output-area {
  flex: 1;
  padding: 16px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  overflow-y: auto;
  min-height: 200px;
  position: relative;
}
.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.placeholder-icon {
  font-size: 2rem;
  opacity: 0.4;
  animation: placeholderFloat 3s ease-in-out infinite;
}
@keyframes placeholderFloat {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%       { transform: translateY(-6px); opacity: 0.7; }
}

.panel-footer {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}
.speak-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; opacity: 0.6; transition: opacity 0.2s;
}
.speak-btn:hover { opacity: 1; }

/* Arrow / Flow Divider */
.panels-divider {
  display: flex;
  align-items: center;
  justify-content: center;
}
.arrow-flow {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.flow-dot {
  width: 6px; height: 6px;
  background: var(--accent-1);
  border-radius: 50%;
  animation: flowBounce 1.2s ease-in-out infinite;
  opacity: 0.6;
}
.fd1 { animation-delay: 0s; }
.fd2 { animation-delay: 0.2s; }
.fd3 { animation-delay: 0.4s; }
@keyframes flowBounce {
  0%, 100% { transform: translateX(0); opacity: 0.3; }
  50%       { transform: translateX(4px); opacity: 1; }
}

/* Translate Button Row */
.translate-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  align-items: center;
}
.translate-btn {
  flex: 1;
  background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px 24px;
  color: #000;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 6px 28px rgba(0,212,255,0.3);
}
.translate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0,212,255,0.45);
}
.translate-btn:active { transform: scale(0.99); }
.tbtn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.tbtn-inner svg { width: 18px; height: 18px; }
.tbtn-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: rgba(255,255,255,0.5);
  width: 0%;
  transition: width 0.3s;
}
.translate-btn.loading .tbtn-progress {
  animation: progressRun 1.5s linear infinite;
}
@keyframes progressRun {
  0%   { left: 0; width: 0%; }
  50%  { left: 0; width: 60%; }
  100% { left: 100%; width: 0%; }
}

.secondary-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.secondary-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

/* ── Output Text Typewriter ─────────────── */
.output-text {
  animation: fadeInUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-1);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── History ────────────────────────────── */
.history-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  animation: fadeSlideUp 0.6s 0.2s cubic-bezier(0.16,1,0.3,1) both;
}
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.history-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.clear-history-btn {
  background: none; border: none;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}
.clear-history-btn:hover { color: var(--accent-2); }
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.history-empty {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 24px 0;
}
.history-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  animation: fadeInUp 0.4s cubic-bezier(0.16,1,0.3,1) both;
  cursor: pointer;
  transition: border-color 0.2s;
}
.history-item:hover { border-color: rgba(0,212,255,0.2); }
.history-src { font-size: 0.88rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-arrow {
  font-size: 0.7rem;
  color: var(--accent-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.history-langs { font-family: var(--font-mono); font-size: 0.6rem; color: var(--text-dim); }
.history-tgt { font-size: 0.88rem; color: var(--text-primary); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Toast ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px; right: 32px;
  z-index: 2000;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { border-color: var(--accent-4); color: var(--accent-4); }
.toast.error   { border-color: var(--accent-2); color: var(--accent-2); }

/* ── Keyframe Helpers ───────────────────── */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scrollbar ──────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.3); }

/* ── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .panels-row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .panels-divider {
    flex-direction: row;
    justify-content: center;
    padding: 8px 0;
  }
  .arrow-flow { flex-direction: row; }
  @keyframes flowBounce {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50%       { transform: translateY(4px); opacity: 1; }
  }
  .lang-row { flex-direction: column; }
  .swap-btn { align-self: center; transform: rotate(90deg); }
  .swap-btn:hover { transform: rotate(270deg); }
  .top-nav { padding: 12px 16px; }
  .stats-bar { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .stat-divider { display: none; }
  .stat-item { flex: 0 0 calc(50% - 6px); }
  .setup-card { padding: 24px 20px; }
  .translate-btn-row { flex-direction: column; }
  .secondary-btn { width: 100%; }
}