/* ═══════════════════════════════════════════════
   ChatGPT Extractor — Professional Design System
   Clean, modern SaaS style, indigo accent
   ═══════════════════════════════════════════════ */

/* ── Scroll to Top ──────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s, border-color 0.15s;
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top:hover {
  background: var(--primary-subtle);
  border-color: var(--primary-light);
  color: var(--primary);
}
.scroll-top:active {
  transform: translateY(0) scale(0.93);
}

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

/* ── CSS Custom Properties ──────────────────── */
:root {
  /* Brand */
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-subtle: rgba(29,78,216,0.06);

  /* Backgrounds */
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-border-hover: #cbd5e1;

  /* Text */
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-inverse: #ffffff;

  /* Status */
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --warning: #d97706;

  /* Shadows — clean and subtle */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* Misc */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 999px;
  --header-height: 60px;
  --max-width: 720px;
}

[data-theme="dark"] {
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --primary-light: #93c5fd;
  --primary-subtle: rgba(96,165,250,0.1);

  --bg: #0f172a;
  --bg-alt: #1e293b;
  --card-bg: #1e293b;
  --card-border: #334155;
  --card-border-hover: #475569;

  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;

  --success-bg: rgba(22,163,74,0.15);
  --success-border: rgba(34,197,94,0.3);
  --error-bg: rgba(220,38,38,0.15);
  --error-border: rgba(252,165,165,0.3);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --primary-light: #93c5fd;
    --primary-subtle: rgba(96,165,250,0.1);
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --card-bg: #1e293b;
    --card-border: #334155;
    --card-border-hover: #475569;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --error-bg: rgba(220,38,38,0.15);
    --error-border: rgba(252,165,165,0.3);
  }
}

/* ── Base ───────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

::selection {
  background: var(--primary);
  color: white;
}

/* ── Container ──────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Skip link ──────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

/* ── Header ─────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s, border-color 0.3s;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.logo-icon { color: var(--primary); }

.logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-highlight {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.nav a {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.theme-toggle:hover {
  border-color: var(--card-border-hover);
  color: var(--text);
  transform: scale(1.05);
}
.theme-toggle:active { transform: scale(0.95); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { position: absolute; transition: opacity 0.3s, transform 0.3s; }

[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .icon-sun {
  opacity: 0; transform: rotate(-90deg) scale(0.5);
}
[data-theme="dark"] .theme-toggle .icon-moon,
:root:not([data-theme="light"]):not([data-theme="dark"]) .theme-toggle .icon-moon {
  opacity: 1; transform: rotate(0) scale(1);
}
.theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

/* ── Language Switcher ────────────────────────── */
.lang-switcher {
  position: relative;
  flex-shrink: 0;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.lang-current:hover {
  border-color: var(--card-border-hover);
  color: var(--text);
}
.lang-current::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 4px;
  transition: transform 0.2s;
}
.lang-switcher.open .lang-current::after {
  transform: rotate(180deg);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
}
.lang-switcher.open .lang-dropdown {
  display: block;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.lang-option:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}
.lang-option.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

/* ── Hero ───────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 56px;
  background: var(--bg);
}

.hero-content { position: relative; text-align: center; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid var(--card-border);
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-title .gradient-text {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.65;
}

/* ── Main Form ──────────────────────────────── */
.main-form {
  max-width: 580px;
  margin: 0 auto;
}

.input-group {
  display: flex;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s, border-color 0.25s;
}
.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}

.input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
}

.url-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
}
.url-input::placeholder { color: var(--text-tertiary); }
.url-input.valid { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") right 12px center no-repeat; background-size: 16px; padding-right: 36px; }
.url-input.invalid { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E") right 12px center no-repeat; background-size: 16px; padding-right: 36px; }

.btn-paste {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.btn-paste:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(29,78,216,0.25);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(29,78,216,0.2);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.loading {
  padding: 12px 20px;
}
.btn-primary .spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.input-status {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-top: 8px;
  min-height: 20px;
  text-align: center;
}
.input-status.error { color: var(--error); }

.privacy-note {
  font-size: 0.72rem !important;
  color: #94a3b8 !important;
  opacity: 0.8 !important;
  text-align: center;
  margin-top: 10px;
  line-height: 1.4;
}.format-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.format-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.format-select {
  padding: 7px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.format-select:hover,
.format-select:focus {
  border-color: var(--primary-light);
}

.btn-format-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  line-height: 1.4;
}
.btn-format-dl:hover { opacity: 0.9; }
.btn-format-dl:active { transform: scale(0.97); }

/* ── Hero Trust Pills ───────────────────────── */
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}
.hero-social-proof {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-top: 14px;
}
.hero-social-proof strong {
  color: var(--primary);
  font-weight: 700;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s;
}
.trust-pill svg { flex-shrink: 0; }
.trust-pill:hover { border-color: var(--primary); color: var(--primary); }

/* ── Loading ────────────────────────────────── */
.loading-section {
  margin: 24px 0;
  animation: fadeUp 0.3s ease;
}

.progress-bar { text-align: center; }

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 100%;
  background: var(--primary);
  border-radius: 2px;
  animation: progressSlide 2s ease-in-out infinite;
  transform-origin: left;
}

@keyframes progressSlide {
  0%   { transform: translateX(-100%) scaleX(0.3); }
  40%  { transform: translateX(0%) scaleX(0.6); }
  70%  { transform: translateX(100%) scaleX(0.4); }
  100% { transform: translateX(200%) scaleX(0.2); }
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding: 0 4px;
}

.step {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-tertiary);
  position: relative;
  transition: color 0.3s;
}
.step::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--card-border);
  transition: background 0.3s, box-shadow 0.3s;
}
.step.active {
  color: var(--primary);
}
.step.active::before {
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(29,78,216,0.15);
}
.step.done {
  color: var(--success);
}
.step.done::before {
  background: var(--success);
}

.progress-message {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Error ──────────────────────────────────── */
.error-card {
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: shakeIn 0.35s ease;
  position: relative;
}

.error-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--error-border);
  color: var(--error);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.error-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--error);
  margin-bottom: 2px;
}

.error-text {
  font-size: 0.85rem;
  color: var(--error);
  opacity: 0.9;
}

.error-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--error);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
}
.error-dismiss:hover { opacity: 1; background: var(--error-border); }

@keyframes shakeIn {
  0%   { opacity: 0; transform: translateX(-6px); }
  25%  { transform: translateX(4px); }
  50%  { transform: translateX(-2px); }
  75%  { transform: translateX(1px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ── Results ────────────────────────────────── */
.result-section {
  margin: 32px 0;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.35s ease;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.result-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-badge {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-stats {
  width: 100%;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  margin-top: -4px;
}

.result-header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.result-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1;
}
.result-btn:hover {
  background: var(--primary-subtle);
  border-color: var(--primary-light);
  color: var(--primary);
}
.result-btn:active { transform: scale(0.97); }

.result-body {
  position: relative;
  background: var(--bg-alt);
  max-height: 75vh;
  min-height: 400px;
  overflow-y: auto;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-subtle) transparent;
  transition: max-height 0.3s ease;
}
.result-body.expanded {
  max-height: none;
  resize: none;
}

.result-expand-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: -56px;
  padding: 44px 24px 16px;
  border: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: margin-top 0.3s ease, padding 0.3s ease;
  text-align: center;
  line-height: 1;
  z-index: 2;
}
.result-expand-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  mask-image: linear-gradient(180deg, transparent 0%, black 50%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 50%);
  z-index: -1;
}
.result-expand-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 0%, var(--card-bg) 65%);
  z-index: -2;
}
.result-expand-btn:hover {
  color: var(--primary);
}
.result-expand-btn .expand-icon {
  transition: transform 0.35s ease;
}
.result-body.expanded + .result-expand-btn {
  margin-top: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--card-border);
}
.result-body.expanded + .result-expand-btn::before,
.result-body.expanded + .result-expand-btn::after {
  display: none;
}
.result-body.expanded + .result-expand-btn .expand-icon {
  transform: rotate(180deg);
}

/* ── Share Nudge ────────────────────────────────────────── */
.result-nudge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 24px 14px;
  font-size: 0.76rem;
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.result-nudge.visible {
  opacity: 1;
}
.result-nudge .nudge-arrow {
  color: var(--primary);
  font-size: 1rem;
  transition: transform 0.2s ease;
}
.result-nudge a {
  display: inline-flex;
  color: var(--text-tertiary);
  transition: color 0.15s;
}
.result-nudge a:hover {
  color: var(--primary);
}
.result-nudge a:hover + .nudge-arrow,
.result-nudge a:hover ~ .nudge-arrow {
  transform: translateX(2px);
}

.result-report {
  text-align: center;
  padding: 0 24px 14px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.result-report a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.result-report a:hover {
  text-decoration: underline;
}

/* ── Share Modal ────────────────────────────────────────── */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
}
.share-modal-overlay.visible {
  opacity: 1;
}
.share-modal-overlay.hidden {
  display: none;
}
.share-modal {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
  animation: fadeUp 0.3s ease;
}
.share-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.share-modal-close:hover {
  background: var(--bg-alt);
  color: var(--text);
}
.share-modal-icon {
  margin-bottom: 12px;
}
.share-modal-status {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}
.share-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.share-modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 20px;
}
.share-modal-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.share-modal-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.share-modal-link:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.share-twitter {
  background: #000;
  color: #fff;
}
.share-facebook {
  background: #1877F2;
  color: #fff;
}
.share-reddit {
  background: #FF4500;
  color: #fff;
}
.share-whatsapp {
  background: #25D366;
  color: #fff;
}
.share-telegram {
  background: #0088cc;
  color: #fff;
}
.share-modal-copy label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.share-modal-copy-row {
  display: flex;
  gap: 6px;
}
.share-modal-copy-row input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
}
.share-modal-copy-row input:focus {
  border-color: var(--primary-light);
}
.share-modal-copy-row button {
  padding: 7px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: border-color 0.15s, color 0.15s;
}
.share-modal-copy-row button:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.result-body::-webkit-scrollbar { width: 5px; }
.result-body::-webkit-scrollbar-track { background: transparent; }
.result-body::-webkit-scrollbar-thumb {
  background: var(--primary-subtle);
  border-radius: 3px;
}

.result-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  padding: 4px 16px;
  pointer-events: none;
}

.result-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-tertiary);
  transition: opacity 0.25s ease, background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
}
.result-toolbar-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.result-toolbar-btn:hover {
  background: var(--card-bg);
  border-color: var(--primary-light);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.result-toolbar-btn:active { transform: scale(0.95); }

.result-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 24px 56px;
}

.message {
  padding: 16px 20px;
  border-radius: 12px;
  line-height: 1.65;
  font-size: 0.92rem;
  animation: fadeUp 0.25s ease both;
}

.message.user {
  align-self: flex-end;
  background: var(--primary-subtle);
  color: var(--text);
  max-width: 88%;
}

.message.assistant {
  align-self: flex-start;
  width: 100%;
  color: var(--text);
}

.message+.message {
  margin-top: 6px;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message.user .message-header { color: var(--primary); }
.message.assistant .message-header { color: var(--text-tertiary); }

.message-content {
  font-size: 0.92rem;
  line-height: 1.65;
  word-wrap: break-word;
}
.message-content p { margin: 4px 0; }
.message-content p:first-child { margin-top: 0; }
.message-content p:last-child { margin-bottom: 0; }

.message.user .message-content { color: var(--text); }
.message.assistant .message-content { color: var(--text); }

.message-content code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}
.message.user .message-content code { background: rgba(0,0,0,0.08); }
.message.assistant .message-content code { background: var(--bg-alt); }

.message-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 6px 0;
  font-size: 0.86em;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.message-content pre code { background: none; padding: 0; color: inherit; }
.message-content ul, .message-content ol { padding-left: 20px; margin: 4px 0; }
.message-content li { margin: 2px 0; }
.message-content h1, .message-content h2, .message-content h3,
.message-content h4, .message-content h5, .message-content h6 {
  margin: 10px 0 4px;
  line-height: 1.3;
  font-weight: 600;
}
.message-content h1 { font-size: 1.2rem; }
.message-content h2 { font-size: 1.1rem; }
.message-content h3 { font-size: 1rem; }
.message-content h4 { font-size: 0.95rem; }
.message-content blockquote {
  margin: 6px 0;
  padding: 4px 12px;
  border-left: 3px solid var(--primary-light);
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.message-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.message-content a:hover { opacity: 0.8; }
.message-content table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 0.88rem;
  width: 100%;
}
.message-content th, .message-content td {
  border: 1px solid var(--card-border);
  padding: 6px 10px;
  text-align: left;
}
.message-content th {
  background: var(--bg-alt);
  font-weight: 600;
}
.message-content hr {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 10px 0;
}
.message.user .message-content a { color: var(--primary); }
.message.user .message-content blockquote {
  border-left-color: var(--primary-light);
  background: var(--bg);
  color: var(--text-secondary);
}

/* ── Sections ───────────────────────────────── */
.section {
  padding: 64px 0;
  transition: background 0.3s;
}
.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* ── Steps Grid ─────────────────────────────── */
.steps-grid {
  display: flex;
  align-items: center;
  gap: 0;
}

.step-card {
  flex: 1;
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.step-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.step-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.step-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.step-card-desc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 1px 4px;
  border-radius: 3px;
}

.step-connector {
  width: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}

/* ── Features Grid ──────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.feature-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.feature-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.feature-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.feature-card-desc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
}

/* ── Use Cases Grid ─────────────────────────── */
.usecases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.usecase-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  transition: border-color 0.2s, background 0.2s;
}
.usecase-card:hover {
  border-color: var(--primary-light);
  background: var(--primary-subtle);
}

.usecase-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.usecase-card h3 {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.usecase-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Comparison Table ───────────────────────── */
.comparison-wrap {
  overflow-x: auto;
  margin: 20px 0 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 480px;
  background: var(--card-bg);
}

.comparison-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 2px solid var(--card-border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.comparison-table tr:last-child td { border-bottom: none; }

.highlight-row td {
  background: var(--primary-subtle);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}
.tag-good { color: var(--success); background: var(--success-bg); }
.tag-bad { color: var(--text-tertiary); background: var(--bg-alt); }
.tag-neutral { color: var(--warning); background: rgba(217,119,6,0.08); }

.comparison-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ── Bookmarklet ────────────────────────────── */
.bookmarklet-area {
  text-align: center;
  margin: 24px 0;
}
.bookmarklet-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.bookmarklet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 2px dashed var(--primary-light);
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: grab;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.bookmarklet-btn:hover {
  background: var(--primary-subtle);
  border-color: var(--primary);
}
.bookmarklet-hint {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  text-align: center;
}

/* ── FAQ ────────────────────────────────────── */
.faq-list {
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--primary-light); }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.2s;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question:hover { color: var(--primary); }

.faq-chevron {
  flex-shrink: 0;
  color: var(--text-tertiary);
  transition: transform 0.3s;
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  padding: 0 20px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.faq-answer p { margin-bottom: 6px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer code {
  background: var(--bg-alt);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
}

/* ── Footer ─────────────────────────────────── */
.footer {
  padding: 40px 0 32px;
  border-top: 1px solid var(--card-border);
  text-align: center;
  transition: border-color 0.3s;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--primary); }

.footer-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.footer-social a:hover {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--primary-subtle);
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.footer-small {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.footer-small a { color: var(--text-tertiary); transition: color 0.2s; }
.footer-small a:hover { color: var(--primary); }

/* ── Utilities ──────────────────────────────── */
.hidden { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Animations ─────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.section { animation: fadeUp 0.4s ease both; }
.feature-card:nth-child(1) { animation-delay: 0.05s; }
.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.15s; }
.feature-card:nth-child(4) { animation-delay: 0.2s; }
.feature-card:nth-child(5) { animation-delay: 0.25s; }
.feature-card:nth-child(6) { animation-delay: 0.3s; }

/* ── Toast ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--text-inverse);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: toastIn 0.3s ease;
}
[data-theme="dark"] .toast {
  background: var(--card-border-hover);
  color: var(--text);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ── RTL Overrides ──────────────────────────── */
html[dir="rtl"] .nav {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

html[dir="rtl"] .lang-option {
  text-align: right;
}

html[dir="rtl"] .lang-current::after {
  margin-left: 0;
  margin-right: 4px;
}

html[dir="rtl"] .input-group {
  flex-direction: row-reverse;
}

html[dir="rtl"] .input-wrap {
  padding-left: 0;
  padding-right: 4px;
}

html[dir="rtl"] .btn-primary svg {
  order: 1;
}

html[dir="rtl"] .step-connector {
  transform: scaleX(-1);
}

html[dir="rtl"] .error-dismiss {
  right: auto;
  left: 12px;
}

html[dir="rtl"] .comparison-table th,
html[dir="rtl"] .comparison-table td {
  text-align: right;
}

@media (max-width: 768px) {
  html[dir="rtl"] .input-group {
    flex-direction: column;
  }
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero { padding: 40px 0 32px; }
  .section { padding: 48px 0; }
  .section-title { font-size: 1.5rem; }
  .section-subtitle { font-size: 0.92rem; }

  .steps-grid { flex-direction: column; gap: 12px; }
  .step-connector { width: auto; transform: rotate(90deg); }

  .features-grid { grid-template-columns: 1fr; }
  .usecases-grid { grid-template-columns: 1fr; }

  .input-group { flex-direction: column; padding: 8px; }
  .btn-primary { width: 100%; justify-content: center; }

  .result-header { flex-direction: column; align-items: flex-start; }
  .result-header-actions { width: 100%; }
  .result-header-actions .result-btn { flex: 1; justify-content: center; }
  .result-toolbar { width: 100%; }
  .result-toolbar .result-toolbar-btn { flex: 1; justify-content: center; }
  .result-header-left { flex-wrap: wrap; }

  .nav { display: none; }
  .logo-text { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .hero-badge { font-size: 0.72rem; }
  .trust-pill { font-size: 0.75rem; padding: 4px 10px; }
  .comparison-table { font-size: 0.8rem; min-width: 360px; }
}
