/* =========================
   Design tokens & base
   ========================= */
:root{
  --bg:#f8fafc; --panel:#ffffff; --text:#0f172a; --muted:#475569; --border:#e5e7eb;
  --accent:#2563eb; --accent-2:#0ea5e9; --success:#16a34a; --warn:#b45309;
  --shadow:0 1px 2px rgba(0,0,0,.04),0 10px 30px rgba(2,6,23,.06);
  --space-1:8px; --space-2:12px; --space-3:16px; --space-4:24px; --space-5:32px;
  --header-gap: 48px;
}
body[data-theme="dark"]{
  --bg:#0d1220; --panel:#121729; --text:#e6ebff; --muted:#a0aac8; --border:#1f2743;
  --accent:#6ea8fe; --accent-2:#86f0c5; --success:#22c55e; --warn:#f59e0b;
  --shadow:0 1px 2px rgba(255,255,255,.03),0 10px 28px rgba(0,0,0,.25);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--text);
  font-family: ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Inter,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  line-height:1.6; overflow-x:hidden;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
}
:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; } }

/* Widened container/main */
.container{max-width:1200px;margin:0 auto;padding:0 var(--space-3)}
.content-narrow{max-width:940px;margin:18px auto}

/* =========================
   Header
   ========================= */
.site-header{position:static!important;z-index:10;background:var(--panel);border-bottom:1px solid var(--border)}
.header-row.header-clean{
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap: 28px !important; /* ↑ a little more space overall */
  padding:16px 0!important
}
.brand{display:inline-flex;align-items:center;gap:0;text-decoration:none}

/* Header logo: 200x200 */
.site-header .brand-logo{
  width:200px!important;height:200px!important;border-radius:16px;display:block;object-fit:contain
}

/* Put extra breathing room between logo and nav */
.main-nav.tools-primary.push-right{ margin-left: 24px; }

/* Right side: links + spacer + toggle */
.header-right{display:flex!important;align-items:center!important;gap:24px!important;flex:1 1 auto!important;min-width:0!important}
.flex-spacer{flex:1 1 auto!important;min-width:12px}

/* Tools nav: single line; scroll instead of wrap */
.main-nav.tools-primary{
  display:flex!important;gap:18px!important;flex:0 1 auto!important;white-space:nowrap!important;
  overflow-x:auto!important;-webkit-overflow-scrolling:touch;scrollbar-width:none;min-width:0!important
}
.main-nav.tools-primary::-webkit-scrollbar{display:none}
.main-nav.tools-primary a{
  color:#334155;font-weight:600;text-decoration:none!important;border:0!important;padding:8px 2px;transition:color .15s ease
}
@supports (color: color-mix(in srgb, #000 0%, #fff 100%)){
  .main-nav.tools-primary a:hover,.main-nav.tools-primary a:focus-visible{color:color-mix(in srgb,#334155 60%,white 40%);outline:none}
}
@supports not (color: color-mix(in srgb, #000 0%, #fff 100%)){
  .main-nav.tools-primary a:hover,.main-nav.tools-primary a:focus-visible{color:#64748b;outline:none}
}
.main-nav.tools-primary a.active{color:#0f172a}
[data-theme="dark"] .main-nav.tools-primary a{color:#94a3b8}
[data-theme="dark"] .main-nav.tools-primary a:hover,[data-theme="dark"] .main-nav.tools-primary a:focus-visible{color:#e2e8f0}

/* Toggle */
.theme-switch{position:relative;display:inline-flex;align-items:center;gap:8px;cursor:pointer;user-select:none;font-size:.9rem;color:#64748b;flex:0 0 auto!important;margin-left:0!important}
.theme-switch input{position:absolute;opacity:0;pointer-events:none}
.theme-switch .slider{width:44px;height:24px;border-radius:999px;background:#e2e8f0;position:relative;transition:background .2s}
.theme-switch .slider::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.12);transition:transform .2s}
.theme-switch input:checked + .slider{background:#334155}
.theme-switch input:checked + .slider::after{transform:translateX(20px)}
.theme-switch .theme-label{min-width:36px}

/* Header/content spacing */
main.container.content-narrow{margin-top:var(--header-gap)!important}

/* Responsive header tuning */
@media (max-width:1024px){
  .site-header .brand-logo{width:160px!important;height:160px!important}
}
@media (max-width:640px){
  .site-header .brand-logo{width:120px!important;height:120px!important}
  .main-nav.tools-primary{gap:12px!important}
}

/* =========================
   Rest of site
   ========================= */
.card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:18px;box-shadow:var(--shadow)}
.muted{color:var(--muted)}
.small{font-size:.92rem}

/* hero & tool list */
.hero h1{margin:0 0 6px}
.tool-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px;margin-top:14px}
.tool{display:flex;align-items:center;justify-content:space-between;text-decoration:none;color:inherit;transition:.15s transform}
.tool:hover{transform:translateY(-2px)}
.tool-main{display:flex;gap:12px;align-items:center}
.tool-title{margin:0}
.tool-desc{margin:4px 0 0;color:var(--muted);font-size:.95rem}
.tool-cta{color:var(--accent);font-weight:700}

/* Replaced emoji with SVG icons */
.tool-icon{width:28px;height:28px;display:inline-block;background-size:contain;background-repeat:no-repeat;background-position:center}
.icon-compress{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='14' rx='2'/><path d='M7 21h10M12 17v4'/><path d='M8 8h8M10 11h4'/></svg>")}
.icon-merge{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 6v6a4 4 0 0 0 4 4h4'/><path d='M8 18l-2-2 2-2'/><path d='M16 6l2 2-2 2'/></svg>")}
.icon-split{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M8 6v6a4 4 0 0 0 4 4h4'/><path d='M8 14l-2 2 2 2'/><path d='M16 10l2-2-2-2'/></svg>")}
.icon-rotate{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12a9 9 0 1 1-9-9'/><polyline points='22 2 22 8 16 8'/></svg>")}
.icon-pdf2img{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='10' height='14' rx='2'/><rect x='13' y='6' width='8' height='12' rx='2'/><circle cx='17' cy='12' r='2'/></svg>")}
.icon-img2pdf{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='6' width='8' height='12' rx='2'/><rect x='11' y='4' width='10' height='14' rx='2'/><path d='M12 12h8'/></svg>")}
.icon-pdf2word{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='8' height='14' rx='2'/><path d='M14 7h7v10h-7z'/><path d='M15 9l1.5 6L18 9l1.5 6L21 9'/></svg>")}
.icon-word2pdf{background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 7h7v10h-7z'/><rect x='3' y='4' width='8' height='14' rx='2'/><path d='M6 9l1.5 6L9 9l1.5 6L12 9'/></svg>")}

/* ===== Additional tool icons (28x28, inline SVG data URIs) ===== */
.tool-icon{width:28px;height:28px;display:inline-block;background-size:contain;background-repeat:no-repeat;background-position:center}

/* OCR (scan frame + text lines) */
.icon-ocr{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<path d='M3 7V5a2 2 0 0 1 2-2h2'/><path d='M17 3h2a2 2 0 0 1 2 2v2'/>\
<path d='M21 17v2a2 2 0 0 1-2 2h-2'/><path d='M7 21H5a2 2 0 0 1-2-2v-2'/>\
<rect x='7' y='7' width='10' height='10' rx='2'/>\
<path d='M9.5 11h5M9.5 14h3.5'/>\
</svg>")}

/* keep your existing .tool-icon base */
.tool .tool-icon { color:#64748b; }
.tool:hover .tool-icon,
.tool:focus-within .tool-icon { color: var(--accent); }
.tool.is-active .tool-icon {
  color: var(--accent);
  /* optional highlight */
  outline: 2px solid color-mix(in oklab, var(--accent) 45%, transparent);
  outline-offset: 3px; border-radius: 12px;
}



/* Flatten (stack compressed) */
.icon-flatten{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<path d='M12 3l8 4-8 4-8-4 8-4z'/><path d='M20 11l-8 4-8-4'/>\
<path d='M4 15l8 4 8-4'/><path d='M8 20h8'/>\
</svg>")}

/* Lock / Protect PDF */
.icon-lock{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<rect x='3' y='5' width='10' height='14' rx='2'/><path d='M17 14v-2a2 2 0 0 1 4 0v2'/>\
<rect x='16' y='14' width='6' height='5' rx='1'/>\
</svg>")}

/* Unlock / Remove password */
.icon-unlock{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<rect x='3' y='5' width='10' height='14' rx='2'/>\
<path d='M20 12a2 2 0 0 0-4 0v2'/><rect x='16' y='14' width='6' height='5' rx='1'/>\
<path d='M18 10V8a4 4 0 0 0-8 0'/>\
</svg>")}

/* Reorder pages (up/down arrows + page) */
.icon-reorder{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237158b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<rect x='4' y='4' width='8' height='14' rx='2'/><path d='M18 7l-3 3h6l-3-3z'/>\
<path d='M18 17l3-3h-6l3 3z'/>\
</svg>")}

/* Extract images (image badge with arrow out) */
.icon-extract-images{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<rect x='3' y='6' width='10' height='12' rx='2'/><circle cx='8' cy='11' r='1.5'/>\
<path d='M4.5 17l3-3 2 2 2.5-2.5'/>\
<path d='M15 9h6M21 9v6'/>\
</svg>")}

/* Page numbers (hash badge on page) */
.icon-page-numbers{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<rect x='4' y='4' width='10' height='14' rx='2'/>\
<path d='M18 8h4M18 12h4'/>\
<path d='M7 9h4M7 12h4'/>\
</svg>")}

/* Watermark (stamp over page) */
.icon-watermark{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230ea5e9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<rect x='3' y='4' width='10' height='14' rx='2'/><circle cx='17.5' cy='13.5' r='2.5'/>\
<path d='M15 18h5'/>\
</svg>")}

/* Delete pages (trash over page) */
.icon-delete-pages{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<rect x='4' y='4' width='8' height='14' rx='2'/>\
<path d='M15 7h6M18 7v10M16 7v10M20 7v10'/><path d='M16 7h4l-.5-2h-3z'/>\
</svg>")}

/* Crop pages */
.icon-crop{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2392a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<path d='M7 3v12a2 2 0 0 0 2 2h12'/><path d='M17 21V9a2 2 0 0 0-2-2H3'/>\
</svg>")}

/* PDF/A (doc with A badge) */
.icon-pdfa{background-image:url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'>\
<rect x='3' y='4' width='10' height='14' rx='2'/><circle cx='18' cy='14' r='3'/>\
<path d='M17 15h2l-1-2-1 2z'/>\
</svg>")}


/* crumbs + notices */
.crumbs{margin-bottom:10px;color:var(--muted);font-size:.95rem}
.crumbs a{color:var(--accent);text-decoration:none}
.tool-head h1{margin:0}
.notice{border-radius:10px;padding:10px 12px;margin:12px 0;border:1px solid var(--border);background:color-mix(in oklab,var(--panel) 92%, transparent)}
.notice.success{border-color:color-mix(in oklab,var(--success) 55%, var(--border))}
.notice.warn{border-color:color-mix(in oklab,var(--warn) 55%, var(--border))}

/* uploader */
.uploader .dropzone{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  width:100%;min-height:170px;border:2px dashed var(--border);border-radius:12px;
  background:color-mix(in oklab,var(--panel) 96%, transparent);cursor:pointer;padding:16px;text-align:center;color:var(--muted)
}
.dropzone.dragover{outline:2px solid var(--accent);outline-offset:-6px}
.uploader input[type=file]{opacity:0;width:0;height:0;position:absolute}
.dz-icon{font-size:26px;margin-bottom:6px}
.dz-title{font-weight:700;color:var(--text)}
.dz-sub{font-size:.95rem}

.dz-preview{margin-top:12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
.dz-item{display:flex;align-items:center;gap:10px;background:var(--panel);border:1px solid var(--border);border-radius:10px;padding:10px}
.dz-thumb{width:48px;height:64px;border:1px solid var(--border);border-radius:6px;background:#fff;display:grid;place-items:center;font-weight:800;font-size:.9rem}
.dz-thumb.pdf{background:linear-gradient(180deg,#e11d48,#fee2e2);color:#fff}
.dz-thumb.doc{background:linear-gradient(180deg,#0369a1,#e0f2fe);color:#fff}
.dz-meta{font-size:.9rem;line-height:1.25}
.dz-name{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.dz-size{color:var(--muted)}

/* forms & buttons */
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:12px 0}
label{font-weight:700;display:flex;flex-direction:column;gap:6px}
input[type=number],select{background:#fff;border:1px solid var(--border);color:var(--text);padding:10px;border-radius:10px;outline:none}
body[data-theme="dark"] input[type=number],body[data-theme="dark"] select{background:#0f162b}
input[type=number]:focus,select:focus{border-color:var(--accent)}
.actions{display:flex;align-items:center;gap:10px;margin-top:12px}
.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border-radius:10px;border:1px solid var(--border);cursor:pointer;text-decoration:none;font-weight:700;background:#fff;color:var(--text)}
body[data-theme="dark"] .btn{background:#0f162b}
.btn.primary{background:linear-gradient(135deg,var(--accent),var(--accent-2));border:0;color:#fff}
.btn.ghost{background:transparent}

/* progress + result */
.inline-progress{margin-top:12px;display:flex;align-items:center;gap:8px}
.inline-progress .progress{flex:1}
.inline-progress .progress-text{width:52px;text-align:right;color:var(--muted);font-weight:700}
.progress{height:10px;background:#f1f5f9;border:1px solid var(--border);border-radius:10px;overflow:hidden}
body[data-theme="dark"] .progress{background:#0f162b}
.bar{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent-2))}

.result-strip{margin-top:12px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid var(--border);border-radius:10px;background:color-mix(in oklab,var(--panel) 94%, transparent)}
.result-msg{font-weight:700}
.result-actions{display:flex;gap:8px}

/* FAQ spacing with “Why choose us?” */
.reassurance{margin-top:28px}
.reassurance + .faq{margin-top:28px}

/* ads */
.ad-block{margin:14px 0}
.ad-block > ins{display:block;width:100%;min-height:120px}

/* =========================
   Footer (clean columns)
   ========================= */
.site-footer{border-top:1px solid var(--border);background:color-mix(in oklab,var(--panel) 96%, transparent);margin-top:26px}
.footer-clean{display:grid;grid-template-columns: 220px 1fr; gap: 24px; align-items:flex-start; padding:18px 0}
.footer-brand{display:flex;align-items:flex-start;justify-content:flex-start}
.footer-logo{width:200px!important;height:200px!important;border-radius:16px;object-fit:contain}
.footer-links{display:grid;grid-template-columns:repeat(5,1fr);gap:24px}
.footer-links h4{margin:6px 0 10px}
.footer-links .list-plain{margin:0;padding-left:0;list-style:none}
.footer-links a{text-decoration:none;color:var(--text)}
.footer-links a:hover{color:var(--accent)}
.foot-note{padding:10px 0;color:var(--muted);font-size:.92rem}
@media (max-width:980px){
  .footer-clean{grid-template-columns:1fr}
  .footer-brand{justify-content:center}
  .footer-links{grid-template-columns:repeat(2,1fr)}
}

/* overlay */
.loading-overlay{position:fixed;inset:0;background:rgba(0,0,0,.35);display:none;align-items:center;justify-content:center;z-index:1000}
.loading-card{width:min(520px,92%);background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:18px;text-align:center;box-shadow:var(--shadow)}
.spinner{width:38px;height:38px;margin:0 auto 10px;border:3px solid rgba(0,0,0,.08);border-top-color:var(--accent);border-radius:50%;animation:spin 1s linear infinite}
body[data-theme="dark"] .spinner{border-color:rgba(255,255,255,.12);border-top-color:var(--accent)}
@keyframes spin{to{transform:rotate(360deg)}}

/* =========================
   Social floaters (right side)
   ========================= */
.social-float{
  position: fixed;
  top: 40%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}
.social-float.right{
  right: calc(50vw - 600px - 16px); /* 16px outside the 1200px container */
}
.sf-btn{
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: #fff;
  border: 1px solid rgba(0,0,0,.08);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}
.sf-btn:hover{ transform: translateY(-1px); filter: brightness(1.05); }

/* Brand colors */
.sf-btn.youtube{ background:#FF0000; }
.sf-btn.facebook{ background:#1877F2; }
.sf-btn.x{ background:#0f1419; }
.sf-btn.email{ background:#6366F1; }

[data-theme="dark"] .sf-btn{ border-color: rgba(255,255,255,.12); }

/* Hide floaters on narrow screens */
@media (max-width:1220px){ .social-float{ display:none; } }

/* mobile fallback */
@media (max-width:980px){
  .content-narrow{max-width:100%;padding:0}
}
