/* ═══════════════════════════════════════════════════════════════════
   PDFTools — styles.css
   Theme: Dark · Technical · Teal accent
   Fonts: Syne (brand) · IBM Plex Mono (UI/labels) · IBM Plex Sans (body)
═══════════════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Colors */
  --void:      #080b0f;
  --bg:        #0d1117;
  --surface:   #111820;
  --surface-2: #161e28;
  --border:    #1e2d3d;
  --border-hi: #2a3f55;
  --teal:      #00d4aa;
  --teal-dim:  rgba(0, 212, 170, .12);
  --teal-glow: rgba(0, 212, 170, .06);
  --amber:     #f59e0b;
  --red:       #ef4444;
  --green:     #10b981;
  --text:      #e2eaf3;
  --text-2:    #8899aa;
  --text-3:    #4a5d70;

  /* Typography */
  --font-brand: 'Syne', sans-serif;
  --font-mono:  'IBM Plex Mono', 'Courier New', monospace;
  --font-body:  'IBM Plex Sans', system-ui, sans-serif;

  /* Spacing */
  --gap:    20px;
  --radius: 6px;

  /* Shadows */
  --shadow-card: 0 0 0 1px var(--border), 0 4px 24px rgba(0,0,0,.4);
  --shadow-glow: 0 0 32px rgba(0, 212, 170, .15);
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ── Background ──────────────────────────────────────────────────── */
.bg-grid {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(30,45,61,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,45,61,.35) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black, transparent);
}
.bg-glow {
  pointer-events: none;
  position: fixed; top: -200px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px; z-index: 0;
  background: radial-gradient(ellipse, rgba(0,212,170,.08), transparent 70%);
}

/* ── Nav ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-brand);
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.5px; color: var(--text);
}
.logo-bracket { color: var(--text-3); }
.logo-accent  { color: var(--teal); }

.nav-meta {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}
.nav-sep { opacity: .4; }
.nav-tag { letter-spacing: .5px; }
.nav-tag--live { color: var(--green); animation: blink 2.5s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Main Layout ─────────────────────────────────────────────────── */
.main {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: 32px 24px 64px;
}
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

/* ── Panel Base ──────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: var(--gap);
}
.panel:last-child { margin-bottom: 0; }

.panel-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 2px; color: var(--text-3);
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); padding: 14px 20px 10px;
}
.panel-header .panel-label {
  padding: 0; border: none;
}

/* ── Upload / Drop Zone ───────────────────────────────────────────── */
.panel--upload { overflow: visible; } /* let outline bleed */

.drop-zone {
  position: relative;
  margin: 16px;
  border: 1.5px dashed var(--border-hi);
  border-radius: var(--radius);
  min-height: 220px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color .2s, background .2s, box-shadow .2s;
  outline: none;
}
.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--teal);
  background: var(--teal-glow);
  box-shadow: 0 0 0 4px rgba(0,212,170,.08);
}
.drop-zone.is-active {
  border-color: var(--teal);
  border-style: solid;
  background: var(--teal-glow);
  box-shadow: 0 0 0 4px rgba(0,212,170,.12), var(--shadow-glow);
}

.dz-inner {
  text-align: center; padding: 24px; pointer-events: none;
}
.dz-icon {
  color: var(--teal); margin-bottom: 14px;
  display: flex; justify-content: center;
  transition: transform .2s;
}
.drop-zone:hover .dz-icon,
.drop-zone.is-active .dz-icon { transform: translateY(-4px); }

.dz-title {
  font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.dz-sub {
  font-size: 13px; color: var(--text-2); margin-bottom: 12px;
}
.dz-browse {
  background: none; border: none; padding: 0;
  color: var(--teal); font-family: var(--font-mono); font-size: 13px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
  pointer-events: all;
}
.dz-browse:hover { color: #00ffcc; }
.dz-limit {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  letter-spacing: .3px;
}

.dz-overlay {
  pointer-events: none;
  position: absolute; inset: 0; border-radius: inherit;
  background: rgba(0,212,170,.06);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.drop-zone.is-active .dz-overlay { opacity: 1; }
.dz-overlay-text {
  font-family: var(--font-brand); font-size: 20px;
  font-weight: 700; color: var(--teal);
}

/* ── File Queue ───────────────────────────────────────────────────── */
.btn-link {
  background: none; border: none; padding: 0;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
  letter-spacing: .5px;
}
.btn-link:hover { color: var(--red); }

.file-list {
  padding: 8px 0;
}
.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  animation: fadeSlideIn .18s ease both;
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--surface-2); }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.fi-order {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
  min-width: 20px; flex-shrink: 0;
}
.fi-icon { font-size: 18px; flex-shrink: 0; }
.fi-info { flex: 1; min-width: 0; }
.fi-name {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: var(--text); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; margin-bottom: 2px;
}
.fi-meta {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
}
.fi-remove {
  background: none; border: none; padding: 4px 8px;
  color: var(--text-3); font-size: 16px; line-height: 1;
  border-radius: 3px; flex-shrink: 0;
  transition: background .12s, color .12s;
}
.fi-remove:hover {
  background: rgba(239,68,68,.15); color: var(--red);
}

.queue-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
}
.queue-stat {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}

/* ── Tool Cards ───────────────────────────────────────────────────── */
.panel--tools .panel-label {
  border-bottom: 1px solid var(--border);
}
.tool-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; /* cards are visually separated by borders */
}

.tool-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px 20px;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background .15s;
}
.tool-card:last-child { border-right: none; }
.tool-card:hover { background: var(--surface-2); }

/* top accent line on hover */
.tool-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--teal);
  opacity: 0; transition: opacity .2s;
}
.tool-card:hover::before { opacity: 1; }

.tool-card-top {
  display: flex; align-items: flex-start; gap: 12px;
}
.tool-icon {
  width: 40px; height: 40px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid;
}
.tool-icon--merge   { color: var(--teal);  border-color: rgba(0,212,170,.3);  background: rgba(0,212,170,.06); }
.tool-icon--split   { color: #7dd3fc;       border-color: rgba(125,211,252,.3); background: rgba(125,211,252,.06); }
.tool-icon--compress{ color: var(--amber);  border-color: rgba(245,158,11,.3);  background: rgba(245,158,11,.06); }

.tool-name {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--text); margin-bottom: 4px;
}
.tool-desc {
  font-size: 12px; color: var(--text-2); line-height: 1.5;
}

.tool-reqs {
  margin: 0;
}
.req-badge {
  display: inline-block;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 3px 8px; letter-spacing: .3px;
}

/* ── Action Button ────────────────────────────────────────────────── */
.btn-action {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 11px 14px;
  background: var(--surface-2); border: 1px solid var(--border-hi);
  border-radius: 4px; color: var(--text);
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  transition: all .15s;
  margin-top: auto;
}
.btn-action:hover:not(:disabled) {
  background: var(--teal); border-color: var(--teal);
  color: var(--void); box-shadow: 0 0 20px rgba(0,212,170,.3);
}
.btn-action:active:not(:disabled) {
  transform: translateY(1px);
}
.btn-action:disabled {
  opacity: .3; cursor: not-allowed;
}
.btn-action.is-loading {
  background: var(--teal-dim); border-color: var(--teal);
  color: var(--teal); pointer-events: none;
  justify-content: center; gap: 10px;
}
.btn-text  { flex: 1; text-align: left; }
.btn-arrow { font-size: 16px; transition: transform .15s; }
.btn-action:hover:not(:disabled) .btn-arrow { transform: translateX(3px); }

.btn-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(0,212,170,.3);
  border-top-color: var(--teal);
  animation: spin .65s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Status Panel ─────────────────────────────────────────────────── */
.panel--status .status-body {
  padding: 24px 20px;
  min-height: 100px;
}

/* Loading */
.state-loading {
  display: flex; flex-direction: column; gap: 14px;
}
.loading-bar-wrap {
  height: 3px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.loading-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--teal), #00ffcc);
  border-radius: 999px;
  transition: width .35s ease;
  animation: shimmer 1.8s ease-in-out infinite;
  background-size: 200% 100%;
}
@keyframes shimmer {
  0%,100% { background-position: 0% 50%; }
  50%     { background-position: 100% 50%; }
}
.loading-msg {
  font-family: var(--font-mono); font-size: 13px; color: var(--text-2);
}

/* Success */
.state-success {
  display: flex; align-items: center; gap: 16px;
  animation: fadeSlideIn .25s ease;
}
.success-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3);
  color: var(--green); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.success-info { flex: 1; }
.success-title {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--green); margin-bottom: 3px;
}
.success-detail {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}
.btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  background: var(--green); border: none; border-radius: 4px;
  color: var(--void); font-family: var(--font-mono);
  font-size: 12px; font-weight: 600; text-decoration: none;
  transition: all .15s; white-space: nowrap; cursor: pointer;
  flex-shrink: 0;
}
.btn-download:hover {
  background: #34d399; box-shadow: 0 0 20px rgba(16,185,129,.4);
  transform: translateY(-1px);
}

/* Error */
.state-error {
  display: flex; align-items: center; gap: 16px;
  animation: fadeSlideIn .25s ease;
}
.error-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  color: var(--red); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.error-info { flex: 1; }
.error-title {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--red); margin-bottom: 3px;
}
.error-detail {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  line-height: 1.5;
}
.btn-retry {
  padding: 9px 16px;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3);
  border-radius: 4px; color: var(--red);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  transition: all .15s; flex-shrink: 0; white-space: nowrap;
}
.btn-retry:hover {
  background: rgba(239,68,68,.2); border-color: var(--red);
}

/* ── Hint Box ─────────────────────────────────────────────────────── */
.hint-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-card);
}
.hint-line {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-mono); font-size: 13px; color: var(--text-2);
}
.hint-num {
  font-size: 11px; color: var(--teal); min-width: 20px;
  font-weight: 600; letter-spacing: 1px;
}
.hint-num--note { color: var(--amber); }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: 16px 0;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.footer-copy,
.footer-endpoint {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { border-right: none; border-bottom: 1px solid var(--border); }
  .tool-card:last-child { border-bottom: none; }
  .state-success,
  .state-error { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .main { padding: 20px 16px 48px; }
  .nav-meta { display: none; }
  .drop-zone { min-height: 180px; }
  .footer-endpoint { display: none; }
}
