/* Dropbox page — minimal CSS rebuilt 2026-07-19 after accidental over-deletion.
   Tokens (--dbx-*) are PAGE-SPECIFIC (cool graphite palette per page identity).
   Masthead/hero tokens come from /assets/theme.css. */

/* tokens */
:root[data-theme="dark"] {
  --dbx-bg: #0e1014;
  --dbx-panel: #15181f;
  --dbx-surface: #1a1e26;
  --dbx-surface-2: #20252e;
  --dbx-line: #2a2f38;
  --dbx-line-2: #3a414c;
  --dbx-text: #e8eaed;
  --dbx-text-2: #a8acb2;
  --dbx-text-dim: #6b6f76;
  --dbx-accent: #d64545;
  --dbx-accent-soft: rgba(214, 69, 69, 0.15);
  --dbx-success: #5a8f6a;
  --dbx-warning: #c9923a;
  --dbx-danger: #c94c4c;
}
:root[data-theme="light"] {
  --dbx-bg: #fafaf7;
  --dbx-panel: #f0efe9;
  --dbx-surface: #ffffff;
  --dbx-surface-2: #f5f4ee;
  --dbx-line: #d8d6cc;
  --dbx-line-2: #b8b5aa;
  --dbx-text: #1a1a1a;
  --dbx-text-2: #5a5852;
  --dbx-text-dim: #8a8780;
  --dbx-accent: #b03434;
  --dbx-accent-soft: rgba(176, 52, 52, 0.12);
  --dbx-success: #2f6f4a;
  --dbx-warning: #a06b1f;
  --dbx-danger: #a838a8;
}
body {
  background: var(--dbx-bg); color: var(--dbx-text);
  font-family: 'Inter', -apple-system, sans-serif;
  min-height: 100vh;
}

/* (topnav styles come from /assets/theme.css) */

.zone-section { padding: 40px; max-width: 1200px; margin: 0 auto; }
.files-section { padding: 0 40px 40px; max-width: 1200px; margin: 0 auto; }
.cli-section   { padding: 0 40px 40px; max-width: 1200px; margin: 0 auto; }

/* Drop zone */
.dropbox-zone {
  border: 2px dashed var(--dbx-line);
  padding: 60px 40px;
  text-align: center;
  background: var(--dbx-surface);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 24px;
}
.dropbox-zone:hover, .dropbox-zone.dragover {
  border-color: var(--dbx-accent); background: var(--dbx-accent-soft);
}
.zone-icon { font-size: 48px; color: var(--dbx-text-dim); margin-bottom: 12px; }
.zone-title { font-family: var(--serif); font-size: 24px; margin-bottom: 8px; color: var(--dbx-text); }
.zone-sub { font-size: 13px; color: var(--dbx-text-2); }
.zone-sub code { background: var(--dbx-surface-2); padding: 1px 6px; border-radius: 2px; font-family: var(--mono); font-size: 12px; }
#fileInput { display: none; }

.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--dbx-line); margin-bottom: 16px;
}
.section-header h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: 24px; margin: 0; letter-spacing: -0.01em;
}
.section-meta {
  font-family: var(--mono); font-size: 11px; color: var(--dbx-text-dim);
  text-transform: uppercase; letter-spacing: 0.1em;
}

/* File picker bar */
.file-picker {
  background: var(--dbx-surface); border: 1px solid var(--dbx-line);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.fp-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.fp-name {
  font-family: var(--mono); font-size: 13px; color: var(--dbx-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fp-size { font-family: var(--mono); font-size: 11px; color: var(--dbx-text-dim); }
.fp-actions { display: flex; gap: 8px; }
.util-btn {
  font-family: var(--mono); font-size: 12px;
  padding: 8px 16px;
  border: 1px solid var(--dbx-line);
  background: var(--dbx-surface-2); color: var(--dbx-text);
  text-transform: uppercase; letter-spacing: 0.08em;
  transition: all 0.15s;
}
.util-btn:hover { border-color: var(--dbx-line-2); }
.util-btn.primary { background: var(--dbx-accent); border-color: var(--dbx-accent); color: white; }
.util-btn.primary:hover { background: #c84242; }
.util-btn.ghost { padding: 8px 12px; }

/* Progress */
.progress { margin-bottom: 16px; position: relative; }
.bar {
  height: 4px; background: var(--dbx-surface-2); border-radius: 2px;
  overflow: hidden;
}
.bar::after {
  content: ""; display: block; height: 100%;
  width: var(--p, 0%); background: var(--dbx-accent);
  transition: width 0.2s;
}
.progress-label {
  font-family: var(--mono); font-size: 11px; color: var(--dbx-text-2);
  margin-top: 6px;
}

/* Result message */
#result { font-family: var(--mono); font-size: 12px; margin-bottom: 16px; }
.ok-tag { background: rgba(90,143,106,0.15); border: 1px solid var(--dbx-success); padding: 6px 10px; }
.err-tag { background: rgba(201,76,76,0.15); border: 1px solid var(--dbx-danger); padding: 6px 10px; }
.url-box {
  font-family: var(--mono); font-size: 12px;
  background: var(--dbx-surface-2); border: 1px solid var(--dbx-line);
  padding: 8px 12px; margin-top: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* File list */
.file-list-head, .file-row {
  display: grid; grid-template-columns: 1fr 100px 100px auto;
  gap: 16px; padding: 12px 16px;
  font-family: var(--mono); font-size: 12px;
  align-items: center;
}
.file-list-head {
  background: var(--dbx-surface-2); border-bottom: 1px solid var(--dbx-line);
  color: var(--dbx-text-dim); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 10px;
}
.file-list { background: var(--dbx-panel); }
.file-row {
  border-bottom: 1px solid var(--dbx-line);
  color: var(--dbx-text-2);
  transition: background 0.15s;
}
.file-row:hover { background: var(--dbx-surface); }
.file-row .col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .col-actions { display: flex; gap: 6px; }
.empty-state {
  padding: 60px 20px; text-align: center;
  font-family: var(--mono); font-size: 12px;
  color: var(--dbx-text-dim);
  background: var(--dbx-panel);
}

/* CLI hint */
.cli-section {
  background: var(--dbx-surface); border: 1px solid var(--dbx-line);
  padding: 24px; margin-top: 24px;
}
.cli-help {
  background: var(--dbx-bg); border: 1px solid var(--dbx-line);
  padding: 12px 16px;
  font-family: var(--mono); font-size: 12px;
  color: var(--dbx-text-2);
  overflow-x: auto;
}
.kv {
  display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px;
  font-family: var(--mono); font-size: 12px;
  padding: 8px 0;
}
.kv .k { color: var(--dbx-text-dim); text-transform: uppercase; font-size: 10px; letter-spacing: 0.1em; }
.kv .v { color: var(--dbx-text-2); word-break: break-word; }

/* Login overlay */
.login-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(8,10,15,0.94);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(10px);
}
.login-overlay[hidden] { display: none; }
.login-card {
  background: var(--dbx-panel); border: 1px solid var(--dbx-line-2);
  padding: 32px; max-width: 360px; width: 100%;
  text-align: center;
}
.login-eyebrow {
  font-family: var(--mono); font-size: 11px; color: var(--dbx-accent);
  text-transform: uppercase; letter-spacing: 0.2em; margin-bottom: 12px;
}
.login-card h2 {
  font-family: var(--serif); font-weight: 400; font-size: 28px;
  margin: 0 0 8px; color: var(--dbx-text);
}
.login-card .hint { font-size: 13px; color: var(--dbx-text-2); margin: 6px 0 20px; }
.login-card .hint.small { font-size: 11px; color: var(--dbx-text-dim); margin-top: 20px; }
.login-card input[type=password] {
  width: 100%; padding: 14px 18px;
  background: var(--dbx-bg); border: 1px solid var(--dbx-line-2);
  border-radius: 4px; color: var(--dbx-text);
  font-size: 18px; text-align: center;
  font-family: var(--mono); letter-spacing: 0.5em;
  margin-bottom: 16px;
}
.login-card input:focus { outline: none; border-color: var(--dbx-accent); }
.login-card button {
  width: 100%; padding: 12px;
  background: var(--dbx-accent); color: white; border: none;
  font-family: var(--mono); font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.15em;
  font-weight: 500;
  transition: background 0.15s;
}
.login-card button:hover { background: #c84242; }
.login-msg { margin-top: 12px; font-family: var(--mono); font-size: 11px; color: var(--dbx-danger); }
.login-card code { background: var(--dbx-bg); padding: 1px 4px; border-radius: 2px; }

/* footer */
.dropbox-footer {
  margin-top: 40px; padding: 20px 40px;
  border-top: 1px solid var(--dbx-line);
  font-family: var(--mono); font-size: 11px; color: var(--dbx-text-dim);
  text-transform: uppercase; letter-spacing: 0.1em;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}

/* responsive */
@media (max-width: 900px) {
  .zone-section, .files-section, .cli-section { padding-left: 20px; padding-right: 20px; }
  .dropbox-zone { padding: 40px 20px; }
  .file-list-head, .file-row { grid-template-columns: 1fr 80px 80px auto; gap: 8px; padding: 10px 12px; font-size: 11px; }
  .dropbox-footer { padding: 20px; flex-direction: column; gap: 12px; }
}

/* ===== Confirm modal (replaces native confirm dialog) ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.12s ease-out;
}
.modal-overlay[hidden] { display: none; }
@keyframes modal-fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--dbx-bg, #0e0f14);
  border: 1px solid var(--dbx-line, #2a2c34);
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modal-slide-up 0.18s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-title {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--dbx-fg, #e6e7eb);
}

.modal-msg {
  margin: 0 0 20px 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--dbx-fg-2, #b4b6c0);
}
.modal-msg strong { color: var(--dbx-fg, #e6e7eb); font-weight: 600; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-modal {
  padding: 10px 18px;
  border: 1px solid var(--dbx-line, #2a2c34);
  border-radius: 6px;
  background: transparent;
  color: var(--dbx-fg, #e6e7eb);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s ease;
}
.btn-modal:hover {
  border-color: var(--dbx-fg-2, #b4b6c0);
  background: rgba(255, 255, 255, 0.04);
}
.btn-modal:focus-visible {
  outline: 2px solid var(--dbx-accent, #d64545);
  outline-offset: 2px;
}
.btn-modal.danger {
  background: var(--dbx-accent, #d64545);
  border-color: var(--dbx-accent, #d64545);
  color: white;
}
.btn-modal.danger:hover {
  background: #c84242;
  border-color: #c84242;
}

/* ===== 3D model badge in filename col ===== */
.badge-3d {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.7;
  vertical-align: middle;
}
.util-btn.view3d {
  background: rgba(214, 69, 69, 0.12);
  border-color: rgba(214, 69, 69, 0.4);
  color: #d64545;
}
.util-btn.view3d:hover {
  background: rgba(214, 69, 69, 0.22);
  border-color: #d64545;
  color: white;
}

/* ===== Inline 3D viewer overlay (full-screen modal) ===== */
.viewer-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--dbx-bg, #0e0f14);
  display: flex; flex-direction: column;
  animation: viewer-fade-in 0.15s ease-out;
}
.viewer-overlay[hidden] { display: none; }
@keyframes viewer-fade-in { from { opacity: 0; } to { opacity: 1; } }

.viewer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--dbx-line, #2a2c34);
  background: var(--dbx-bg, #0e0f14);
  flex-shrink: 0;
}
.viewer-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--dbx-fg, #e6e7eb);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: calc(100vw - 80px);
}
.viewer-close {
  width: 36px; height: 36px;
  border: 1px solid var(--dbx-line, #2a2c34);
  border-radius: 6px;
  background: transparent;
  color: var(--dbx-fg, #e6e7eb);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.1s ease;
}
.viewer-close:hover {
  border-color: #d64545;
  color: #d64545;
}
.viewer-frame {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
  background: var(--dbx-bg, #0e0f14);
}

/* Image lightbox — 100% screen, centered, click to toggle native-size */
.image-frame {
  flex: 1;
  /* contain mode (default): fit-to-screen, centered */
  object-fit: contain;
  width: 100%;
  height: 100%;
  background: var(--dbx-bg, #0e0f14);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  transition: object-fit 0.12s ease;
}
.image-frame.native {
  /* native size: render at 1:1 pixels, can exceed viewport → scrollable */
  object-fit: contain;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  max-width: none;
  cursor: zoom-out;
}
.image-frame:active { cursor: zoom-out; }

.viewer-actions {
  display: flex; gap: 8px; align-items: center;
}
.viewer-actions .viewer-close {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  font-size: 16px;
}
