/* ── GLB-to-USDZ Web — Dark theme ────────────────────────────────── */

:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-surface: #1f2940;
  --bg-hover: #263250;
  --border: #2d3a56;
  --text-primary: #e0e6f0;
  --text-secondary: #8892a8;
  --accent: #4fc3f7;
  --accent-hover: #29b6f6;
  --success: #66bb6a;
  --error: #ef5350;
  --radius: 8px;
}

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

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── Privacy banner ─────────────────────────────────────────────── */

#privacy-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}

.privacy-icon {
  font-size: 15px;
}

/* ── Layout ─────────────────────────────────────────────────────── */

#app {
  display: grid;
  grid-template-columns: 1fr 300px;
  height: calc(100vh - 41px);
}

/* ── 3D Viewer area ─────────────────────────────────────────────── */

#viewer-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  overflow: hidden;
}

model-viewer {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

/* ── Drop zone ──────────────────────────────────────────────────── */

#drop-zone {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s, border-color 0.15s;
}

#drop-zone.has-model {
  pointer-events: none;
  opacity: 0;
}

#drop-zone.drag-over {
  background: rgba(79, 195, 247, 0.08);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  margin: 16px;
}

.drop-icon {
  font-size: 48px;
  opacity: 0.4;
}

.drop-text {
  font-size: 16px;
  color: var(--text-secondary);
}

.drop-hint {
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0.6;
}

#file-input {
  display: none;
}

/* ── Sidebar ────────────────────────────────────────────────────── */

#sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.sidebar-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-section:first-child {
  padding-top: 0;
}

.sidebar-section:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ── File info ──────────────────────────────────────────────────── */

.file-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
}

.file-info-label {
  color: var(--text-secondary);
}

.file-info-value {
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
  max-width: 180px;
}

/* ── Buttons ────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  width: 100%;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #0d1b2a;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

/* ── Progress bar ───────────────────────────────────────────────── */

.progress-container {
  display: none;
}

.progress-container.active {
  display: block;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--bg-primary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

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

.progress-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ── Status ─────────────────────────────────────────────────────── */

#status {
  font-size: 13px;
  min-height: 20px;
  word-break: break-word;
}

#status.success {
  color: var(--success);
}

#status.error {
  color: var(--error);
}

#status.info {
  color: var(--text-secondary);
}

/* ── Sidebar footer ─────────────────────────────────────────────── */

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.sidebar-footer a {
  color: var(--accent);
  text-decoration: none;
}

.sidebar-footer a:hover {
  text-decoration: underline;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 720px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 50vh 1fr;
  }

  #sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
