/* ═══════════════════════════════════════════════════════════════════════════
  DocaCanvas Studio — Professional Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
  CSS Variables – LIGHT as DEFAULT
  ───────────────────────────────────────────────────────────────────────────── */
:root {
  --bg:        #f8faff;
  --bg-2:      #ffffff;
  --bg-3:      #f1f5f9;
  --bg-card:   #ffffff;
  --border:    rgba(0,0,0,0.08);
  --border-h:  rgba(0,0,0,0.16);
  --text:      #0f172a;
  --text-2:    #475569;
  --text-3:    #94a3b8;
  --primary:   #6c63ff;
  --primary-h: #7c75ff;
  --accent:    #f43f5e;
  --success:   #10b981;
  --warning:   #f59e0b;
  --gradient:  linear-gradient(135deg, #6c63ff 0%, #f43f5e 100%);
  --gradient2: linear-gradient(135deg, #06b6d4, #6c63ff);
  --radius:    12px;
  --radius-lg: 20px;
  --shadow:    0 4px 24px rgba(0,0,0,0.08);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.1);
  --font:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-2:    'Space Grotesk', sans-serif;
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
  --header-h:  72px;
  --glow-primary: rgba(108,99,255,0.28);
}

/* Dark theme override */
[data-theme="dark"] {
  --bg:        #0a0f1e;
  --bg-2:      #111827;
  --bg-3:      #1e293b;
  --bg-card:   #131c2e;
  --border:    rgba(255,255,255,0.08);
  --border-h:  rgba(255,255,255,0.16);
  --text:      #f1f5f9;
  --text-2:    #94a3b8;
  --text-3:    #64748b;
  --shadow:    0 4px 24px rgba(0,0,0,0.3);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);
}

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 260;
  width: 0%;
  height: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #22d3ee 0%, #6c63ff 45%, #f43f5e 100%);
  box-shadow: 0 0 14px rgba(108, 99, 255, 0.55);
  transition: width 0.08s linear;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
textarea, input { font-family: inherit; }
ul { list-style: none; }

/* ── Particles ─────────────────────────────────────────────────────────── */
#particles {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
#particles::before, #particles::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: floatOrb 12s ease-in-out infinite alternate;
}
#particles::before {
  width: 600px; height: 600px;
  background: var(--primary);
  top: -200px; left: -100px;
}
#particles::after {
  width: 500px; height: 500px;
  background: #f43f5e;
  bottom: -150px; right: -100px;
  animation-delay: -6s;
}
@keyframes floatOrb {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(60px,40px) scale(1.1); }
}

/* ── Container ─────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative; z-index: 1;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
.gradient-text {
  background: var(--gradient);
  background-size: 180% 180%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease-in-out infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.accent { color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem; border-radius: var(--radius);
  font-size: 0.9375rem; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn--primary {
  position: relative;
  overflow: hidden;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,99,255,0.35);
}
.btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -140%;
  width: 120%;
  height: 100%;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.32) 45%, transparent 100%);
  transition: left 0.5s ease;
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.5);
}
.btn--primary:hover::after { left: 140%; }
.btn--primary:active { transform: translateY(0); }
.btn--outline {
  border: 1.5px solid var(--border-h);
  color: var(--text);
  background: transparent;
}
.btn--outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108,99,255,0.08);
}
.btn--ghost {
  color: var(--text-2);
  background: transparent;
}
.btn--ghost:hover { color: var(--text); background: var(--bg-3); }
.btn--sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn--lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn--full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.btn-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  background: var(--bg-3);
  border: 1px solid var(--border);
  transition: all var(--transition);
  font-size: 0.9rem;
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); }

.btn-back {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--text-2); font-size: 0.875rem; font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-3);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.btn-back:hover { color: var(--text); border-color: var(--border-h); }

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  background: rgba(10,15,30,0.7);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}
[data-theme="light"] .header {
  background: rgba(248,250,255,0.85);
}
.header--scrolled {
  background: rgba(10,15,30,0.92);
  box-shadow: var(--shadow);
}
.header__inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}

/* ── Logo ─────────────────────────────────────────────────────────────── */
.logo {
  display: flex; align-items: center; gap: 0.625rem;
  font-family: var(--font-2);
  font-weight: 700; font-size: 1.375rem;
  letter-spacing: -0.01em;
}
.logo__icon {
  width: 38px; height: 38px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
  box-shadow: 0 4px 12px rgba(108,99,255,0.4);
}
.logo__text { color: var(--text); }
.logo__text .accent { -webkit-text-fill-color: initial; color: var(--primary); }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav__link {
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.9375rem; font-weight: 500;
  transition: all var(--transition);
}
.nav__link:hover { color: var(--text); background: var(--bg-3); }
.nav__link.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-3) 78%, transparent);
  box-shadow: inset 0 -2px 0 0 rgba(108,99,255,0.8);
}

/* ── Header actions ─────────────────────────────────────────────────── */
.header__actions { display: flex; align-items: center; gap: 0.75rem; }
.hamburger { display: none; flex-direction: column; gap: 4px; padding: 4px; }
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-2); border-radius: 2px;
  transition: all var(--transition);
}

/* ── Mobile Nav ─────────────────────────────────────────────────────── */
.mobile-nav {
  position: fixed; top: var(--header-h); left: 0; right: 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  z-index: 99;
  display: flex; flex-direction: column; gap: 0.25rem;
  transform: translateY(-120%);
  transition: transform var(--transition);
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav__link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  color: var(--text-2); font-size: 1rem; font-weight: 500;
  display: block;
}
.mobile-nav__link:hover { background: var(--bg-3); color: var(--text); }
.mobile-nav__link.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--bg-3) 75%, transparent);
  border: 1px solid rgba(108,99,255,0.32);
}

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeUp 0.7s ease forwards; opacity: 0; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.35s; }
.delay-4 { animation-delay: 0.5s; }

/* ── HERO ─────────────────────────────────────────────────────────────── */
.hero {
  padding: calc(var(--header-h) + 80px) 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: auto 50% -220px;
  transform: translateX(-50%);
  width: min(860px, 90vw);
  height: 340px;
  background: radial-gradient(ellipse at center, var(--glow-primary), transparent 72%);
  pointer-events: none;
}
.hero__inner { position: relative; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.3);
  color: #a78bfa;
  border-radius: 100px;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem; font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.14);
  animation: badgeBreathe 3.2s ease-in-out infinite;
}
@keyframes badgeBreathe {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.hero__title {
  font-family: var(--font-2);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  text-shadow: 0 8px 40px rgba(108,99,255,0.18);
}
.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* Search bar */
.hero__search {
  position: relative;
  max-width: 540px;
  margin: 0 auto 2.5rem;
}
.hero__search-icon {
  position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 1rem;
}
.hero__search input {
  width: 100%;
  padding: 1rem 1.5rem 1rem 3rem;
  border-radius: 100px;
  background: color-mix(in srgb, var(--bg-2) 86%, transparent);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-size: 0.9375rem;
  outline: none;
  transition: all var(--transition);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  backdrop-filter: blur(8px);
}
.hero__search input:hover {
  border-color: var(--border-h);
}
.hero__search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108,99,255,0.12), 0 4px 24px rgba(0,0,0,0.2);
}
.hero__search input::placeholder { color: var(--text-3); }

/* Stats */
.hero__stats {
  display: flex; align-items: center; justify-content: center;
  gap: 2rem; flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat__num {
  font-size: 1.75rem; font-weight: 800;
  font-family: var(--font-2);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat__label { font-size: 0.8125rem; color: var(--text-3); margin-top: 0.25rem; font-weight: 500; }
.stat__div { width: 1px; height: 32px; background: var(--border); }

/* Floating badges */
.hero__floaters {
  position: absolute; inset: 0; pointer-events: none;
}
.floater {
  position: absolute;
  padding: 0.375rem 0.875rem;
  border-radius: 8px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  animation: floatBadge 5s ease-in-out infinite;
  border: 1px solid;
}
.floater--pdf  { background:rgba(239,68,68,0.15); border-color:rgba(239,68,68,0.3); color:#f87171;  top:15%; left:5%;  animation-delay:0s; }
.floater--jpg  { background:rgba(249,115,22,0.15); border-color:rgba(249,115,22,0.3); color:#fb923c; top:35%; right:4%; animation-delay:1s; }
.floater--png  { background:rgba(16,185,129,0.15); border-color:rgba(16,185,129,0.3); color:#34d399; top:65%; left:3%;  animation-delay:2s; }
.floater--ocr  { background:rgba(108,99,255,0.15); border-color:rgba(108,99,255,0.3); color:#a78bfa; top:20%; right:6%; animation-delay:0.5s; }
.floater--txt  { background:rgba(6,182,212,0.15); border-color:rgba(6,182,212,0.3); color:#22d3ee;  top:75%; right:5%; animation-delay:1.5s; }
@keyframes floatBadge {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

/* ── Section Headers ─────────────────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-title {
  font-family: var(--font-2);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.section-subtitle { color: var(--text-2); font-size: 1.0625rem; }

/* ── TOOLS SECTION ─────────────────────────────────────────────────── */
.tools-section { padding: 80px 0; }

/* Category tabs */
.category-tabs {
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding: 0.375rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  width: fit-content; max-width: 100%;
}
.tab {
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  font-size: 0.875rem; font-weight: 600;
  color: var(--text-2);
  transition: all var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108,99,255,0.3);
}

/* Tool grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative; overflow: hidden;
  transform-style: preserve-3d;
}
.tool-card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}
.tool-card::after {
  content: '';
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--transition);
}
.tool-card:hover {
  transform: translateY(-6px);
  border-color: rgba(108,99,255,0.36);
  box-shadow: 0 14px 34px rgba(4,8,20,0.44), 0 0 0 1px rgba(108,99,255,0.14);
}
.tool-card:hover::before { opacity: 0.04; }
.tool-card:hover::after { transform: scaleX(1); }
.tool-card.hidden { display: none; }

.tool-card__icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.375rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  position: relative; z-index: 1;
  transition: transform var(--transition), box-shadow var(--transition);
}
.tool-card:hover .tool-card__icon {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}
.tool-card h3 {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 0.375rem;
  position: relative; z-index: 1;
}
.tool-card p {
  font-size: 0.8125rem; color: var(--text-2);
  line-height: 1.5;
  position: relative; z-index: 1;
}
.tool-card__tag {
  margin-top: 1rem;
  display: inline-block;
  padding: 0.2rem 0.625rem;
  border-radius: 100px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
  background: var(--bg-3);
  color: var(--text-3);
  border: 1px solid var(--border);
  position: relative; z-index: 1;
}

.no-results {
  text-align: center; padding: 4rem 2rem; color: var(--text-2);
}
.no-results i { font-size: 3rem; margin-bottom: 1rem; color: var(--text-3); display: block; }

/* ── FEATURES SECTION ─────────────────────────────────────────────────── */
.features-section {
  padding: 80px 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--border-h); }
.feature-card__icon {
  width: 48px; height: 48px;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; color: var(--primary);
  margin-bottom: 1rem;
}
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; }

/* ── HOW IT WORKS ─────────────────────────────────────────────────────── */
.how-section { padding: 80px 0; }
.steps-grid {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; flex-wrap: wrap;
}
.step {
  flex: 1; min-width: 200px; max-width: 260px;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
}
.step:hover { transform: translateY(-4px); border-color: var(--primary); }
.step__num {
  font-family: var(--font-2); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em;
  color: var(--primary); margin-bottom: 0.75rem;
}
.step__icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  background: var(--gradient);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  box-shadow: 0 8px 24px rgba(108,99,255,0.3);
}
.step h3 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem; }
.step p { font-size: 0.875rem; color: var(--text-2); line-height: 1.6; }
.step__arrow {
  font-size: 1.25rem; color: var(--text-3);
  flex-shrink: 0;
}

/* ── CTA ─────────────────────────────────────────────────────────────── */
.cta-section { padding: 80px 0; }
.cta-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.cta-box:hover {
  transform: translateY(-4px);
  border-color: rgba(108,99,255,0.35);
  box-shadow: 0 16px 40px rgba(7, 12, 28, 0.38);
}
.cta-box__glow {
  position: absolute; top: -150px; left: 50%; transform: translateX(-50%);
  width: 500px; height: 300px;
  background: radial-gradient(ellipse at center, rgba(108,99,255,0.2), transparent 70%);
  pointer-events: none;
  animation: ctaGlowPulse 4.5s ease-in-out infinite;
}
@keyframes ctaGlowPulse {
  0%, 100% { opacity: 0.75; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}
.cta-box h2 {
  font-family: var(--font-2); font-size: clamp(1.75rem,4vw,2.5rem);
  font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.75rem;
  position: relative;
}
.cta-box p { color: var(--text-2); font-size: 1.0625rem; margin-bottom: 2rem; position: relative; }

/* ── FOOTER ─────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer__copy { color: var(--text-3); font-size: 0.875rem; }
.footer__socials { color: var(--text-2); font-size: 0.875rem; }
.footer__socials a {
  position: relative;
  color: var(--text-2);
  transition: color var(--transition);
}
.footer__socials a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--gradient);
  transition: transform var(--transition);
}
.footer__socials a:hover {
  color: var(--text);
}
.footer__socials a:hover::after {
  transform: scaleX(1);
}

/* ═══════════════════════════════════════ TOOL PAGE ══════════════════════ */
.tool-page {
  min-height: 100vh;
  padding-top: var(--header-h);
}
.tool-page__header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  display: flex; align-items: center; gap: 1.5rem;
  flex-wrap: wrap; gap: 1rem;
}
.tool-page__title {
  display: flex; align-items: center; gap: 1rem;
}
.tool-page__icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
  flex-shrink: 0;
}
.tool-page__title h1 { font-size: 1.375rem; font-weight: 700; }
.tool-page__title p { color: var(--text-2); font-size: 0.875rem; }

/* Workspace layout */
.tool-workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - var(--header-h) - 80px);
}

/* Options panel */
.options-panel {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.options-panel__title {
  font-size: 0.875rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-2); text-transform: uppercase;
  display: flex; align-items: center; gap: 0.5rem;
}

/* Form elements in options */
.option-group { display: flex; flex-direction: column; gap: 0.5rem; }
.option-group label {
  font-size: 0.8125rem; font-weight: 600; color: var(--text-2);
}
.option-group select,
.option-group input[type="text"],
.option-group input[type="number"],
.option-group textarea {
  width: 100%; padding: 0.625rem 0.875rem;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-size: 0.875rem;
  outline: none; transition: border-color var(--transition);
}
.option-group select:focus,
.option-group input:focus,
.option-group textarea:focus {
  border-color: var(--primary);
}
.option-group select option { background: var(--bg-3); }
.option-group input[type="range"] { accent-color: var(--primary); }

.option-divider {
  height: 1px; background: var(--border);
}

/* Workspace main */
.workspace-main {
  padding: 2rem;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 1.5rem;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  background: var(--bg-2);
  overflow: hidden;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(108,99,255,0.04);
}
.upload-zone.drag-over { border-style: solid; }
.upload-zone__inner {
  padding: 3.5rem 2rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.upload-zone__icon {
  width: 80px; height: 80px;
  background: rgba(108,99,255,0.08);
  border: 1.5px solid rgba(108,99,255,0.2);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--primary);
  margin-bottom: 0.5rem;
  animation: pulseIcon 3s ease-in-out infinite;
}
@keyframes pulseIcon {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108,99,255,0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(108,99,255,0); }
}
.upload-zone h3 { font-size: 1.125rem; font-weight: 700; }
#uploadHint { color: var(--text-2); font-size: 0.875rem; }

/* File list */
.file-list {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.file-list__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.file-list__header h3 {
  font-size: 0.9375rem; font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text-2);
}

.file-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--bg-3); }
.file-item__icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; flex-shrink: 0;
}
.file-item__icon.pdf  { background:rgba(239,68,68,0.12); color:#f87171; }
.file-item__icon.img  { background:rgba(16,185,129,0.12); color:#34d399; }
.file-item__icon.doc  { background:rgba(59,130,246,0.12); color:#60a5fa; }
.file-item__icon.other{ background:rgba(100,116,139,0.12); color:#94a3b8; }
.file-item__info { flex: 1; min-width: 0; }
.file-item__name {
  font-size: 0.875rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-item__size { font-size: 0.75rem; color: var(--text-3); }
.file-item__remove {
  color: var(--text-3); font-size: 0.875rem;
  padding: 0.25rem; border-radius: 4px;
  transition: all var(--transition);
}
.file-item__remove:hover { color: var(--accent); background: rgba(244,63,94,0.1); }

/* Progress box */
.progress-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
}
.progress-box__status {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 600; font-size: 1.0625rem;
}
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar-wrap {
  height: 8px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.progress-bar {
  height: 100%;
  background: var(--gradient);
  border-radius: 100px;
  width: 0%;
  transition: width 0.4s ease;
}
.progress-detail { color: var(--text-2); font-size: 0.8125rem; }

/* Result box */
.result-box {
  background: var(--bg-2);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}
.result-box__success { text-align: center; }
.result-box__check {
  width: 64px; height: 64px;
  background: rgba(16,185,129,0.12);
  border: 2px solid rgba(16,185,129,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--success);
  margin: 0 auto 1rem;
  animation: scaleIn 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes scaleIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
.result-box__success h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.result-box__success p { color: var(--text-2); font-size: 0.875rem; }

/* Text result */
.text-result { background: var(--bg-3); border-radius: var(--radius); padding: 1.25rem; }
.text-result__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.875rem;
}
.text-result__header h4 { font-size: 0.875rem; font-weight: 700; color: var(--text-2); }
.text-result__actions { display: flex; gap: 0.5rem; }
#ocrResultText {
  width: 100%; height: 200px; resize: vertical;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); font-size: 0.875rem;
  padding: 0.875rem; line-height: 1.7;
  outline: none;
}

/* Translation panels */
.translation-panels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: start;
}
.translation-panel {
  background: var(--bg-3); border-radius: var(--radius); padding: 1rem;
}
.translation-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem; font-weight: 700; color: var(--text-2);
}
.translation-panel textarea {
  width: 100%; height: 200px; resize: vertical;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 0.875rem; padding: 0.75rem; line-height: 1.7;
  outline: none;
}
.translation-divider {
  display: flex; align-items: center; justify-content: center;
  padding-top: 2rem;
  color: var(--text-3); font-size: 1rem;
}
.translation-actions { text-align: center; }

/* ── PDF Translation Result (format-preserved) ─────────────────────────── */
.pdf-translation-result {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-3);
  margin-bottom: 1rem;
}
.pdf-translation-result__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  flex-wrap: wrap;
}
.pdf-translation-result__info {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.pdf-translation-result__info > i {
  font-size: 2rem;
  color: #ef4444;
  flex-shrink: 0;
}
.pdf-translation-result__info h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.125rem;
}
.pdf-translation-result__info p {
  font-size: 0.8125rem;
  color: var(--text-2);
}
.pdf-translation-result__actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.pdf-preview-wrap {
  width: 100%;
  background: #525659;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.pdf-preview-frame {
  width: 100%;
  height: 620px;
  border: none;
  display: block;
}
@media (max-width: 600px) {
  .pdf-preview-frame { height: 380px; }
  .pdf-translation-result__header { flex-direction: column; align-items: flex-start; }
}

/* Preview gallery */
#galleryItems {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.gallery-item {
  background: var(--bg-3); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  transition: all var(--transition);
}
.gallery-item:hover { transform: translateY(-2px); border-color: var(--border-h); }
.gallery-item img { width: 100%; height: 140px; object-fit: cover; display: block; }
.gallery-item__footer {
  padding: 0.625rem;
  display: flex; align-items: center; justify-content: space-between;
}
.gallery-item__name { font-size: 0.75rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.gallery-item__dl {
  color: var(--primary); font-size: 0.9rem;
  padding: 0.25rem; margin-left: 0.25rem;
  border-radius: 4px; flex-shrink: 0;
}
.gallery-item__dl:hover { background: rgba(108,99,255,0.12); }

/* Result actions */
.result-actions {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center;
}

/* ── TOAST ─────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 2rem; right: 2rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  min-width: 280px; max-width: 380px;
  animation: slideInToast 0.3s ease;
  font-size: 0.9rem; font-weight: 500;
}
@keyframes slideInToast {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error   { border-color: rgba(244,63,94,0.4); }
.toast.warning { border-color: rgba(245,158,11,0.4); }
.toast.info    { border-color: rgba(108,99,255,0.4); }
.toast__icon { font-size: 1.1rem; flex-shrink: 0; }
.toast.success .toast__icon { color: var(--success); }
.toast.error   .toast__icon { color: var(--accent); }
.toast.warning .toast__icon { color: var(--warning); }
.toast.info    .toast__icon { color: var(--primary); }
.toast__msg { flex: 1; line-height: 1.4; }
.toast__close {
  color: var(--text-3); font-size: 0.875rem;
  padding: 0.125rem; border-radius: 4px;
  transition: color var(--transition);
}
.toast__close:hover { color: var(--text); }
.toast.dismiss { animation: slideOutToast 0.25s ease forwards; }
@keyframes slideOutToast {
  to { opacity: 0; transform: translateX(110%); }
}

/* ── API status badge ─────────────────────────────────────────────────── */
.api-status-badge {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  right: 16px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.api-status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
.api-status-badge.checking {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}
.api-status-badge.checking::before {
  background: #38bdf8;
}
.api-status-badge.connected {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
}
.api-status-badge.connected::before {
  background: #34d399;
}
.api-status-badge.fallback {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}
.api-status-badge.fallback::before {
  background: #fbbf24;
}
.api-status-badge.disconnected {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}
.api-status-badge.disconnected::before {
  background: #f87171;
}

.api-status-tooltip {
  position: fixed;
  top: calc(var(--header-h) + 50px);
  right: 16px;
  z-index: 151;
  min-width: 230px;
  max-width: min(80vw, 420px);
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border-h);
  background: var(--bg-2);
  box-shadow: var(--shadow-card);
}
.api-status-tooltip__label {
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 0.375rem;
}
.api-status-tooltip__value {
  font-size: 0.8125rem;
  color: var(--text);
  word-break: break-all;
  margin-bottom: 0.625rem;
}
.api-status-tooltip__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.625rem;
  border-radius: 8px;
  border: 1px solid var(--border-h);
  background: var(--bg-3);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 700;
}
.api-status-tooltip__copy:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Utilities ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-h); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav { display: none; }
  .hamburger { display: flex; }
  .tool-workspace {
    grid-template-columns: 1fr;
  }
  .options-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .translation-panels {
    grid-template-columns: 1fr;
  }
  .translation-divider { padding: 0; transform: rotate(90deg); }
  .hero__floaters { display: none; }
}
@media (max-width: 600px) {
  .hero__stats { gap: 1rem; }
  .stat__div { display: none; }
  .steps-grid { flex-direction: column; }
  .step__arrow { transform: rotate(90deg); }
  .categories-tabs { justify-content: flex-start; overflow-x: auto; padding-bottom: 0.25rem; }
  .workspace-main { padding: 1rem; }
  .header__actions .btn--primary span { display: none; }
  .footer__inner { flex-direction: column; text-align: center; }
}

/* ── LANGUAGE SELECTOR ──────────────────────────────────────────────────── */
.lang-search {
  position: relative;
}
.lang-search input {
  padding-left: 2.5rem !important;
}
.lang-search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 0.875rem; pointer-events: none;
}

/* ── Page number options ─────────────────────────────────────────────── */
.checkbox-row {
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  accent-color: var(--primary); width: 16px; height: 16px;
}
.checkbox-row span { font-size: 0.875rem; color: var(--text); }

/* ── Quality slider output ─────────────────────────────────────────── */
.range-row {
  display: flex; align-items: center; gap: 0.75rem;
}
.range-row input { flex: 1; }
.range-val {
  font-size: 0.875rem; font-weight: 700; color: var(--primary);
  min-width: 2.5rem; text-align: right;
}

/* ── Colour picker ─────────────────────────────────────────────────── */
.color-row { display: flex; align-items: center; gap: 0.75rem; }
.color-row input[type="color"] {
  width: 40px; height: 36px; padding: 2px;
  background: var(--bg-3); border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  transition: all var(--transition);
}
.color-row input[type="color"]:hover {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(108,99,255,0.24);
}

/* ── Image OCR language select ─────────────────────────────────────── */
.ocr-lang-select select { max-height: 200px; }

/* ═════════════════════════════════════════════════════════════════════════
   ENHANCED HOVER EFFECTS & INTERACTIVE ELEMENTS
   ═════════════════════════════════════════════════════════════════════════ */

/* Enhanced button hover effects */
.btn { position: relative; }
.btn:not(:disabled):active { transform: scale(0.98); }

/* Primary button enhanced effects */
.btn--primary::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(255,255,255,0.4) 0%, transparent 80%);
  opacity: 0;
  border-radius: var(--radius);
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.btn--primary:hover::before { opacity: 1; }

/* Outline button enhanced effects */
.btn--outline {
  position: relative;
}
.btn--outline::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--gradient);
  opacity: 0;
  border-radius: var(--radius);
  transition: opacity var(--transition);
  pointer-events: none;
}
.btn--outline:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108,99,255,0.18);
}
.btn--outline:hover::before { opacity: 0.06; }

/* Icon button glow effect */
.btn-icon {
  position: relative;
}
.btn-icon::after {
  content: '';
  position: absolute; inset: -4px;
  background: var(--primary);
  opacity: 0;
  border-radius: 50%;
  z-index: -1;
  transition: all var(--transition);
  filter: blur(8px);
}
.btn-icon:hover::after { opacity: 0.1; }
.btn-icon:hover { 
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(108,99,255,0.2);
}

/* Input field enhanced hover/focus */
.option-group input:not([type="range"]):not([type="color"]),
.option-group select,
.option-group textarea {
  position: relative;
  transition: all var(--transition);
}
.option-group input:not([type="range"]):not([type="color"]):hover,
.option-group select:hover,
.option-group textarea:hover {
  border-color: rgba(108,99,255,0.32);
  background: var(--bg-3);
}
.option-group input:not([type="range"]):not([type="color"]):focus,
.option-group select:focus,
.option-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(108,99,255,0.08),
              inset 0 0 0 1px var(--primary);
}

/* File item hover enhancement */
.file-item {
  position: relative;
}
.file-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: 2px;
}
.file-item:hover::before { opacity: 1; }
.file-item:hover {
  background: var(--bg-3);
  transform: translateX(4px);
  box-shadow: inset 0 0 12px rgba(108,99,255,0.04);
}

/* ════════════════════════════════════════════════════════════════════════
   LIVE PREVIEW PANEL
   ════════════════════════════════════════════════════════════════════════ */
.preview-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  animation: fadeIn 0.3s ease-out;
}

.preview-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.preview-panel__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.preview-panel__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-panel__controls .btn-icon {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.preview-panel__content {
  flex: 1;
  overflow: auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  position: relative;
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
}

.preview-panel__empty {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-3);
}

.preview-panel__empty i {
  font-size: 2.5rem;
  opacity: 0.4;
}

.preview-panel__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.preview-panel__pdf {
  width: 100%;
  height: 100%;
}

.preview-panel__text {
  width: 100%;
  max-height: 100%;
  overflow: auto;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  background: var(--bg);
  padding: 1rem;
  border-radius: 6px;
}

.preview-panel__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.preview-stat {
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.preview-stat:hover {
  border-color: var(--primary);
  background: rgba(108,99,255,0.04);
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────────────────────────
   Preview Toolbar & Editing Tools
   ───────────────────────────────────────────────────────────────────────── */

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-wrap: wrap;
}

.preview-toolbar.hidden {
  display: none;
}

.toolbar-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.75rem;
  border-right: 1px solid var(--border);
}

.toolbar-section:last-child {
  border-right: none;
  padding-right: 0;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(108,99,255,0.2);
}

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

.toolbar-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.editor-props-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
}

.editor-props-panel.hidden {
  display: none;
}

.editor-props__row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.editor-props__row--inline {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0.75rem;
}

.editor-props__row label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
}

.editor-props-panel input,
.editor-props-panel select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  color: var(--text);
  font-size: 0.8125rem;
}

.editor-adjust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.5rem;
}

.editor-props__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.editor-stage-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.editor-stage-canvas {
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
  max-width: 100%;
  height: auto;
  background: #fff;
}

.preview-stat__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.preview-stat__value {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--primary);
}

/* Animation for preview appearance */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive preview */
@media (max-width: 900px) {
  .preview-panel {
    min-height: 300px;
  }
  
  .preview-panel__content {
    padding: 1rem;
  }

  .editor-props__row--inline,
  .editor-adjust-grid {
    grid-template-columns: 1fr;
  }
}

/* ═════════════════════════════════════════════════════════════════════════
   PREVIEW EDIT MODE & INTERACTIVE CONTROLS
   ═════════════════════════════════════════════════════════════════════════ */

.preview-edit-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 10;
  border-radius: 8px;
}

.preview-panel__content:hover .preview-edit-overlay {
  opacity: 1;
}

.preview-edit-controls {
  display: flex;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  padding: 1rem;
  border-radius: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.preview-edit-controls .btn-icon {
  width: 40px;
  height: 40px;
  background: rgba(108, 99, 255, 0.2);
  border: 1px solid rgba(108, 99, 255, 0.4);
  transition: all var(--transition);
}

.preview-edit-controls .btn-icon:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.3);
}

.preview-edit-hint {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--text-3);
  pointer-events: none;
  animation: fadeIn 0.3s ease-out;
}

.pdf-page-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  padding: 1rem;
  background: var(--bg-3);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.pdf-page-nav input {
  width: 60px;
  text-align: center;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text);
}

.pdf-page-nav button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--transition);
}

.pdf-page-nav button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pdf-page-info {
  font-size: 0.8125rem;
  color: var(--text-2);
}

/* Loading skeleton for preview */
.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 300px;
}

.preview-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────────────────────────────────
   Editing Panels for PDF & Image Preview
   ───────────────────────────────────────────────────────────────────────── */

.editing-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 100;
  animation: slideUp 0.3s ease-out;
  max-width: 400px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.editing-panel__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editing-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.875rem;
}

.editing-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
}

.editing-group input,
.editing-group textarea,
.editing-group select {
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--transition);
}

.editing-group input:focus,
.editing-group textarea:focus,
.editing-group select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-2);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.drawing-canvas {
  border: 2px dashed var(--primary);
  border-radius: 4px;
  opacity: 0.9;
}

/* Visitor Counter */
.visitor-counter {
  text-align: center;
  padding: 1rem;
  background: var(--bg-3);
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-3);
}

.visitor-counter strong {
  color: var(--primary);
  font-weight: 600;
}

/* Google Ads Container */
.ad-container {
  padding: 1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  text-align: center;
}
