/* ============================================================
   LinguaTranslator — Main Stylesheet
   ============================================================ */
/* Self-hosted Inter — no Google Fonts, no CLS */
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-latin-500-normal.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-latin-600-normal.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-latin-700-normal.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: optional;
}
@font-face {
    font-family: 'Inter';
    src: url('/assets/fonts/inter-latin-800-normal.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: optional;
}
/* ── Custom Properties ──────────────────────────────────────── */
:root {
  --primary:       #4F46E5;
  --primary-dark:  #3730A3;
  --primary-light: #818CF8;
  --accent:        #7C3AED;
  --accent-light:  #A78BFA;

  --bg:            #FFFFFF;
  --bg-2:          #F8F9FF;
  --bg-3:          #F1F3FF;
  --surface:       #FFFFFF;
  --surface-2:     #F0F0F5;
  --border:        #E2E3ED;
  --border-focus:  #4F46E5;

  --text:          #111827;
  --text-2:        #374151;
  --text-3:        #6B7280;
  --text-4:        #9CA3AF;
  --text-inv:      #FFFFFF;

  --success:       #10B981;
  --warning:       #F59E0B;
  --error:         #EF4444;
  --info:          #3B82F6;

  --radius-sm:     6px;
  --radius:        12px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 25px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl:     0 20px 50px -12px rgba(0,0,0,.15);

  --header-h:      68px;
  --container-w:   1200px;
  --trans-fast:    150ms ease;
  --trans:         250ms ease;
  --trans-slow:    400ms ease;
}

[data-theme="dark"] {
  --bg:        #0F0F14;
  --bg-2:      #16161F;
  --bg-3:      #1E1E2A;
  --surface:   #1A1A25;
  --surface-2: #22222E;
  --border:    #2D2D3E;
  --text:      #F9FAFB;
  --text-2:    #E5E7EB;
  --text-3:    #9CA3AF;
  --text-4:    #6B7280;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,.5);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--trans), color var(--trans);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; transition: color var(--trans-fast); }
a:hover { color: var(--primary-dark); }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul[role="list"] { list-style: none; }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: var(--container-w); margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

.page-wrapper { padding-top: var(--header-h); }

/* ── Header / Nav ───────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 900;
  transition: background var(--trans);
}
[data-theme="dark"] .site-header {
  background: rgba(15,15,20,.92);
}
.nav { display: flex; align-items: center; height: var(--header-h); gap: 8px; }
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem;
  color: var(--text);
  flex-shrink: 0;
  margin-right: auto;
}
.nav-logo:hover { color: var(--primary); }
.nav-logo svg { flex-shrink: 0; }
.nav-links { display: none; align-items: center; gap: 4px; list-style: none; }
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; color: var(--text-2);
  transition: background var(--trans-fast), color var(--trans-fast);
}
.nav-link i { font-size: .8rem; opacity: .7; }
.nav-link:hover, .nav-link.active { background: var(--bg-3); color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-3);
  transition: all var(--trans-fast);
}
.btn-icon:hover { background: var(--bg-3); color: var(--primary); border-color: var(--primary-light); }
.nav-mobile-toggle { display: flex; }
@media (min-width: 768px) { .nav-mobile-toggle { display: none; } }

/* Mobile menu */
.mobile-menu {
  position: absolute;
  top: var(--header-h); left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 20px;
  box-shadow: var(--shadow-lg);
}
.mobile-menu[hidden] { display: none; }
.mobile-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 8px; color: var(--text-2); font-size: .95rem;
  border-bottom: 1px solid var(--border);
  transition: color var(--trans-fast);
}
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav-link:hover { color: var(--primary); }
.mobile-nav-link i { width: 18px; text-align: center; opacity: .6; }
.mobile-menu-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; border: none;
  transition: all var(--trans-fast); cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-secondary:hover { background: var(--bg-3); }
.btn-ghost { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-lg { padding: 13px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

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

/* Tab switcher */
.translator-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.translator-tab {
  flex: 1; padding: 14px 10px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: .9rem; font-weight: 600; color: var(--text-3);
  background: none; border: none;
  border-bottom: 3px solid transparent;
  transition: all var(--trans-fast); cursor: pointer;
}
.translator-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--surface); }
.translator-tab:hover:not(.active) { color: var(--text-2); background: var(--bg-3); }

/* Language bar */
.lang-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  flex-wrap: wrap;
}
.lang-select-wrap { position: relative; flex: 1; min-width: 140px; }
.lang-select {
  width: 100%; padding: 9px 36px 9px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: .88rem; font-weight: 500;
  appearance: none; cursor: pointer;
  transition: border-color var(--trans-fast);
}
.lang-select:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.lang-select-wrap::after {
  content: ''; pointer-events: none;
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-3);
}

.swap-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 50%; color: var(--text-3); font-size: .9rem;
  transition: all var(--trans-fast);
}
.swap-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: rotate(180deg); }

/* Text areas */
.translator-panels {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .translator-panels { grid-template-columns: 1fr 1fr; } }

.trans-panel { display: flex; flex-direction: column; }
.trans-panel:first-child { border-right: 1px solid var(--border); }
.trans-panel-label {
  padding: 10px 16px 0;
  font-size: .75rem; font-weight: 600;
  color: var(--text-3); letter-spacing: .05em; text-transform: uppercase;
}

.trans-textarea {
  flex: 1; width: 100%; min-height: 200px;
  padding: 14px 16px;
  background: transparent; border: none;
  color: var(--text); font-size: .95rem; line-height: 1.65;
  resize: none;
  font-family: inherit;
}
.trans-textarea:focus { outline: none; }
.trans-textarea[readonly] { color: var(--text-2); background: var(--bg-2); cursor: default; }
.trans-textarea::placeholder { color: var(--text-4); }

.trans-panel-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
.char-count { font-size: .78rem; color: var(--text-4); }
.char-count.warning { color: var(--warning); }
.char-count.error { color: var(--error); }

.panel-actions { display: flex; gap: 6px; }
.panel-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-3);
  font-size: .82rem; transition: all var(--trans-fast);
}
.panel-action-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Translate button row */
.translator-actions {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.translate-btn {
  padding: 11px 28px; font-size: .95rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--trans-fast);
  display: flex; align-items: center; gap: 8px;
}
.translate-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(79,70,229,.4); }
.translate-btn.loading { opacity: .8; pointer-events: none; }
.fancy-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-3);
  font-size: .85rem; font-weight: 500;
  cursor: pointer; transition: all var(--trans-fast);
  margin-left: auto;
}
.fancy-toggle.active { background: #FEF3C7; color: #92400E; border-color: #F59E0B; }
.fancy-toggle:hover:not(.active) { border-color: var(--primary-light); color: var(--primary); }

/* ── Style selector (fantasy mode) ────────────────────────── */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  padding: 16px;
}
.style-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 10px;
  background: var(--bg-2); border: 2px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--trans-fast); text-align: center;
}
.style-card:hover { border-color: var(--primary-light); transform: translateY(-2px); }
.style-card.selected { border-color: var(--primary); background: var(--bg-3); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.style-card-icon { font-size: 1.6rem; line-height: 1; }
.style-card-name { font-size: .78rem; font-weight: 600; color: var(--text-2); line-height: 1.2; }

/* Loading spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast notifications */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); color: var(--text);
  font-size: .88rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s ease forwards;
  max-width: 320px;
}
.toast.success { border-color: var(--success); background: #F0FDF4; color: #065F46; }
.toast.error   { border-color: var(--error);   background: #FEF2F2; color: #7F1D1D; }
[data-theme="dark"] .toast.success { background: #052E16; color: #A7F3D0; }
[data-theme="dark"] .toast.error   { background: #2D0E0E; color: #FCA5A5; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  padding: 72px 0 56px;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--bg) 100%);
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 99px;
  background: var(--bg-3); border: 1px solid var(--border);
  font-size: .8rem; font-weight: 600; color: var(--primary);
  margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800; line-height: 1.15;
  letter-spacing: -.02em; color: var(--text);
  max-width: 780px; margin: 0 auto 18px;
}
.hero-title .highlight { color: var(--primary); }
.hero-desc {
  font-size: 1.05rem; color: var(--text-3); max-width: 580px;
  margin: 0 auto 36px; line-height: 1.75;
}

/* ── Language page hero ─────────────────────────────────────── */
.lang-hero {
  padding: 48px 0 40px;
  background: linear-gradient(135deg, var(--bg-3), var(--bg));
}
.lang-hero-inner { display: flex; align-items: center; gap: 20px; }
.lang-flag { font-size: 3.5rem; line-height: 1; }
.lang-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; color: var(--text); }
.lang-hero .lang-meta { color: var(--text-3); font-size: .9rem; margin-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; }
.lang-meta span { display: flex; align-items: center; gap: 5px; }

/* ── Cards & Grids ──────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-grid { display: grid; gap: 20px; }
.card-grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card-grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Language card */
.lang-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none; color: inherit;
}
.lang-card:hover { border-color: var(--primary-light); background: var(--bg-3); transform: translateY(-1px); }
.lang-card-flag { font-size: 1.8rem; flex-shrink: 0; }
.lang-card-info { flex: 1; min-width: 0; }
.lang-card-name { font-weight: 600; color: var(--text); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-card-native { font-size: .78rem; color: var(--text-3); margin-top: 2px; }
.lang-card-badge {
  padding: 3px 8px; border-radius: 99px;
  font-size: .7rem; font-weight: 600;
  background: var(--bg-3); color: var(--text-3);
}
.lang-card-badge.ancient { background: #FEF3C7; color: #78350F; }
[data-theme="dark"] .lang-card-badge.ancient { background: #292100; color: #FCD34D; }

/* Style card (large, for styles page) */
.style-feature-card {
  padding: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: all var(--trans-fast); text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.style-feature-card:hover { border-color: var(--primary-light); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.style-feature-icon { font-size: 2.5rem; margin-bottom: 12px; }
.style-feature-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.style-feature-desc { font-size: .85rem; color: var(--text-3); line-height: 1.55; flex: 1; }
.style-feature-cta { margin-top: 14px; font-size: .82rem; font-weight: 600; color: var(--primary); }

/* ── Section layouts ────────────────────────────────────────── */
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.section-lg { padding: 88px 0; }
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800; color: var(--text);
  letter-spacing: -.015em; margin-bottom: 10px;
}
.section-subtitle { font-size: .95rem; color: var(--text-3); max-width: 560px; line-height: 1.7; margin-bottom: 36px; }
.section-header { margin-bottom: 36px; }
.section-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 36px; }

/* ── Stats bar ──────────────────────────────────────────────── */
.stats-bar {
  display: flex; flex-wrap: wrap; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow);
}
.stat-item {
  flex: 1; min-width: 140px;
  padding: 24px 20px; text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--primary); display: block; }
.stat-label { font-size: .8rem; color: var(--text-3); font-weight: 500; margin-top: 4px; }

/* ── Feature list ───────────────────────────────────────────── */
.feature-list { display: grid; gap: 16px; }
.feature-item { display: flex; align-items: flex-start; gap: 14px; }
.feature-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--bg-3); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: .95rem;
}
.feature-text h4 { font-size: .92rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.feature-text p { font-size: .84rem; color: var(--text-3); line-height: 1.55; }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb { margin-bottom: 20px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; gap: 6px; font-size: .82rem; color: var(--text-3); }
.breadcrumb li + li::before { content: '/'; margin-right: 6px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--primary); }

/* ── Content article (blog, static pages) ───────────────────── */
.content-article { max-width: 760px; }
.content-article h2 { font-size: 1.5rem; font-weight: 700; margin: 36px 0 14px; color: var(--text); }
.content-article h3 { font-size: 1.2rem; font-weight: 700; margin: 28px 0 10px; color: var(--text); }
.content-article p { font-size: .96rem; line-height: 1.8; color: var(--text-2); margin-bottom: 18px; }
.content-article ul, .content-article ol { padding-left: 22px; margin-bottom: 18px; }
.content-article li { font-size: .96rem; line-height: 1.75; color: var(--text-2); margin-bottom: 6px; }
.content-article a { color: var(--primary); text-decoration: underline; }
.content-article blockquote {
  border-left: 3px solid var(--primary); padding: 14px 20px;
  background: var(--bg-3); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0; color: var(--text-2); font-style: italic;
}
.content-article .callout {
  padding: 16px 20px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin: 24px 0;
}

/* ── FAQ accordion ──────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.faq-question {
  width: 100%; padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: none; cursor: pointer;
  text-align: left; font-size: .95rem; font-weight: 600; color: var(--text);
  transition: background var(--trans-fast);
}
.faq-question:hover { background: var(--bg-3); }
.faq-question i { flex-shrink: 0; color: var(--primary); transition: transform var(--trans-fast); }
.faq-item.open .faq-question i { transform: rotate(45deg); }
.faq-answer { display: none; padding: 0 20px 16px; font-size: .9rem; color: var(--text-2); line-height: 1.75; }
.faq-item.open .faq-answer { display: block; }

/* ── Table ──────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px; text-align: left;
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px 16px; font-size: .9rem; color: var(--text-2); border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-2); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-blue { background: #EEF2FF; color: #3730A3; }
.badge-green { background: #F0FDF4; color: #065F46; }
.badge-amber { background: #FFFBEB; color: #78350F; }
.badge-purple { background: #F5F3FF; color: #5B21B6; }
[data-theme="dark"] .badge-blue   { background: #1E1B4B; color: #A5B4FC; }
[data-theme="dark"] .badge-green  { background: #052E16; color: #A7F3D0; }
[data-theme="dark"] .badge-amber  { background: #1C1300; color: #FCD34D; }
[data-theme="dark"] .badge-purple { background: #2E1065; color: #DDD6FE; }

/* ── Search / Filter bar ────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}
.search-bar i { color: var(--text-3); flex-shrink: 0; }
.search-input {
  flex: 1; background: transparent; border: none;
  font-size: .92rem; color: var(--text);
}
.search-input:focus { outline: none; }
.search-input::placeholder { color: var(--text-4); }

/* ── Language family tabs ───────────────────────────────────── */
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter-tab {
  padding: 7px 16px; border-radius: 99px;
  font-size: .82rem; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer; transition: all var(--trans-fast);
}
.filter-tab:hover, .filter-tab.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ── Fun fact box ───────────────────────────────────────────── */
.fun-fact-box {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
  border: 1px solid #C7D2FE; border-radius: var(--radius);
  margin: 24px 0;
}
[data-theme="dark"] .fun-fact-box {
  background: linear-gradient(135deg, #1E1B4B22, #2E106522);
  border-color: #312E81;
}
.fun-fact-box .fun-fact-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.fun-fact-box p { font-size: .88rem; color: var(--text-2); line-height: 1.65; }
.fun-fact-box strong { color: var(--primary); }

/* ── Contact form ───────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .9rem;
  transition: border-color var(--trans-fast);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-error { font-size: .8rem; color: var(--error); margin-top: 4px; }
.form-hint { font-size: .8rem; color: var(--text-3); margin-top: 4px; }

/* ── Alert boxes ────────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: .88rem; margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: #F0FDF4; border: 1px solid #A7F3D0; color: #065F46; }
.alert-error   { background: #FEF2F2; border: 1px solid #FCA5A5; color: #7F1D1D; }
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E3A5F; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-2); border-top: 1px solid var(--border);
  padding: 60px 0 0;
  margin-top: 80px;
}
.footer-grid {
  display: grid; gap: 40px;
  grid-template-columns: 1fr;
  margin-bottom: 48px;
}
@media (min-width: 600px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
  margin-bottom: 12px;
}
.footer-tagline { font-size: .85rem; color: var(--text-3); line-height: 1.65; }
.footer-heading { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 14px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-links a { font-size: .86rem; color: var(--text-3); transition: color var(--trans-fast); }
.footer-links a:hover { color: var(--primary); }

.footer-languages {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.footer-lang-label { font-size: .78rem; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.footer-lang-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-lang-tag {
  padding: 3px 10px; border-radius: 99px;
  background: var(--bg-3); border: 1px solid var(--border);
  font-size: .75rem; color: var(--text-3);
  transition: all var(--trans-fast);
}
.footer-lang-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  font-size: .8rem; color: var(--text-3);
}
.footer-legal a { color: var(--text-3); margin: 0 4px; }
.footer-legal a:hover { color: var(--primary); }

/* ── Utility ─────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted { color: var(--text-3); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 639px) {
  .trans-panel:first-child { border-right: none; border-bottom: 1px solid var(--border); }
  .translator-actions { justify-content: center; }
  .fancy-toggle { margin-left: 0; }
  .hero { padding: 48px 0 40px; }
  .stats-bar { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }
}

/* ── Social Media Footer ─────────────────────────────────── */
.footer-socials {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.footer-socials-label { font-size: .8rem; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.footer-social-icons  { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-social-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-3); font-size: .9rem;
  transition: all var(--trans-fast);
  text-decoration: none;
}
.footer-social-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); }
