/* =========================================================
   PIXOMO — design tokens
   Brand: electric blue, functional per-category accent colors
   Type: Sora (headings, geometric/techy) + Inter (body, neutral)
   ========================================================= */
:root {
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --text: #14171F;
  --text-muted: #5B6270;
  --border: #E6E9EF;
  --brand: #2451FF;
  --brand-dark: #1638C4;

  --cat-convert: #2451FF;
  --cat-convert-soft: #EAF0FF;
  --cat-compress: #00A676;
  --cat-compress-soft: #E5F8F1;
  --cat-edit: #FF6B35;
  --cat-edit-soft: #FFEEE6;
  --cat-create: #A855F7;
  --cat-create-soft: #F6ECFF;
  --cat-tools: #0EA5A5;
  --cat-tools-soft: #E4F8F8;

  --radius-s: 10px;
  --radius-m: 16px;
  --shadow: 0 1px 2px rgba(20,23,31,.04), 0 8px 24px -12px rgba(20,23,31,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.55;
}
h1, h2, h3, .logo, .btn, .tool-card h3 {
  font-family: 'Sora', 'Inter', sans-serif;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; margin-inline-end: auto; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #6C8CFF);
  color: #fff; font-weight: 800; font-size: .95rem;
}
.logo-mark.small { width: 22px; height: 22px; font-size: .75rem; border-radius: 7px; margin-inline-end: 6px; }
.main-nav { display: flex; gap: 24px; font-size: .92rem; font-weight: 500; }
.main-nav a:hover { color: var(--brand); }
.lang-switch { display: flex; gap: 4px; font-size: .78rem; font-weight: 600; }
.lang-switch a { padding: 5px 8px; border-radius: 7px; color: var(--text-muted); }
.lang-switch a.active { background: var(--cat-convert-soft); color: var(--brand); }

@media (max-width: 780px) {
  .main-nav { display: none; }
}

/* ---------- hero / drop zone ---------- */
.hero { padding: 56px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; max-width: 720px; margin: 0 auto 14px; }
.hero p.subtitle { color: var(--text-muted); max-width: 560px; margin: 0 auto 36px; font-size: 1.02rem; }

.dropzone {
  max-width: 640px; margin: 0 auto; padding: 44px 24px;
  border: 2px dashed #C7D2FE; border-radius: var(--radius-m);
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--brand); background: var(--cat-convert-soft); }
.dropzone .dz-icon { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--brand); }
.dropzone p { margin: 0 0 16px; color: var(--text-muted); }
.dropzone input[type=file] { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-s); border: none;
  font-weight: 600; font-size: .95rem; cursor: pointer;
  background: var(--brand); color: #fff; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- category filter tabs ---------- */
.tabs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 36px 0 8px; }
.tabs button {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 600; font-size: .88rem; cursor: pointer;
  color: var(--text-muted);
}
.tabs button.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- tool grid ---------- */
.tool-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin: 32px 0 64px;
}
@media (max-width: 900px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .tool-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  position: relative;
}
.tool-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: transparent; }
.tool-card .icon-box {
  width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
}
.tool-card .icon-box svg { width: 22px; height: 22px; }
.tool-card h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.tool-card p { margin: 0; font-size: .86rem; color: var(--text-muted); }
.tool-card .badge-soon {
  position: absolute; top: 16px; inset-inline-end: 16px;
  font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: #F1F2F5; color: var(--text-muted);
}

.icon-convert  { background: var(--cat-convert-soft);  color: var(--cat-convert); }
.icon-compress { background: var(--cat-compress-soft); color: var(--cat-compress); }
.icon-edit     { background: var(--cat-edit-soft);     color: var(--cat-edit); }
.icon-create   { background: var(--cat-create-soft);   color: var(--cat-create); }
.icon-tools    { background: var(--cat-tools-soft);    color: var(--cat-tools); }

.section-label { text-align: center; font-weight: 700; font-size: 1.3rem; margin: 48px 0 4px; }

/* ---------- tool page (converter/compressor/etc layout) ---------- */
.tool-page-header { text-align: center; padding: 40px 0 8px; }
.tool-page-header h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 8px; }
.tool-page-header p { color: var(--text-muted); }

.tool-app {
  max-width: 640px; margin: 28px auto 80px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-m); padding: 28px;
}
.tool-app .preview { text-align: center; margin-bottom: 20px; }
.tool-app .preview img { max-height: 320px; margin: 0 auto; border-radius: var(--radius-s); border: 1px solid var(--border); }
.tool-app .controls { display: flex; flex-direction: column; gap: 16px; }
.tool-app label { font-size: .85rem; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 6px; }
.tool-app input[type=range] { width: 100%; }
.tool-app input[type=number], .tool-app input[type=text] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit;
}
.tool-app .row { display: flex; gap: 12px; }
.tool-app .row > div { flex: 1; }
.tool-app .actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.tool-app .file-meta { font-size: .82rem; color: var(--text-muted); display: flex; justify-content: space-between; margin-top: 4px; }
.tool-app textarea {
  width: 100%; min-height: 90px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font: inherit; resize: vertical;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text); }
.checkbox-row label { margin: 0; font-weight: 500; color: var(--text); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 32px 0; background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-inner p { margin: 4px 0 0; color: var(--text-muted); font-size: .85rem; }
.footer-rights { font-size: .8rem; }

/* ---------- image cropper ---------- */
.crop-wrap { position: relative; display: inline-block; max-width: 100%; user-select: none; }
.crop-wrap img { display: block; max-width: 100%; max-height: 420px; }
.crop-box {
  position: absolute; border: 2px solid var(--brand);
  background: rgba(36,81,255,.15); cursor: move; touch-action: none;
}
.crop-box.crop-circle { border-radius: 50%; }
.crop-handle {
  position: absolute; width: 16px; height: 16px; right: -8px; bottom: -8px;
  background: var(--brand); border-radius: 4px; cursor: nwse-resize; touch-action: none;
}

/* ---------- RTL adjustments ---------- */
html[dir="rtl"] .tabs, html[dir="rtl"] .actions { direction: rtl; }
