/* ===================================================================
   AllDocPDF — style.css
   =================================================================== */

/* Light mode (default) */
:root {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F8FC;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FAFBFF;
  --border-color: #E8ECF4;
  --text-primary: #1A1A2E;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --brand-primary: #F5A623;
  --brand-hover: #E8940F;
  --brand-dark: #1A1A2E;
  --brand-success: #48BB78;
  --brand-danger: #FC8181;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --header-h: 64px;
  --sidebar-w: 264px;
  --radius: 12px;
}

/* Dark mode */
body.dark-mode {
  --bg-primary: #0D1117;
  --bg-secondary: #161B22;
  --bg-card: #1C2333;
  --bg-sidebar: #161B22;
  --border-color: #30363D;
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --text-muted: #6E7681;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.5);
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  font-family: "Inter", "Noto Sans Devanagari", system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}
body.lang-hi, body.lang-hi button, body.lang-hi input, body.lang-hi select {
  font-family: "Noto Sans Devanagari", "Inter", system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; }

/* ---------- Logo ---------- */
.site-logo { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #F5A623 0%, #E8940F 100%);
  color: #1A1A2E; font-size: 20px; font-weight: 900; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -1px; box-shadow: 0 2px 12px rgba(245,166,35,0.4); flex-shrink: 0;
}
.logo-mark.sm { width: 24px; height: 24px; font-size: 13px; border-radius: 5px; box-shadow: none; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.5px; }
.logo-pdf, .logo-accent {
  color: var(--brand-primary);
  background: linear-gradient(135deg, #F5A623 0%, #E8940F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.site-logo:hover .logo-mark { filter: brightness(1.08); }
.logo-mark { transition: filter 0.2s ease; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 100;
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  background: var(--bg-card); border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.header-left { display: flex; align-items: center; gap: 24px; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.site-logo { flex-shrink: 0; }

.mega-wrap { position: relative; }
.mega-trigger {
  padding: 8px 14px; border-radius: 8px; font-weight: 600; color: var(--text-primary);
  transition: background 0.2s ease, color 0.2s ease;
}
.mega-trigger:hover { background: var(--brand-primary); color: var(--brand-dark); }
.mega-menu {
  position: absolute; top: calc(100% + 12px); left: 0; display: none;
  grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 18px 26px; padding: 22px 26px;
  width: min(900px, 92vw); background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--radius); box-shadow: var(--shadow-hover);
}
.mega-menu.open { display: grid; }
.mega-col h4 { color: var(--brand-primary); font-size: 12px; letter-spacing: 0.06em; margin-bottom: 8px; }
.mega-col a { display: block; padding: 6px; border-radius: 6px; font-size: 15px; color: var(--text-primary); transition: background 0.15s ease, color 0.15s ease; }
.mega-col a:hover { background: var(--bg-secondary); color: var(--brand-primary); }

/* ---------- Navbar & dropdowns ---------- */
.main-nav {
  display: flex; align-items: center; justify-content: flex-start;
  flex-wrap: nowrap; gap: 6px; min-width: 0;
}
.nav-item {
  display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 8px;
  font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--text-primary); cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--brand-primary); color: var(--brand-dark); }

.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 8px;
  font-weight: 600; font-size: 14px; color: var(--text-primary); cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-trigger:hover { background: var(--brand-primary); color: var(--brand-dark); }

/* Base dropdown panel — scoped away from the mega menu so its grid layout is untouched */
.nav-dropdown-menu:not(.mega-menu) {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; display: none;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius);
  box-shadow: var(--shadow-hover); padding: 8px; z-index: 200;
  max-height: 70vh; overflow-y: auto;
}
/* Show/hide via .open on the menu itself or on the wrapper (mega keeps its grid display) */
.nav-dropdown-menu.open:not(.mega-menu),
.nav-dropdown.open .nav-dropdown-menu:not(.mega-menu) { display: block; }
.nav-dropdown.open .mega-menu { display: grid; }

/* Bulletproof default-hidden dropdown panels. id-level selectors guarantee the
   injected items (JPG to PDF, Word to PDF, ...) stay strictly inside the
   absolutely-positioned panel and never leak inline into the navbar, regardless
   of class specificity or stale CSS. Reveal on .open (click via JS) or hover. */
#convertMenu { display: none; position: absolute; top: calc(100% + 8px); left: 0; }
#megaMenu { display: none; }
#convertMenu.open { display: block; }
#megaMenu.open { display: grid; }
.nav-dropdown[data-dropdown="convert"]:hover > #convertMenu { display: block; }
.mega-wrap[data-dropdown="all"]:hover > #megaMenu { display: grid; }

.nav-dropdown-menu:not(.mega-menu) a {
  display: block; padding: 8px 10px; border-radius: 6px; font-size: 14px;
  color: var(--text-primary); cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-menu:not(.mega-menu) a:hover { background: var(--bg-secondary); color: var(--brand-primary); }

/* Keyboard focus visibility */
.nav-item:focus-visible,
.nav-dropdown-trigger:focus-visible,
.nav-dropdown-menu a:focus-visible {
  outline: 2px solid var(--brand-primary); outline-offset: 2px;
}

.lang-toggle, .theme-toggle {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-color);
  color: var(--text-primary); font-weight: 600; transition: background 0.2s ease;
}
.lang-toggle:hover, .theme-toggle:hover { background: var(--bg-secondary); }
.lang-toggle .lang-en, .lang-toggle .lang-hi { opacity: 0.5; }
body.lang-en .lang-toggle .lang-en { opacity: 1; color: var(--brand-primary); }
body.lang-hi .lang-toggle .lang-hi { opacity: 1; color: var(--brand-primary); }
.theme-icon-dark, .theme-icon-light { display: none; }
body.dark-mode .theme-icon-light { display: inline; }
body:not(.dark-mode) .theme-icon-dark { display: inline; }

/* ---------- Layout ---------- */
.layout { display: flex; padding-top: var(--header-h); }
.sidebar {
  position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--bg-sidebar); border-right: 1px solid var(--border-color);
  overflow-y: auto; padding: 14px 10px 80px; transition: background 0.2s ease, transform 0.2s ease;
}
.sidebar-search { position: sticky; top: 0; background: var(--bg-sidebar); padding-bottom: 10px; z-index: 1; }
.sidebar-search input {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--bg-secondary); color: var(--text-primary); outline: none;
}
.sidebar-search input:focus { border-color: var(--brand-primary); }
.tool-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-tool-item, .tool-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px;
  color: var(--text-primary); font-size: 15px; cursor: pointer; pointer-events: all;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-tool-item .ti-emoji { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }
.sidebar-tool-item:hover, .tool-item:hover { background: #0F3460; color: #F5A623; }
body:not(.dark-mode) .sidebar-tool-item:hover { background: var(--bg-secondary); }
.sidebar-tool-item.active, .tool-item.active { background: #F5A623; color: #1A1A2E; font-weight: 600; }

.workspace { margin-left: var(--sidebar-w); flex: 1; padding: 28px clamp(16px, 4vw, 48px) 60px; min-width: 0; }

/* ---------- Home ---------- */
.home-view h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.2; }
.home-sub { color: var(--text-secondary); font-size: 17px; margin: 12px 0 26px; max-width: 760px; }
.tool-cards { display: block; }
.tool-cards-inner { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 8px; }
.tool-card {
  background: var(--bg-card); border: 1.5px solid var(--border-color); border-radius: 12px;
  padding: 20px 16px; cursor: pointer; transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-card); display: flex; flex-direction: column; align-items: flex-start;
  gap: 8px; position: relative; overflow: visible; pointer-events: all;
}
.tool-card * { pointer-events: none; }
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%;
  background: var(--brand-primary); transform: scaleY(0); transition: transform 0.2s ease; transform-origin: bottom;
}
.tool-card:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.tool-card:hover::before { transform: scaleY(1); }
.tool-card:active { transform: translateY(-1px); }
.tool-category { font-size: 10px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--brand-primary); }
.tool-icon {
  width: 44px; height: 44px; background: rgba(245,166,35,0.12); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.tool-name { font-size: 15px; font-weight: 600; color: var(--text-primary); line-height: 1.3; }

/* ---------- Tool panel ---------- */
.tool-panel {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius);
  padding: clamp(18px, 3vw, 32px); box-shadow: var(--shadow-card);
}
.panel-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.back-home {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 6px;
  border: 1px solid var(--brand-primary); color: var(--brand-primary); font-weight: 600; font-size: 14px;
  transition: all 0.2s ease;
}
.back-home:hover { background: var(--brand-primary); color: var(--brand-dark); }
.workspace-logo-watermark { display: flex; align-items: center; gap: 8px; opacity: 0.7; }
.workspace-logo-watermark .wm-text { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tool-panel h1 { font-size: clamp(24px, 3vw, 32px); }
.tool-desc { color: var(--text-secondary); font-size: 16px; margin: 8px 0 20px; }

.error-box {
  margin-bottom: 14px; padding: 12px 14px; border-radius: 8px;
  background: rgba(252,129,129,0.12); border: 1px solid var(--brand-danger); color: var(--brand-danger); font-size: 14px;
}

/* ---------- Upload zone ---------- */
.upload-zone {
  border: 2px dashed var(--border-color); border-radius: var(--radius); padding: 40px 20px;
  text-align: center; color: var(--text-secondary); cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}
.upload-zone:hover { border-color: var(--brand-primary); }
.upload-zone.drag-over { border-color: var(--brand-primary); background: rgba(245,166,35,0.08); transform: scale(1.01); }
.upload-icon { font-size: 42px; margin-bottom: 8px; }
.upload-text { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.upload-sub { font-size: 14px; margin-top: 4px; color: var(--text-muted); }
.upload-link { color: var(--brand-primary); font-weight: 600; }

/* ---------- File cards ---------- */
.file-cards-grid { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px 0; min-height: 0; }
.file-cards-grid:empty { padding: 0; }
.file-card {
  width: 160px; background: var(--bg-card); border: 1.5px solid var(--border-color);
  border-radius: 12px; overflow: hidden; position: relative; transition: all 0.2s ease; box-shadow: var(--shadow-card);
}
.file-card:hover { border-color: var(--brand-primary); }
.card-preview { width: 100%; height: 180px; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card-preview canvas, .card-preview img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.preview-loading { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.preview-spinner { width: 28px; height: 28px; border: 3px solid var(--border-color); border-top-color: var(--brand-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.preview-icon { font-size: 48px; opacity: 0.4; }
.card-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.file-card:hover .card-actions { opacity: 1; }
.btn-rotate { width: 26px; height: 26px; background: var(--brand-primary); color: var(--brand-dark); border-radius: 50%; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: transform 0.2s; }
.btn-rotate:hover { transform: rotate(90deg); }
.btn-delete { width: 26px; height: 26px; background: #FC8181; color: #fff; border-radius: 50%; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.card-info { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.card-name { font-size: 12px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-size { font-size: 11px; color: var(--text-muted); }
.card-pages { font-size: 11px; color: var(--brand-primary); font-weight: 500; }

/* ---------- Controls ---------- */
.controls-panel { margin-top: 8px; display: flex; flex-direction: column; gap: 14px; }
.controls-panel:empty { display: none; }
.control-row { display: flex; flex-direction: column; gap: 6px; }
.control-row label { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.control-row select, .control-row input[type="text"], .control-row input[type="password"], .control-row input[type="number"] {
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); outline: none;
}
.control-row input[type="range"] { width: 100%; accent-color: var(--brand-primary); }
.range-value { color: var(--brand-primary); font-weight: 700; }
.size-estimate { font-size: 14px; font-weight: 600; color: var(--brand-success); }

/* ---------- Buttons ---------- */
.btn-primary { padding: 12px 26px; border-radius: 8px; background: var(--brand-primary); color: var(--brand-dark); font-weight: 700; transition: transform 0.1s ease, filter 0.2s ease; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-large { font-size: 16px; padding: 14px 28px; }
.btn-secondary { padding: 10px 18px; border-radius: 8px; border: 1px solid var(--border-color); color: var(--text-primary); font-weight: 600; background: var(--bg-secondary); }
.btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-danger { padding: 12px 22px; border-radius: 8px; background: var(--brand-danger); color: #fff; font-weight: 700; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-download { display: inline-flex; align-items: center; padding: 12px 26px; border-radius: 8px; background: var(--brand-success); color: #fff; font-weight: 700; }
.btn-download:hover { filter: brightness(1.08); }
.action-row { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Progress ---------- */
.progress-wrap { margin-top: 20px; display: flex; align-items: center; gap: 12px; }
.progress-track { flex: 1; height: 12px; border-radius: 999px; background: var(--border-color); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-primary), var(--brand-success)); transition: width 0.2s ease; }
.progress-text { font-size: 13px; font-weight: 600; min-width: 42px; text-align: right; }

/* ---------- Tool-specific workspaces ---------- */
.tool-specific-workspace { margin-top: 18px; }
.unlock-ui, .protect-ui { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 420px; margin: 0 auto; }
.lock-icon-display { font-size: 54px; }
.password-field-wrap { position: relative; width: 100%; }
.password-input { width: 100%; padding: 12px 44px 12px 14px; border-radius: 8px; border: 1.5px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); outline: none; font-size: 15px; }
.password-input:focus { border-color: var(--brand-primary); }
.toggle-pwd-visibility { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 16px; padding: 4px; }
.password-strength { font-size: 13px; font-weight: 600; min-height: 18px; }
.tool-note { font-size: 12px; color: var(--text-muted); background: rgba(245,166,35,0.08); border: 1px solid rgba(245,166,35,0.25); border-radius: 8px; padding: 10px 12px; }

/* Split pages */
.split-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.selected-count { font-size: 13px; color: var(--brand-primary); font-weight: 600; }
.split-pages-grid { display: flex; flex-wrap: wrap; gap: 12px; max-height: 480px; overflow-y: auto; padding: 4px; }
.page-card { width: 130px; background: var(--bg-card); border: 2px solid var(--border-color); border-radius: 8px; padding: 8px; position: relative; cursor: pointer; transition: border-color 0.2s; }
.page-card:hover { border-color: var(--brand-primary); }
.page-card input[type="checkbox"] { position: absolute; top: 6px; left: 6px; width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand-primary); z-index: 2; }
.page-card input:checked ~ .page-card-label .page-thumb-wrap { outline: 2.5px solid var(--brand-primary); border-radius: 4px; }
.page-thumb-wrap { background: #fff; border-radius: 4px; overflow: hidden; }
.page-thumb-wrap canvas { width: 100%; height: auto; display: block; }
.page-num { display: block; text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.split-action-btns { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* Scan */
.scan-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 8px 0 20px; }
.scan-option-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.scan-select { width: 100%; background: var(--bg-secondary); border: 1.5px solid var(--border-color); color: var(--text-primary); padding: 10px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; outline: none; transition: border-color 0.2s; }
.scan-select:focus { border-color: var(--brand-primary); }
.btn-scan { width: 100%; letter-spacing: 0.5px; }
.scan-anim-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px; }
.scanner-body-svg { width: 280px; background: linear-gradient(180deg, #2D3748 0%, #1A202C 100%); border-radius: 12px; padding: 16px; border: 2px solid #4A5568; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.scanner-glass-area { width: 100%; height: 180px; background: #fff; border-radius: 6px; position: relative; overflow: hidden; border: 2px solid #CBD5E0; }
.scan-laser-bar { position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, transparent, #00FF88 50%, transparent); box-shadow: 0 0 12px #00FF88, 0 0 24px rgba(0,255,136,0.5); opacity: 0; transition: opacity 0.3s; }
.scan-laser-bar.laser-active { opacity: 1; animation: laserSweep 2s linear forwards; }
@keyframes laserSweep { 0% { top: 0; } 100% { top: 176px; } }
.scan-reveal-area { position: absolute; bottom: 0; left: 0; width: 100%; height: 0%; background: linear-gradient(180deg, rgba(200,220,255,0.35), rgba(200,220,255,0.1)); }
@keyframes scanReveal { 0% { height: 0%; } 100% { height: 100%; } }
.scanner-base { height: 24px; margin-top: 8px; background: #4A5568; border-radius: 6px; }
.scan-status-text { color: var(--text-secondary); font-size: 14px; text-align: center; }
.scan-progress-dots { display: flex; gap: 6px; }
.scan-progress-dots span { width: 8px; height: 8px; background: var(--brand-primary); border-radius: 50%; animation: dotBounce 1.2s ease infinite; }
.scan-progress-dots span:nth-child(2) { animation-delay: 0.2s; }
.scan-progress-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce { 0%,80%,100% { transform: scale(0.8); opacity: 0.5; } 40% { transform: scale(1.2); opacity: 1; } }
.scan-fallback-wrap { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.fallback-notice { display: flex; gap: 12px; background: rgba(245,166,35,0.08); border: 1px solid rgba(245,166,35,0.3); border-radius: 10px; padding: 16px; align-items: flex-start; width: 100%; }
.fallback-icon { font-size: 24px; flex-shrink: 0; }
.fallback-notice strong { color: var(--text-primary); font-size: 14px; }
.fallback-notice p { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }

/* Crop */
.crop-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: start; }
.crop-canvas-wrap { position: relative; display: inline-block; border: 2px solid var(--border-color); border-radius: 8px; overflow: hidden; max-width: 100%; }
.crop-canvas-wrap canvas { display: block; max-width: 100%; }
.crop-overlay { position: absolute; top: 0; left: 0; pointer-events: none; }
.crop-box { position: absolute; border: 2px solid var(--brand-primary); background: rgba(245,166,35,0.06); cursor: move; pointer-events: all; box-shadow: 0 0 0 9999px rgba(0,0,0,0.45); }
.crop-handle { position: absolute; width: 12px; height: 12px; background: var(--brand-primary); border-radius: 3px; pointer-events: all; }
.crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
.crop-hint { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.crop-controls-panel { background: var(--bg-card); border: 1.5px solid var(--border-color); border-radius: 12px; padding: 20px; }
.crop-margin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.crop-margin-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.crop-input { background: var(--bg-secondary); border: 1.5px solid var(--border-color); color: var(--text-primary); padding: 8px 10px; border-radius: 6px; font-size: 14px; width: 100%; outline: none; }
.crop-input:focus { border-color: var(--brand-primary); }
.crop-all-pages { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; margin-top: 8px; }

/* ---------- About + FAQ ---------- */
.about, .faq { margin-top: 34px; }
.about h2, .faq h2 { font-size: 22px; margin-bottom: 12px; color: var(--brand-primary); }
.about p { color: var(--text-secondary); font-size: 16px; margin-bottom: 10px; max-width: 900px; }
.faq-item { border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 10px; overflow: hidden; background: var(--bg-card); }
.faq-q { width: 100%; text-align: left; padding: 16px 18px; font-weight: 600; font-size: 16px; color: var(--text-primary); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-q::after { content: "+"; color: var(--brand-primary); font-size: 24px; font-weight: 700; flex-shrink: 0; }
.faq-item.open .faq-q::after { content: "−"; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.2s ease, padding 0.2s ease; padding: 0 18px; }
.faq-a p { color: var(--text-secondary); font-size: 15.5px; line-height: 1.65; }
.faq-item.open .faq-a { max-height: 600px; padding: 0 18px 18px; }

/* ---------- Trust badge + footer ---------- */
.trust-badge { position: fixed; bottom: 16px; right: 16px; z-index: 90; padding: 10px 16px; border-radius: 999px; background: var(--brand-dark); color: var(--brand-primary); border: 1px solid var(--brand-primary); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-hover); }
.site-footer { margin-left: var(--sidebar-w); background: var(--bg-secondary); border-top: 1px solid var(--border-color); margin-top: 60px; }
.footer-main { max-width: 1200px; margin: 0 auto; padding: 60px 24px 40px; display: grid; grid-template-columns: 300px 1fr; gap: 60px; }
.footer-tagline { color: var(--text-muted); font-size: 14px; line-height: 1.6; margin: 12px 0; }
.footer-badge { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.footer-badge span { background: rgba(245,166,35,0.1); border: 1px solid rgba(245,166,35,0.3); color: var(--brand-primary); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.footer-links-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.footer-col h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--brand-primary); margin-bottom: 12px; }
.footer-col a { display: block; font-size: 13px; color: var(--text-muted); padding: 3px 0; cursor: pointer; transition: color 0.2s; }
.footer-col a:hover { color: var(--brand-primary); }
.footer-bottom { border-top: 1px solid var(--border-color); background: var(--bg-primary); }
.footer-bottom-inner { max-width: 1200px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.footer-logo-center { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.footer-powered { font-size: 14px; color: var(--text-secondary); }
.footer-powered strong { color: var(--text-primary); }
.footer-email, .footer-domain { color: var(--brand-primary); transition: opacity 0.2s; }
.footer-email:hover, .footer-domain:hover { opacity: 0.8; text-decoration: underline; }
.footer-copy { font-size: 12px; color: var(--text-muted); margin: 0; }

/* ---------- Tool transition overlay ---------- */
.tool-transition-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(10,14,26,0.97); display: flex; align-items: center; justify-content: center; flex-direction: column; backdrop-filter: blur(8px); }
.overlay-enter { animation: overlayFadeIn 0.2s ease forwards; }
.overlay-exit { animation: overlayFadeOut 0.2s ease forwards; }
@keyframes overlayFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes overlayFadeOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.05); } }
.transition-content { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.transition-icon-wrap { width: 120px; height: 120px; animation: iconPulse 1.5s ease infinite; filter: drop-shadow(0 0 20px #F5A623); }
@keyframes iconPulse { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 20px #F5A623); } 50% { transform: scale(1.08); filter: drop-shadow(0 0 35px #F5A623); } }
.transition-tool-name { font-size: 2rem; font-weight: 700; margin: 0; letter-spacing: -0.5px; }
.transition-tool-desc { font-size: 1rem; color: #A0AEC0; margin: 0; animation: descBlink 0.8s ease infinite alternate; }
@keyframes descBlink { from { opacity: 0.5; } to { opacity: 1; } }
.transition-watermark { position: absolute; bottom: 22px; right: 26px; display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; opacity: 0.7; }

/* per-icon transition animations */
@keyframes tMergeLeft { 0% { transform: translateX(-30px); opacity: 0; } 60% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(15px); } }
@keyframes tMergeRight { 0% { transform: translateX(30px); opacity: 0; } 60% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(-15px); } }
@keyframes tBurst { 0%,55% { opacity: 0; transform: scale(0); } 70% { opacity: 1; transform: scale(2.2); } 100% { opacity: 0; transform: scale(3); } }
.animMerge-left { animation: tMergeLeft 1.5s ease forwards; transform-origin: center; }
.animMerge-right { animation: tMergeRight 1.5s ease forwards; transform-origin: center; }
.animMerge-burst { animation: tBurst 1.5s ease forwards; transform-origin: 60px 52px; }
@keyframes tSplitTop { 0%,40% { transform: translateY(0); } 100% { transform: translateY(-14px); } }
@keyframes tSplitBot { 0%,40% { transform: translateY(0); } 100% { transform: translateY(14px); } }
.animSplit-top { animation: tSplitTop 1.5s ease forwards; }
.animSplit-bot { animation: tSplitBot 1.5s ease forwards; }
@keyframes tPlateTop { 0% { transform: translateY(-10px); } 60% { transform: translateY(18px); } 100% { transform: translateY(14px); } }
@keyframes tPlateBot { 0% { transform: translateY(10px); } 60% { transform: translateY(-18px); } 100% { transform: translateY(-14px); } }
@keyframes tDocSquish { 0% { transform: scaleY(1); } 60%,100% { transform: scaleY(0.7); } }
.animCompress-top-plate { animation: tPlateTop 1.5s ease forwards; }
.animCompress-bot-plate { animation: tPlateBot 1.5s ease forwards; }
.animCompress-doc { animation: tDocSquish 1.5s ease forwards; transform-origin: 60px 60px; }
@keyframes tShackle { 0% { transform: rotate(0); } 60% { transform: rotate(-32deg); } 100% { transform: rotate(-32deg); } }
.animUnlock-shackle { animation: tShackle 1.5s ease forwards; transform-origin: 45px 45px; }
@keyframes tGlow { 0%,100% { opacity: 0; } 50% { opacity: 0.9; } }
.animUnlock-glow { animation: tGlow 1.5s ease infinite; }
@keyframes tLockShake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.animLock-body { animation: tLockShake 0.6s ease 2; }
@keyframes tRotateDoc { 0% { transform: rotate(0); } 100% { transform: rotate(90deg); } }
.animRotate-doc { animation: tRotateDoc 1.5s ease forwards; }
@keyframes tConvertArrow { 0%,100% { opacity: 0.4; transform: translateX(0); } 50% { opacity: 1; transform: translateX(4px); } }
.animConvert-arrow { animation: tConvertArrow 0.9s ease infinite; }
@keyframes tCropBox { 0% { transform: scale(1.15); opacity: 0.4; } 100% { transform: scale(1); opacity: 1; } }
.animCrop-box { animation: tCropBox 1.5s ease forwards; transform-origin: 60px 60px; }
@keyframes tImgFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.animImage-arrow { animation: tImgFloat 1s ease infinite; }

/* ---------- Processing anim overlay (per-tool) ---------- */
.anim-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; background: rgba(10,12,24,0.86); backdrop-filter: blur(4px); }
.anim-stage { position: relative; width: 320px; height: 240px; display: flex; align-items: center; justify-content: center; }
.generic-spin { width: 80px; height: 80px; border-radius: 50%; border: 6px solid var(--border-color); border-top-color: var(--brand-primary); animation: spin 0.9s linear infinite; }
.anim-label { position: absolute; bottom: -40px; width: 100%; text-align: center; color: var(--brand-primary); font-weight: 700; }

/* ---------- Toast ---------- */
.toast-container { position: fixed; bottom: 70px; right: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; color: #fff; box-shadow: var(--shadow-hover); animation: toastIn 0.2s ease forwards; max-width: 340px; }
.toast.success { background: #48BB78; }
.toast.error { background: #FC8181; }
.toast.info { background: #4A90D9; }
.toast.fade-out { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .mega-menu { grid-template-columns: repeat(2, 1fr); width: min(560px, 92vw); }
  :root { --sidebar-w: 220px; }
}
@media (max-width: 1200px) {
  /* Keep the whole header on one line: hide the primary shortcut links and keep
     the CONVERT TO PDF + ALL PDF TOOLS dropdowns (which still expose every tool). */
  .main-nav .nav-item { display: none; }
  .header-left { gap: 16px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 240px; z-index: 95; box-shadow: var(--shadow-hover); }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .site-footer { margin-left: 0; }
  .main-nav .mega-menu { position: fixed; left: 8px; right: 8px; width: auto; }
  .header-left { gap: 12px; }
  .crop-layout { grid-template-columns: 1fr; }
  .transition-tool-name { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .mega-menu { grid-template-columns: 1fr; max-height: 70vh; overflow-y: auto; }
  .logo-text { font-size: 18px; }
  .trust-badge { font-size: 11px; padding: 8px 12px; left: 8px; right: 8px; text-align: center; }
  .header-right { gap: 6px; }
  .lang-toggle, .theme-toggle { padding: 6px 8px; font-size: 13px; }
  .file-card { width: 100%; }
}
@media (max-width: 360px) {
  .mega-trigger { padding: 6px 8px; font-size: 13px; }
  .tool-panel { padding: 14px; }
}

/* ===================================================================
   IMAGE TOOLS + SECTION HEADERS (v3)
   =================================================================== */
.tools-section-header { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.tools-section-header .section-icon { font-size: 22px; }
.tools-section-header h2 { font-size: 20px; color: var(--text-primary); }
.sidebar-section-header { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-primary); padding: 14px 10px 6px; }

/* Before/after */
.before-after-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.before-panel, .after-panel { border: 1.5px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.panel-label { display: block; padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-color); }
.before-panel img, .after-panel img { width: 100%; height: auto; display: block; }
.checkerboard-bg { background-image: linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%); background-size: 16px 16px; background-position: 0 0,0 8px,8px -8px,-8px 0; background-color: #fff; }
.removebg-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.processing-indicator { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px; color: var(--text-muted); }

/* Compress image */
.compress-controls-panel { background: var(--bg-card); border: 1.5px solid var(--border-color); border-radius: 12px; padding: 24px; margin-top: 20px; }
.compress-mode-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.compress-tab { padding: 8px 20px; border-radius: 8px; border: 1.5px solid var(--border-color); background: transparent; color: var(--text-secondary); font-size: 14px; transition: all 0.2s; }
.compress-tab.active { background: var(--brand-primary); color: var(--brand-dark); border-color: var(--brand-primary); font-weight: 600; }
.compress-label { font-size: 14px; color: var(--text-secondary); }
.quality-slider { width: 100%; accent-color: var(--brand-primary); height: 6px; margin: 12px 0; cursor: pointer; }
.quality-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.size-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btn-size-preset { padding: 6px 14px; border-radius: 6px; border: 1.5px solid var(--border-color); background: transparent; color: var(--text-secondary); font-size: 13px; transition: all 0.2s; }
.btn-size-preset:hover, .btn-size-preset.active { background: var(--brand-primary); color: var(--brand-dark); border-color: var(--brand-primary); font-weight: 600; }
.size-custom-input { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.compress-kb-input { width: 120px; background: var(--bg-secondary); border: 1.5px solid var(--border-color); color: var(--text-primary); padding: 8px 12px; border-radius: 8px; font-size: 14px; outline: none; }
.compress-kb-input:focus { border-color: var(--brand-primary); }
.compress-kb-unit { color: var(--text-muted); font-size: 13px; }
.compress-output-format { margin: 16px 0; }
.compress-output-format label, .output-format-select label { font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }
.compress-output-format select { background: var(--bg-secondary); border: 1.5px solid var(--border-color); color: var(--text-primary); padding: 8px 12px; border-radius: 8px; font-size: 14px; outline: none; max-width: 240px; }
.compress-preview-grid { margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.compress-file-row { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--bg-secondary); border-radius: 8px; }
.compress-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border-color); }
.compress-file-info { display: flex; flex-direction: column; gap: 2px; }
.compress-filename { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.compress-original { font-size: 12px; color: var(--text-muted); }
.compress-estimated { font-size: 12px; color: var(--brand-primary); font-weight: 500; }

/* Change bg */
.changebg-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.changebg-upload-section h4, .changebg-preview h4 { margin-bottom: 10px; color: var(--text-primary); }
.changebg-options-section { margin-top: 18px; }
.bg-type-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.bg-tab { padding: 6px 16px; border-radius: 6px; border: 1.5px solid var(--border-color); background: transparent; color: var(--text-secondary); font-size: 13px; transition: all 0.2s; }
.bg-tab.active { background: var(--brand-primary); color: var(--brand-dark); border-color: var(--brand-primary); font-weight: 600; }
.color-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.color-swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 2px solid var(--border-color); transition: transform 0.15s, border-color 0.15s; }
.color-swatch:hover, .color-swatch.selected { transform: scale(1.2); border-color: var(--brand-primary); }
.color-picker-input { width: 48px; height: 32px; border: none; cursor: pointer; border-radius: 6px; padding: 0; vertical-align: middle; }
.gradient-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gradient-swatch { height: 48px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: transform 0.15s, border-color 0.15s; }
.gradient-swatch:hover, .gradient-swatch.selected { transform: scale(1.05); border-color: var(--brand-primary); }
.changebg-canvas { width: 100%; height: auto; border-radius: 12px; border: 1.5px solid var(--border-color); display: block; }

/* Crop image editor */
.crop-img-editor { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.crop-img-canvas-wrap { position: relative; display: inline-block; border: 2px solid var(--border-color); border-radius: 8px; overflow: hidden; max-width: 100%; }
.crop-img-canvas-wrap canvas { display: block; max-width: 100%; }
.crop-img-controls { background: var(--bg-card); border: 1.5px solid var(--border-color); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.crop-dimensions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; color: var(--text-muted); }
.crop-dimensions strong { color: var(--brand-primary); }
.preset-ratios { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-ratio { padding: 5px 12px; border-radius: 6px; border: 1.5px solid var(--border-color); background: transparent; color: var(--text-secondary); font-size: 12px; font-weight: 500; transition: all 0.2s; }
.btn-ratio:hover { background: var(--brand-primary); color: var(--brand-dark); border-color: var(--brand-primary); }
.output-format-select select { background: var(--bg-secondary); border: 1.5px solid var(--border-color); color: var(--text-primary); padding: 8px 12px; border-radius: 8px; font-size: 14px; outline: none; }

/* Watermark tool */
.wm-mode-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.wm-tab { padding: 8px 20px; border-radius: 8px; border: 1.5px solid var(--border-color); background: transparent; color: var(--text-secondary); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.wm-tab.active { background: var(--brand-primary); color: var(--brand-dark); border-color: var(--brand-primary); }
.wm-panel { margin-bottom: 20px; display: flex; flex-direction: column; gap: 16px; }
.wm-field { display: flex; flex-direction: column; gap: 6px; }
.wm-field label { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.wm-field input[type="text"] { padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--border-color); background: var(--bg-secondary); color: var(--text-primary); outline: none; font-size: 15px; }
.wm-field input[type="text"]:focus { border-color: var(--brand-primary); }
.wm-field input[type="range"] { width: 100%; accent-color: var(--brand-primary); cursor: pointer; }
.wm-field strong { color: var(--brand-primary); }
.wm-position-section { margin: 20px 0; }
.wm-position-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.wm-position-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 180px; }
.wm-pos { aspect-ratio: 1 / 1; border: 1.5px solid var(--border-color); border-radius: 8px; background: var(--bg-secondary); cursor: pointer; position: relative; transition: all 0.15s ease; }
.wm-pos::after { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); transition: background 0.15s ease; }
.wm-pos:hover { border-color: var(--brand-primary); }
.wm-pos.active { border-color: var(--brand-primary); background: rgba(245, 166, 35, 0.12); }
.wm-pos.active::after { background: var(--brand-primary); }
.wm-pos:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
#wmApplyBtn { margin-top: 8px; }

/* Responsive additions */
@media (max-width: 768px) {
  .site-footer { margin-left: 0; }
  .footer-main { grid-template-columns: 1fr; gap: 32px; padding: 40px 16px 24px; }
  .changebg-layout { grid-template-columns: 1fr; }
  .crop-img-editor { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .footer-links-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .before-after-wrap { grid-template-columns: 1fr; }
}

/* ===================================================================
   LOGO IMAGE + HOMEPAGE REDESIGN (v4)
   =================================================================== */
.site-logo-img { height: 40px; width: auto; max-width: 180px; object-fit: contain; display: block; flex-shrink: 0; transition: opacity 0.2s; }
.site-logo-img:hover { opacity: 0.85; }
.header-logo .site-logo-img { height: 38px; }
.footer-logo .site-logo-img { height: 44px; }
.workspace-logo-watermark .site-logo-img { height: 24px; }
.logo-fallback { display: none; align-items: center; gap: 10px; }
@media (max-width: 480px) { .site-logo-img { height: 30px; } }

/* Hero */
.hero-section { padding: 40px 0 28px; text-align: center; }
.hero-title { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; color: var(--text-primary); line-height: 1.2; margin-bottom: 16px; }
.hero-highlight { color: var(--brand-primary); display: block; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-secondary); max-width: 620px; margin: 0 auto 24px; line-height: 1.6; }
.hero-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.hero-badge { background: var(--bg-secondary); border: 1.5px solid var(--border-color); color: var(--text-secondary); padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; }

/* How it works */
.how-it-works { background: var(--bg-secondary); border-radius: 16px; padding: 40px 32px; margin-bottom: 40px; text-align: center; }
.steps-grid { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 32px; }
.step-card { background: var(--bg-card); border: 1.5px solid var(--border-color); border-radius: 16px; padding: 24px 20px; width: 180px; text-align: center; position: relative; }
.step-number { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; background: var(--brand-primary); color: var(--brand-dark); border-radius: 50%; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step-icon { font-size: 36px; margin-bottom: 12px; }
.step-card h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.step-card p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.step-arrow { font-size: 24px; color: var(--brand-primary); font-weight: 300; }

/* Section titles */
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-subtitle { font-size: 13px; font-weight: 400; color: var(--text-muted); }

/* Trust */
.trust-section { margin-bottom: 40px; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.trust-card { background: var(--bg-card); border: 1.5px solid var(--border-color); border-radius: 16px; padding: 24px; text-align: center; transition: all 0.15s ease; }
.trust-card:hover { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.trust-icon { font-size: 36px; margin-bottom: 12px; }
.trust-card h3 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.trust-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* Popular tools */
.popular-tools-section { margin-bottom: 48px; }
.popular-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tool-card-popular { border: 2px solid var(--brand-primary) !important; background: linear-gradient(135deg, rgba(245,166,35,0.06) 0%, var(--bg-card) 100%); }
.popular-badge { position: absolute; z-index: 10; top: -10px; right: 12px; background: var(--brand-primary); color: var(--brand-dark); font-size: 10px; font-weight: 700; padding: 2px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Category sections */
.tools-category-section { margin-bottom: 40px; }
.category-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--border-color); }
.category-icon { font-size: 20px; }
.category-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); flex: 1; margin: 0; }
.category-count { font-size: 12px; color: var(--text-muted); background: var(--bg-secondary); padding: 3px 10px; border-radius: 12px; border: 1px solid var(--border-color); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

/* Tool card icon wrap + desc */
.tool-icon-wrap { width: 48px; height: 48px; background: rgba(245,166,35,0.1); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.tool-icon-img { width: 28px; height: 28px; object-fit: contain; }
.tool-icon-fallback { font-size: 24px; display: flex; align-items: center; justify-content: center; }
.tool-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; margin-top: 2px; }

@media (max-width: 600px) {
  .step-arrow { display: none; }
  .steps-grid { gap: 12px; }
  .step-card { width: 140px; padding: 20px 12px; }
}

/* ===================================================================
   GOOGLE ADSENSE AD ZONES
   Placeholder wrappers for responsive ad slots. Generous spacing keeps
   ads well clear of action buttons (Apply Watermark, Download, etc.) to
   avoid accidental / invalid AdSense clicks. Any dynamic fade stays within
   the 0.1s–0.2s interaction-animation policy.
   =================================================================== */
.alldoc-ad-wrapper {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  color: var(--text-muted);
  overflow: hidden;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.alldoc-ad-label {
  padding: 10px 14px; pointer-events: none;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; text-align: center; line-height: 1.4;
}

/* 1) Top leaderboard — below the tool heading, above the drag & drop zone.
   >=20px clearance above and below so it never touches the heading/upload zone. */
.alldoc-ad-top {
  width: 100%;
  min-height: 90px;
  margin: 20px 0 24px;
}

/* 2) Sidebar vertical rectangle — flex sibling of the workspace inside .layout.
   Sticky on wide screens; 20px gap from the workspace edge. */
.alldoc-ad-rail {
  flex: 0 0 300px;
  width: 300px;
  min-height: 600px;
  align-self: flex-start;
  position: sticky;
  top: calc(var(--header-h) + 20px);
  margin: 28px 20px 24px 0;
}

/* 3) Bottom horizontal banner — directly above the footer. Clears the fixed
   sidebar like the footer, with 40px clearance above (away from action buttons
   such as Download) and 20px below before the footer. */
.alldoc-ad-bottom {
  min-height: 90px;
  margin: 40px clamp(16px, 4vw, 48px) 20px;
  margin-left: calc(var(--sidebar-w) + clamp(16px, 4vw, 48px));
}

/* Tablet range: avoid cramping the tool workspace — hide the vertical rail here. */
@media (max-width: 1024px) and (min-width: 769px) {
  .alldoc-ad-rail { display: none; }
}

/* Mobile: the sidebar rail gracefully collapses to a full-width slot below the tool. */
@media (max-width: 768px) {
  .layout { flex-wrap: wrap; }
  .workspace { flex-basis: 100%; }
  .alldoc-ad-rail {
    position: static;
    flex: 1 1 100%;
    width: 100%;
    min-height: 250px;
    margin: 20px 0 24px;
  }
  .alldoc-ad-bottom { margin-left: clamp(16px, 4vw, 48px); }
}
