/* =============================================
   style.css — InstaAnalyzer
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

/* ─── CSS Variables — Light Mode ─── */
:root {
  --font-display: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  --bg-page: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8fafd;
  --bg-surface-3: #eef1f8;

  --border: #e2e8f0;
  --border-focus: #6366f1;
  --border-hover: #a5b4fc;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-muted: #cbd5e1;

  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #eef2ff;
  --accent-border: #c7d2fe;
  --accent-glow: rgba(99, 102, 241, 0.15);

  --danger: #ef4444;
  --danger-light: #fff1f2;
  --danger-text: #be123c;
  --danger-border: #fecdd3;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-text: #065f46;
  --success-border: #a7f3d0;

  --warn-light: #fffbeb;
  --warn-text: #92400e;
  --warn-border: #fde68a;
  --warn-icon: #d97706;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1), 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-accent: 0 8px 32px rgba(99, 102, 241, 0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --header-h: 68px;
}

/* ─── Dark Mode Variables ─── */
[data-theme="dark"] {
  --bg-page: #0b0f1a;
  --bg-surface: #131929;
  --bg-surface-2: #1a2236;
  --bg-surface-3: #1e2944;

  --border: #1e2d4a;
  --border-focus: #818cf8;
  --border-hover: #4f5ead;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #334155;

  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-light: #1e1f3b;
  --accent-border: #312e81;
  --accent-glow: rgba(129, 140, 248, 0.2);

  --danger: #f87171;
  --danger-light: #1f0a0a;
  --danger-text: #fca5a5;
  --danger-border: #7f1d1d;

  --success: #34d399;
  --success-light: #022c22;
  --success-text: #6ee7b7;
  --success-border: #064e3b;

  --warn-light: #1c1207;
  --warn-text: #fcd34d;
  --warn-border: #78350f;
  --warn-icon: #f59e0b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-accent: 0 8px 32px rgba(129, 140, 248, 0.3);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
}

input, textarea {
  font-family: var(--font-body);
}

code {
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  background: var(--bg-surface-3);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

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

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  margin: 20px 0;
}

#stats-area {
  padding-top: 30px;
  padding-bottom: 10px;
}

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

@keyframes fabFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

@keyframes toastIn {
  0%   { opacity: 0; transform: translate(-50%, 20px) scale(0.96); }
  60%  { opacity: 1; transform: translate(-50%, -2px) scale(1.02); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translate(-50%, 10px) scale(0.96); }
}

@keyframes toastShake {
  0%, 100% { transform: translateX(-50%); }
  20%       { transform: translateX(calc(-50% - 4px)); }
  40%       { transform: translateX(calc(-50% + 4px)); }
  60%       { transform: translateX(calc(-50% - 3px)); }
  80%       { transform: translateX(calc(-50% + 3px)); }
}

@keyframes slideAppear {
  from { opacity: 0.3; }
  to   { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.45s var(--transition) forwards;
}

.ia-toast-error {
  animation:
    toastIn 0.35s cubic-bezier(.22, 1, .36, 1),
    toastShake 0.45s ease 0.15s;
}

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

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  color: #fff;
  stroke: #fff;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Language Switcher ─── */
.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.lang-option {
  position: relative;
  cursor: pointer;
}

.lang-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.lang-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  white-space: nowrap;
}

.lang-option input[type="radio"]:checked + .lang-label {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.lang-option input[type="radio"]:focus-visible + .lang-label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-label:hover {
  color: var(--text-secondary);
}

.lang-option input[type="radio"]:checked + .lang-label:hover {
  color: #fff;
}

/* ─── Theme Toggle ─── */
.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-border);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .icon-dark { display: none; }
[data-theme="dark"]  .icon-light { display: none; }

/* ─── Hero ─── */
.hero {
  padding: 60px 0 20px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 28px;
}

.hero-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-break {
  display: none;
}

.gradient-text {
  background: linear-gradient(135deg, #6366f1, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── Card ─── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.card-body {
  padding: 28px 32px 36px;
}

/* ─── Tabs ─── */
.tab-header {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
  color: var(--text-tertiary);
  background: transparent;
}

.tab-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.tab-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.tab-inactive:hover {
  color: var(--text-secondary);
  background: var(--bg-surface-2);
}

.tab-count {
  background: var(--bg-surface-3);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 28px;
  text-align: center;
}

.tab-active .tab-count {
  background: var(--accent-light);
  color: var(--accent);
}

/* ─── Tooltip ─── */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.tooltip-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.tooltip-wrap:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-surface);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  font-family: var(--font-body);
}

.tooltip-wrap:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text-primary);
  z-index: 9999;
  pointer-events: none;
}

/* ─── Import Section ─── */
.import-centered {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
}

.import-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: var(--shadow-accent);
}

.import-icon-wrap svg {
  width: 30px;
  height: 30px;
  color: #fff;
  stroke: #fff;
}

.import-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.import-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ─── Dropzone ─── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-surface-2);
  position: relative;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.dropzone-sm {
  padding: 24px;
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  transition: all var(--transition);
}

.dropzone-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  stroke: var(--accent);
}

.dropzone:hover .dropzone-icon,
.dropzone.drag-over .dropzone-icon {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.dropzone:hover .dropzone-icon svg,
.dropzone.drag-over .dropzone-icon svg {
  color: #fff;
  stroke: #fff;
}

.dropzone-primary {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dropzone-secondary {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.dropzone-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.dropzone-hint svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

.dropzone.loaded {
  border-color: var(--success);
  background: var(--success-light);
}

.dropzone.loaded .dropzone-icon {
  background: var(--success);
  border-color: var(--success);
}

.dropzone.loaded .dropzone-icon svg {
  color: #fff;
  stroke: #fff;
}

.dropzone.loaded .dropzone-primary {
  color: var(--success-text);
}

/* ─── Manual Import ─── */
.manual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.manual-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.manual-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.manual-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.manual-icon svg {
  width: 22px;
  height: 22px;
  color: #fff;
  stroke: #fff;
}

.followers-icon,
.following-icon {
  background: var(--accent);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.manual-card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.manual-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── Action Buttons ─── */
.action-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-accent);
  letter-spacing: -0.01em;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary svg {
  width: 18px;
  height: 18px;
}

.btn-primary.loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}

.btn-secondary:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-secondary svg {
  width: 18px;
  height: 18px;
}

/* ─── Stats ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-danger .stat-label { color: var(--danger); }
.stat-danger .stat-value { color: var(--danger); }
.stat-danger { border-color: var(--danger-border); background: var(--danger-light); }

.stat-success .stat-label { color: var(--success); }
.stat-success .stat-value { color: var(--success); }
.stat-success { border-color: var(--success-border); background: var(--success-light); }

#import-section {
  padding-top: 20px;
}

#tutorial-section {
  padding-top: 20px;
}

#tutorial-toggle-wrapper {
  padding-bottom: 20px;
}

/* ─── Results ─── */
.results-card {
  overflow: visible;
}

.search-bar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-2);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: block;
  padding: 10px 16px 10px 44px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.results-list-wrap {
  overflow-y: auto;
  max-height: 535px;
  padding: 20px 24px;
}

.results-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.user-item:hover {
  border-color: var(--accent-border);
  background: var(--accent-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.user-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-link {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.user-link:hover {
  background: var(--accent);
  color: #fff;
}

.user-link svg {
  width: 14px;
  height: 14px;
}

.list-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.list-empty svg {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--text-muted);
  stroke: var(--text-muted);
  display: block;
}

/* ─── Custom Scrollbar ─── */
.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

.tutorial-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 32px 36px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface-2);
}

.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 8px;
}

.tutorial-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.tutorial-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.65;
}

.tutorial-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.tutorial-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tutorial-badge-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
  stroke: var(--accent);
}

.tutorial-badge-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.tutorial-badge-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tutorial-body {
    display: grid;
    grid-template-columns: 1fr;
}

/* .tutorial-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
} */

.tutorial-steps {
  padding: 32px 36px;
  border-right: 1px solid var(--border);
}

/* ─── Steps ─── */
.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.step-num-success {
  background: var(--success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.step-content {
  flex: 1;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  transition: all var(--transition);
}

.step:hover .step-content {
  border-color: var(--accent-border);
  background: var(--accent-light);
}

.step-success .step-content {
  border-color: var(--success-border);
  background: var(--success-light);
  color: var(--success-text);
}

.step-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.link:hover { color: var(--accent-hover); }
.link svg { width: 12px; height: 12px; }

/* ─── Format Pills ─── */
.format-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.format-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.format-pill-accent {
  background: var(--danger-light);
  border-color: var(--danger-border);
}

.format-pill-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.format-pill-accent .format-pill-label { color: var(--danger); }

.format-pill-value {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.format-pill-accent .format-pill-value { color: var(--danger-text); }

/* ─── Tips ─── */
.tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: all var(--transition);
}

.tip:hover { box-shadow: var(--shadow-sm); }

.tip-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tip-icon svg { width: 18px; height: 18px; }

.tip-icon-warn {
  background: var(--warn-light);
  border: 1px solid var(--warn-border);
}

.tip-icon-warn svg { color: var(--warn-icon); stroke: var(--warn-icon); }

.tip-icon-danger {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
}

.tip-icon-danger svg { color: var(--danger); stroke: var(--danger); }

.tip-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.tip-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Slideshow ─── */
.tutorial-slides-wrap {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
}

.slides-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.slides-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.slides-zoom-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
}

.slides-zoom-hint svg { width: 13px; height: 13px; }

.slideshow {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface-2);
  aspect-ratio: 4 / 3;
  flex: 1;
}

.slides-container {
  width: 100%;
  height: 100%;
}

.slide {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
}

.slide.active-slide {
  display: flex;
  animation: slideAppear 0.35s ease;
}

.slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform var(--transition-slow);
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 2;
}

.slide:hover .slide-overlay { background: rgba(0, 0, 0, 0.25); }

.slide-zoom-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: all var(--transition);
}

.slide:hover .slide-zoom-icon { opacity: 1; transform: scale(1); }
.slide-zoom-icon svg { width: 22px; height: 22px; color: #fff; stroke: #fff; }
.slide:hover img { transform: scale(1.04); }

.slide-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  z-index: 10;
}

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: all var(--transition);
}

.slide-nav:hover { background: #fff; color: #000; }
.slide-nav svg { width: 18px; height: 18px; }
.slide-prev { left: 12px; }
.slide-next { right: 12px; }

.slide-dots {
  position: absolute;
  bottom: 14px;
  right: 16px;
  display: flex;
  gap: 5px;
  z-index: 10;
}

.slide-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.slide-dot.active { background: #fff; width: 18px; }

/* ─── Modal ─── */
#imageModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 10, 25, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#imageModal.open { display: flex; }

.modal-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modalImg {
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.2s ease;
}

.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  cursor: pointer;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.2); }
.modal-close svg { width: 20px; height: 20px; }

/* ─── Footer ─── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 60px;
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-text strong { color: var(--text-primary); }

.footer-privacy {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-icon {
  width: 15px;
  height: 15px;
  color: var(--danger);
  stroke: var(--danger);
  flex-shrink: 0;
}

.footer-privacy .footer-icon {
  color: var(--success);
  stroke: var(--success);
}

/* ─── Tutorial FAB ─── */
.tutorial-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-accent);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  animation: fabFloat 3s ease-in-out infinite;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background var(--transition);
}

.tutorial-fab:hover {
  background: var(--accent-hover);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.tutorial-fab:active { transform: scale(0.96); }

.tutorial-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.tutorial-fab.hidden-fab {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (min-width: 2560px) {
  .container { max-width: 1400px; }
  .hero-title { font-size: 4.5rem; }
}

@media (min-width: 1920px) {
  .container { max-width: 1280px; }
}

@media (min-width: 1600px) {
  :root { --header-h: 72px; }
  .card-body { padding: 36px 40px 44px; }
}

@media (max-width: 1280px) {
  .tutorial-body { grid-template-columns: 1fr; }
  .tutorial-steps { border-right: none; border-bottom: 1px solid var(--border); }
  .slideshow { aspect-ratio: 16 / 9; }
}

@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .hero { padding: 48px 0 16px; }
  .hero-break { display: block; }
  .tutorial-header { flex-direction: column; padding: 24px 28px; }
  .tutorial-badge { align-self: flex-start; }
  .tutorial-steps { padding: 28px; }
  .tutorial-slides-wrap { padding: 24px; }
  .card-body { padding: 24px; }
}

@media (max-width: 820px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .manual-grid { grid-template-columns: 1fr; }
  .results-list { grid-template-columns: 1fr 1fr; }
  .tutorial-header { padding: 20px; }
  .tutorial-steps { padding: 20px; }
  .tutorial-slides-wrap { padding: 20px; }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }

  .container { padding: 0 16px; }
  .hero { padding: 36px 0 12px; }
  .hero-title { font-size: 1.9rem; }
  .hero-subtitle { font-size: 0.9rem; }
  .hero-badge { font-size: 0.75rem; padding: 5px 12px; }

  .section { margin: 28px 0; }
  .card-body { padding: 20px; }

  .tab-btn {
    font-size: 0.75rem;
    padding: 14px 8px;
    gap: 5px;
  }

  .tab-btn svg { width: 14px; height: 14px; }
  .tab-count { display: none; }
  .tooltip-wrap::after, .tooltip-wrap::before { display: none; }

  .format-pills { flex-direction: column; gap: 6px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 18px 14px; }
  .results-list { grid-template-columns: 1fr; }
  .results-list-wrap { padding: 14px 16px; max-height: 420px; }
  .search-bar { padding: 12px 16px; }
  .search-input { max-width: 100%; padding-left: 40px; }

  .tutorial-card { border-radius: var(--radius-lg); }
  .tutorial-header { padding: 18px; gap: 16px; }
  .tutorial-title { font-size: 1.2rem; }
  .tutorial-steps { padding: 18px; }
  .tutorial-slides-wrap { padding: 18px; }

  .step { gap: 10px; }
  .step-num { width: 32px; height: 32px; font-size: 0.78rem; }
  .step-content { font-size: 0.8rem; padding: 10px 12px; }

  .slides-zoom-hint { display: none; }
  .slide-dots { display: none; }

  .slide-zoom-icon { opacity: 1; transform: scale(1); background: rgba(0, 0, 0, 0.5); }
  .slide-overlay { background: rgba(0, 0, 0, 0.08); }
  .slide:hover img { transform: none; }

  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }

  .action-row { flex-direction: column; }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .tutorial-fab {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    padding: 0;
    justify-content: center;
  }

  .tutorial-fab span { display: none; }
  .tutorial-fab svg { width: 22px; height: 22px; }

  .lang-label { padding: 5px 9px; font-size: 0.68rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .brand-name { font-size: 1.1rem; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 1.6rem; }
  .stat-card { padding: 14px 10px; }

  .tab-btn span:not(.tab-count) { font-size: 0.7rem; }

  .dropzone { padding: 28px 16px; }
  .dropzone-sm { padding: 18px 14px; }
  .import-title { font-size: 1.1rem; }

  .step-num { width: 28px; height: 28px; font-size: 0.72rem; border-radius: 8px; }
  .steps-list { gap: 10px; }

  #imageModal { padding: 12px; }
  #modalImg { max-height: 80vh; border-radius: var(--radius-md); }
  .modal-close { top: 12px; right: 12px; width: 38px; height: 38px; }

  .slide-nav { width: 34px; height: 34px; }
  .slide-nav svg { width: 16px; height: 16px; }
  .slide-prev { left: 8px; }
  .slide-next { right: 8px; }
  .slide-counter { font-size: 0.65rem; padding: 4px 10px; }
}

@media (max-width: 390px) {
  .header-inner { gap: 8px; }
  .brand-name { font-size: 1rem; }
  .lang-label { padding: 4px 8px; }
}

@media (max-width: 360px) {
  .container { padding: 0 12px; }
  .hero-title { font-size: 1.4rem; }
  .hero-badge { font-size: 0.7rem; }
  .brand-icon { width: 34px; height: 34px; }
  .brand-icon svg { width: 16px; height: 16px; }
  .tab-btn svg { display: none; }
  .card-body { padding: 14px; }
  .manual-card { padding: 16px; }
  .tips { gap: 8px; }
}

@media (max-width: 320px) {
  .hero { padding: 24px 0 8px; }
  .hero-badge { display: none; }
  .tutorial-badge { display: none; }
}
