/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --surface: rgba(255,255,255,0.025);
  --border: #1e293b;
  --accent: #6366f1;
  --accent2: #a855f7;
  --text: #e2e8f0;
  --muted: #475569;
  --font: 'DM Mono', 'Fira Code', 'Courier New', monospace;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

/* ── Header ───────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(10,10,20,0.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-logo { display: flex; align-items: center; gap: 14px; }

.logo-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
}

.logo-title {
  display: block;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.07em; color: #f1f5f9;
}

.logo-file {
  display: block;
  font-size: 11px; color: var(--accent);
  min-height: 14px;
}

/* ── Nav ──────────────────────────────────────── */
.header-nav { display: flex; gap: 8px; }

.nav-btn {
  padding: 7px 18px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: all 0.18s;
}

.nav-btn:hover { border-color: var(--accent); color: #c7d2fe; }

.nav-btn.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

/* ── Main ─────────────────────────────────────── */
.main {
  min-height: calc(100vh - 73px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 24px 80px;
}

.panel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.hidden { display: none !important; }

/* ── Dropzone ─────────────────────────────────── */
.dropzone {
  width: 100%; max-width: 540px;
  border: 2px dashed var(--border);
  border-radius: 20px;
  padding: 72px 40px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 0;
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(99,102,241,0.06);
  box-shadow: 0 0 40px rgba(99,102,241,0.15);
}

.drop-icon { font-size: 56px; margin-bottom: 18px; transition: transform 0.2s; }
.dropzone.drag-over .drop-icon { transform: scale(1.1); }

.drop-title { font-size: 18px; font-weight: 700; color: #f1f5f9; margin-bottom: 10px; }
.drop-sub { font-size: 13px; color: var(--muted); margin-bottom: 30px; }

#fileInput { display: none; }

/* ── Buttons ──────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: 8px;
  color: #fff; font-family: var(--font);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.07em; cursor: pointer;
  box-shadow: 0 4px 20px rgba(99,102,241,0.25);
  transition: opacity 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { opacity: 0.88; box-shadow: 0 6px 28px rgba(99,102,241,0.38); }

.btn-sm { padding: 7px 20px; font-size: 12px; }

/* ── Toolbar ──────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

.toolbar-label { font-size: 12px; color: #64748b; margin-right: 4px; }

.zoom-btn {
  padding: 5px 15px; border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: #64748b;
  font-family: var(--font); font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.zoom-btn:hover { border-color: var(--accent); color: #c7d2fe; }
.zoom-btn.active {
  border-color: var(--accent);
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
}

/* ── Phone Shell ──────────────────────────────── */
.phone-wrap {
  display: flex; justify-content: center;
  transition: transform 0.2s;
  transform-origin: top center;
}

.phone-shell {
  width: 418px; height: 900px;
  background: linear-gradient(160deg, #1e293b, #0f172a);
  border-radius: 52px;
  padding: 28px 14px;
  box-shadow:
    0 0 0 1px #334155,
    0 0 0 3px #0f172a,
    0 0 0 4.5px #475569,
    0 40px 80px rgba(0,0,0,0.72),
    inset 0 1px 0 rgba(255,255,255,0.07);
  position: relative;
}

.phone-notch {
  position: absolute; top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 10px;
  background: #0a0a0f; border-radius: 10px;
}

.phone-screen {
  width: 100%; height: 100%;
  border-radius: 40px; overflow: hidden; background: #fff;
}

.phone-home {
  position: absolute; bottom: 10px; left: 50%;
  transform: translateX(-50%);
  width: 100px; height: 4px;
  background: #334155; border-radius: 4px;
}

.phone-screen iframe { width: 100%; height: 100%; border: none; display: block; }

/* ── PDF Sheet ────────────────────────────────── */
.pdf-wrap {
  display: flex; justify-content: center;
  transition: transform 0.2s;
  transform-origin: top center;
}

.pdf-sheet {
  width: 794px; height: 1123px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25), 0 24px 64px rgba(0,0,0,0.45);
  position: relative; overflow: hidden;
}

.pdf-fold {
  position: absolute; top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 26px 26px 0;
  border-color: transparent var(--bg) transparent transparent;
  z-index: 2;
}

.pdf-sheet iframe { width: 100%; height: 100%; border: none; display: block; }

/* ── Labels ───────────────────────────────────── */
.view-label {
  font-size: 12px; color: var(--muted);
  margin-top: 4px; text-align: center;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 860px) {
  .header { padding: 14px 18px; }
  .header-nav { gap: 6px; }
  .nav-btn { padding: 6px 12px; font-size: 11px; }
  .phone-shell { width: 320px; height: 692px; border-radius: 42px; }
  .phone-notch { width: 90px; }
  .phone-screen { border-radius: 32px; }
  .pdf-sheet { width: 600px; height: 848px; }
  .dropzone { padding: 48px 24px; }
}

@media (max-width: 640px) {
  .header-logo .logo-title { font-size: 12px; }
  .phone-shell { width: 260px; height: 562px; border-radius: 36px; }
  .pdf-sheet { width: 340px; height: 481px; }
}
