/* ──────────────────────────────────────────────────────────────────────────
 * File Tools — global stylesheet
 * Refined minimal SaaS aesthetic: warm-white surface, confident blue accent,
 * generous whitespace, Plus Jakarta Sans throughout.
 * ──────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-tint: #dbeafe;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --success: #10b981;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.04), 0 1px 3px rgb(15 23 42 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(15 23 42 / 0.06), 0 2px 4px -2px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 20px 40px -12px rgb(37 99 235 / 0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

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

/* ── Layout ────────────────────────────────────────────────────────────── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  min-height: calc(100vh - 200px);
}

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover {
  text-decoration: none;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-md);
}

.nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.94rem;
}
.nav a:hover {
  color: var(--text);
  text-decoration: none;
}

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

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 18px;
}
.hero h1 .accent {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* ── Tool grid ─────────────────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  padding: 40px 0 80px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: block;
  color: var(--text);
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-tint);
  text-decoration: none;
}
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-tint);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  font-size: 22px;
}
.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.tool-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ── Tool page layout ──────────────────────────────────────────────────── */
.tool-page {
  padding: 40px 0 80px;
}
.tool-page .breadcrumb {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.tool-page h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  font-weight: 800;
}
.tool-page .lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
  max-width: 700px;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 960px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Drop zone ─────────────────────────────────────────────────────────── */
.dropzone {
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover,
.dropzone.is-drag {
  border-color: var(--primary);
  background: #f8fafc;
}
.dropzone-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  font-size: 26px;
}
.dropzone h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.dropzone p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin-bottom: 20px;
}
.dropzone input[type='file'] {
  display: none;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgb(37 99 235 / 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-primary:disabled {
  background: var(--border-strong);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  text-decoration: none;
}

/* ── Options panel (e.g. quality slider, target KB input) ──────────────── */
.options {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 20px;
  display: grid;
  gap: 18px;
}
.options label {
  font-weight: 600;
  font-size: 0.94rem;
  display: block;
  margin-bottom: 8px;
}
.options input[type='number'],
.options input[type='text'],
.options select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.options input[type='range'] {
  width: 100%;
  accent-color: var(--primary);
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px;
}

/* ── Progress bar ──────────────────────────────────────────────────────── */
.progress {
  width: 100%;
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  width: 0;
  transition: width 0.3s;
}

/* ── Result card ───────────────────────────────────────────────────────── */
.result {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.result h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
}
.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.result-stat {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.result-stat .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.result-stat .value {
  font-weight: 700;
  font-size: 1.15rem;
  margin-top: 2px;
}
.result-stat .value.saved {
  color: var(--success);
}

.download-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.download-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.download-list a:hover {
  background: var(--primary-tint);
  text-decoration: none;
}

/* ── Status messages ───────────────────────────────────────────────────── */
.status {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 0.94rem;
  display: none;
}
.status.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  display: block;
}
.status.info {
  background: var(--primary-tint);
  color: var(--primary-hover);
  display: block;
}

/* ── File list (multi-upload) ──────────────────────────────────────────── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
.file-item .name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item .size {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.file-item button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px 8px;
}
.file-item button:hover {
  color: var(--danger);
}

/* ── Sidebar (ad + info) ───────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.info-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.info-box ul {
  list-style: none;
  padding: 0;
}
.info-box li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 4px 0;
  display: flex;
  gap: 8px;
}
.info-box li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
}

/* ── Ad slots (placeholders) ───────────────────────────────────────────── */
.ad-slot {
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 24px;
  margin: 24px 0;
  min-height: 90px;
}
.ad-slot.banner {
  min-height: 90px;
}
.ad-slot.sidebar-ad {
  min-height: 280px;
}

/* ── SEO content section ───────────────────────────────────────────────── */
.seo-section {
  margin-top: 60px;
  max-width: 760px;
}
.seo-section h2 {
  font-size: 1.5rem;
  margin: 32px 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.seo-section h3 {
  font-size: 1.1rem;
  margin: 22px 0 8px;
  font-weight: 700;
}
.seo-section p,
.seo-section li {
  color: #334155;
  font-size: 1rem;
  line-height: 1.75;
}
.seo-section ul,
.seo-section ol {
  padding-left: 22px;
  margin: 8px 0 16px;
}
.seo-section li {
  margin-bottom: 6px;
}

/* FAQ */
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 8px;
}
.faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: '+';
  float: right;
  color: var(--primary);
  font-weight: 700;
}
.faq details[open] summary::after {
  content: '−';
}
.faq details > p {
  margin-top: 10px;
  color: var(--text-muted);
}

/* ── Footer ────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 40px 0 30px;
  margin-top: 60px;
}
footer .container {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 32px;
}
@media (max-width: 720px) {
  footer .container {
    grid-template-columns: 1fr;
  }
}
footer h5 {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
footer ul {
  list-style: none;
  padding: 0;
}
footer ul a {
  color: var(--text);
  font-size: 0.94rem;
  display: block;
  padding: 4px 0;
}
.copyright {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
