/* ═══════════════════════════════════════════
   TidyPDF — Shared Stylesheet
   tidypdf.io
════════════════════════════════════════════ */

/* ─── DARK THEME (default) ─── */
/* Font swap: Plus Jakarta Sans replaces Syne for headings */
:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a26;
  --border: #ffffff12;
  --accent: #ff6b35;
  --accent2: #ffd166;
  --text: #f0f0f8;
  --muted: #8888aa;
  --success: #06d6a0;
  --card-hover: #1e1e2e;
  --header-bg: rgba(10,10,15,0.88);
  --shadow: rgba(0,0,0,0.3);
}

/* ─── LIGHT THEME ─── */
[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface2: #f0f0f5;
  --border: #00000010;
  --accent: #ff6b35;
  --accent2: #e6a800;
  --text: #111118;
  --muted: #666680;
  --success: #00a878;
  --card-hover: #fafafa;
  --header-bg: rgba(245,245,247,0.92);
  --shadow: rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
  max-width: 1440px;
  margin: 0 auto;
}

/* ─── HEADER ─── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  transition: background 0.3s;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}

.logo {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.hero-tagline {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex: 1;
  justify-content: center;
}

.tagline-text { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.tagline-pills { display: flex; gap: 0.5rem; }

.tagline-pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  white-space: nowrap;
}

.pill-green  { background: rgba(6,214,160,0.1);   color: var(--success); border: 1px solid rgba(6,214,160,0.2); }
.pill-orange { background: rgba(255,107,53,0.1);  color: var(--accent);  border: 1px solid rgba(255,107,53,0.25); }
.pill-purple { background: rgba(120,120,220,0.1); color: #aaaaff;        border: 1px solid rgba(120,120,220,0.2); }

.header-controls { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

nav { display: flex; gap: 1.5rem; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
nav a:hover, nav a.active { color: var(--accent); }

/* ─── THEME TOGGLE ─── */
.theme-toggle {
  width: 40px; height: 22px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
  padding: 0;
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s ease;
}

[data-theme="light"] .theme-toggle::after { transform: translateX(18px); }

.theme-toggle-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 0.6rem;
  pointer-events: none;
}

/* ─── AD SLOTS ─── */
.ad-banner { max-width: 1200px; margin: 1rem auto; padding: 0 2rem; }

.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ad-slot-square {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1rem;
}

/* ─── PAGE INTRO ─── */
.page-intro {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.page-intro h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: 600px;
}

.page-intro h1 span { color: var(--accent); }
.page-intro p { font-size: 0.9rem; color: var(--muted); }

/* ─── TOOL PAGE HERO ─── */
.tool-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
}

.tool-hero-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.tool-hero-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.tool-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--text);
}

.tool-hero h1 span { color: var(--accent); }

.tool-hero-sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  max-width: 600px;
}

.breadcrumb {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { opacity: 0.5; }

/* ─── TOOL WORKSPACE (full-width on tool pages) ─── */
.tool-workspace {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

.tool-main { min-width: 0; }

.tool-sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* ─── TOOLS GRID (homepage) ─── */
.tools-section { max-width: 1200px; margin: 0 auto; padding: 1.5rem 2rem 4rem; }

.section-label {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  animation: fadeUp 0.5s ease both;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(255,107,53,0.05));
  opacity: 0;
  transition: opacity 0.3s;
}

.tool-card:hover {
  border-color: rgba(255,107,53,0.4);
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(255,107,53,0.1), 0 4px 12px var(--shadow);
}

.tool-card:hover::before { opacity: 1; }

.tool-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.tool-card h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.tool-card p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  padding: 0.18rem 0.55rem;
  border-radius: 100px;
  font-weight: 500;
}

.badge-free    { background: rgba(6,214,160,0.1);   color: var(--success); border: 1px solid rgba(6,214,160,0.2); }
.badge-fast    { background: rgba(255,209,102,0.1); color: var(--accent2); border: 1px solid rgba(255,209,102,0.2); }
.badge-private { background: rgba(120,120,200,0.1); color: #aaaaff;        border: 1px solid rgba(120,120,200,0.2); }

.tool-arrow {
  position: absolute;
  top: 1.8rem;
  right: 1.8rem;
  color: var(--muted);
  font-size: 1.1rem;
  transition: all 0.3s;
}

.tool-card:hover .tool-arrow { color: var(--accent); transform: translate(3px, -3px); }

/* ─── TOOL PANEL (dropzone, options, progress, result) ─── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  background: var(--surface2);
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(255,107,53,0.05);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.dropzone h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.dropzone p { color: var(--muted); font-size: 0.85rem; }

.file-list { display: none; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }
.file-list.visible { display: flex; }

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.file-item-icon { font-size: 1.2rem; }
.file-item-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.file-item-size { color: var(--muted); font-size: 0.75rem; }

.file-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  transition: color 0.2s;
}
.file-remove:hover { color: #ff4444; }

.tool-options { margin-top: 1.5rem; }

.option-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: block;
}

.option-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.option-btn {
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.option-btn:hover, .option-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,107,53,0.1);
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.action-btn:hover { background: #ff8555; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,107,53,0.4); }
.action-btn:hover::before { transform: translateX(100%); }
.action-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.progress-wrap { margin-top: 1.5rem; display: none; }
.progress-wrap.visible { display: block; }

.progress-bar-bg {
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text { font-size: 0.8rem; color: var(--muted); text-align: center; }

.result-box {
  display: none;
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: rgba(6,214,160,0.08);
  border: 1px solid rgba(6,214,160,0.2);
  border-radius: 12px;
  text-align: center;
}

.result-box.visible { display: block; }
.result-box p { color: var(--success); font-weight: 500; margin-bottom: 1rem; }

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--success);
  color: #000;
  border: none;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.download-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* ─── OTHER TOOLS STRIP ─── */
.other-tools {
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: 1rem;
}

.other-tools h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.other-tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.other-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.other-tool-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,107,53,0.08);
}

/* ─── HOW IT WORKS ─── */
.how-section { max-width: 1200px; margin: 0 auto 5rem; padding: 0 2rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }

.step { display: flex; gap: 1rem; align-items: flex-start; }

.step-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--accent);
  opacity: 0.25;
  line-height: 1.2;
  min-width: 2.5rem;
  flex-shrink: 0;
}

.step h4 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; }
.step p { font-size: 0.82rem; color: var(--muted); }

/* ─── FAQ ─── */
.faq-section { max-width: 800px; margin: 0 auto 5rem; padding: 0 2rem; }

.faq-item { border-bottom: 1px solid var(--border); padding: 1.1rem 0; }

.faq-q {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.faq-q::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.3s;
  min-width: 1rem;
  text-align: center;
}

.faq-item.open .faq-q::after { transform: rotate(45deg); }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.faq-item.open .faq-a { max-height: 300px; padding-top: 0.75rem; }

/* ─── FOOTER ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

footer strong { color: var(--text); font-family: 'Plus Jakarta Sans', sans-serif; }

.footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-top: 0.75rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.78rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

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

/* ─── TRANSITIONS ─── */
.tool-card, .dropzone, .file-item,
.ad-slot, .ad-slot-square, footer { transition: background 0.3s, border-color 0.3s, color 0.3s; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .tool-workspace { grid-template-columns: 1fr; }
  .tool-sidebar { display: none; }
}

@media (max-width: 768px) {
  .hero-tagline { display: none; }
}

@media (max-width: 600px) {
  nav { display: none; }
  .tools-grid { grid-template-columns: 1fr; }
  .page-intro h1 { font-size: 1.3rem; }
  .tool-hero h1 { font-size: 1.5rem; }
}
