/* ============================================
   LovelyPDF — Shared Tool Page Styles
   Light mode default · Dark mode via [data-theme="dark"]
   ============================================ */

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

/* ---- LIGHT MODE (default) ---- */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface2: #eeede9;
  --border: #d8d6cf;
  --accent: #e8401a;
  --accent2: #ff6b3d;
  --text: #1a1917;
  --muted: #7a7870;
  --green: #1e9e52;
  --red: #d63030;
  --yellow: #b08000;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Mono', monospace;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ---- DARK MODE ---- */
[data-theme="dark"] {
  --bg: #080809;
  --surface: #111113;
  --surface2: #18181c;
  --border: #2a2a30;
  --accent: #e8401a;
  --accent2: #ff6b3d;
  --text: #f0eff4;
  --muted: #7a7a88;
  --green: #2ecc71;
  --red: #e84040;
  --yellow: #f0c040;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* NAV */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.back-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--text); }

.nav-sep { color: var(--border); }

.nav-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

/* THEME TOGGLE */
.theme-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  transition: all 0.2s;
  margin-left: auto;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* PAGE LAYOUT */
.page-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 50px 24px 80px;
}

.page-header { margin-bottom: 36px; }

.tool-label {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.page-header h1 {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.page-header p { color: var(--muted); font-size: 13px; max-width: 500px; }

/* DROP ZONE */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface);
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(232, 64, 26, 0.04);
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-icon { font-size: 40px; margin-bottom: 14px; }
.drop-title { font-family: var(--font-head); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.drop-sub { color: var(--muted); font-size: 12px; }

/* FILE LIST */
.file-list { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.file-icon { font-size: 20px; flex-shrink: 0; }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); font-size: 11px; flex-shrink: 0; }
.file-remove {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 16px; padding: 0 4px;
  transition: color 0.2s; flex-shrink: 0;
}
.file-remove:hover { color: var(--red); }

/* SECTION */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}
.section-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

/* BUTTONS */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
  margin-top: 20px;
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* PROGRESS */
.progress-wrap { margin-top: 20px; display: none; }
.progress-label {
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
  display: flex; justify-content: space-between;
}
.progress-bar { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; transition: width 0.3s ease; }

/* DOWNLOAD BOX */
.download-box {
  display: none;
  background: var(--surface);
  border: 1px solid rgba(46,204,113,0.3);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.download-box.show { display: block; }
.download-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--green); margin-bottom: 6px; }
.download-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }

.timer-display {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--yellow);
  background: rgba(176,128,0,0.08);
  border: 1px solid rgba(176,128,0,0.2);
  padding: 5px 12px; border-radius: 20px; margin-bottom: 16px;
}
[data-theme="dark"] .timer-display {
  color: #f0c040;
  background: rgba(240,192,64,0.1);
  border-color: rgba(240,192,64,0.2);
}

.timer-bar { height: 3px; background: var(--surface2); border-radius: 2px; margin: 10px 0 20px; overflow: hidden; }
.timer-fill { height: 100%; background: var(--yellow); border-radius: 2px; width: 100%; transition: width 1s linear; }

.btn-download {
  background: var(--green); color: #fff; border: none;
  border-radius: 8px; padding: 14px 32px;
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-download:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-download:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.expired-msg { display: none; font-size: 13px; color: var(--red); margin-top: 10px; }

/* FORM CONTROLS */
label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }

input[type="text"], input[type="number"], select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  width: 100%;
  transition: border-color 0.2s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

/* ALERTS */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 12.5px;
  margin-top: 12px; display: flex; align-items: flex-start; gap: 8px;
}
.alert-warn { background: rgba(176,128,0,0.08); border: 1px solid rgba(176,128,0,0.2); color: var(--yellow); }
.alert-info { background: rgba(100,180,255,0.08); border: 1px solid rgba(100,180,255,0.2); color: #2277bb; }
[data-theme="dark"] .alert-warn { background: rgba(240,192,64,0.08); border-color: rgba(240,192,64,0.2); color: #f0c040; }
[data-theme="dark"] .alert-info { color: #7cc4ff; }

@media (max-width: 600px) {
  nav { padding: 0 20px; }
  .page-wrap { padding: 30px 16px 60px; }
}

/* THEME SCRIPT — inline in every tool page */
