/* HiddenPrints – NFC Keychain page styles.
   Loaded before css/tabs.css, so the shared header, popup and scrollbar rules there win. */

@import url('https://fonts.googleapis.com/css2?family=Karla:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --bg: #0a0a0a;
  --panel: #111111;
  --border: #2a2a2a;
  --accent: #e8132a;
  --accent2: #c0392b;
  --accent3: #ff4d4d;
  --text: #e0e0e0;
  --muted: #666666;
  --surface: #1a1a1a;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  gap: 24px;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

.logo {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: -0.5px;
  white-space: nowrap;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.logo span { color: var(--muted); font-weight: 400; }

.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #c0101f; }
.btn.danger { border-color: var(--accent3); color: var(--accent3); }
.btn.danger:hover { background: rgba(255,77,77,0.1); }

.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}


.left-panel {
  width: 260px;
  border-right: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.panel-section {
  border-bottom: 1px solid var(--border);
  padding: 14px;
}

.panel-label {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  font-family: 'Karla',sans-serif;
  font-weight: 600;
}

.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(232,19,42,0.06);
}
.upload-zone svg { margin-bottom: 6px; }
.upload-zone p { font-size: 11px; color: var(--muted); line-height: 1.5; }
.upload-zone strong { color: var(--accent); }
input[type=file] { display: none; }

.objects-list {
  overflow-y: visible;
  padding: 8px;
  min-height: 60px;
}

.object-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 4px;
  transition: all 0.15s;
}
.object-item:hover { background: var(--surface); }
.object-item.selected { border-color: var(--accent); background: rgba(232,19,42,0.07); }

.obj-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.2);
}

.obj-name {
  flex: 1;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.obj-del {
  opacity: 0;
  background: none;
  border: none;
  color: var(--accent3);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}
.object-item:hover .obj-del { opacity: 1; }


.base-model-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 5px;
  border: 1px solid var(--border);
}
.base-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent2);
  flex-shrink: 0;
}
.base-text { font-size: 11px; color: var(--muted); }
.base-name { font-size: 11px; color: var(--text); }


.viewport-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

#viewport {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.viewport-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

.view-badge {
  background: rgba(20,20,24,0.85);
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 10px;
  color: var(--muted);
  border-radius: 3px;
  backdrop-filter: blur(8px);
}

.grid-toggle {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}


.right-panel {
  width: 240px;
  border-left: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
#propsPanel {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.prop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.prop-label {
  font-size: 10px;
  color: var(--muted);
  min-width: 60px;
}

.prop-input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
  width: 100px;
  transition: border-color 0.15s;
}
.prop-input:focus { outline: none; border-color: var(--accent); }
.prop-input::-webkit-inner-spin-button { opacity: 0.4; }

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

input[type=range] {
  flex: 1;
  height: 3px;
  accent-color: var(--accent);
  background: var(--border);
  border-radius: 2px;
  cursor: pointer;
}

.slider-val {
  font-size: 10px;
  color: var(--text);
  min-width: 38px;
  text-align: right;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

input[type=color] {
  width: 36px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  padding: 2px;
}

.color-hex {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 3px;
}
.color-hex:focus { outline: none; border-color: var(--accent); }

.no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  gap: 8px;
}


.statusbar {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 26px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  font-size: 10px;
  color: var(--muted);
  gap: 20px;
  flex-shrink: 0;
}
.statusbar .dot { color: var(--accent); }


.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden { display: none; }
.modal-overlay { padding: 12px; }
.modal { max-width: 100%; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }
#viewport { touch-action: none; }
.modal-row.hidden { display: none; }

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  width: 520px;
}

.modal h2 {
  font-family: 'Karla', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
  text-align: center;
}

.modal-row {
  margin-bottom: 12px;
}

.modal-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }

.format-btns {
  display: flex;
  gap: 8px;
}

.format-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 12px;
  cursor: pointer;
  border-radius: 5px;
  text-align: center;
  transition: all 0.15s;
  font-weight: 600;
}
.format-btn:hover, .format-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(232,19,42,0.06); }

.modal-actions { display: flex; gap: 8px; margin-top: 20px; }
.format-btn small { display: block; font-weight: 400; font-size: 10px; color: var(--muted); margin-top: 2px; }
.bed-warn { font-size: 11px; line-height: 1.5; color: var(--accent3); border: 1px solid var(--accent3); background: rgba(255,77,77,0.07); border-radius: 5px; padding: 7px 10px; margin-top: 8px; }  .social-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 4px;
  transition: border-color 0.15s;
}
.social-input:focus { outline: none; border-color: var(--accent); }
.social-input::placeholder { color: var(--muted); }
.social-open {
  width: 26px; height: 26px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  transition: all 0.15s;
  text-decoration: none;
}
.social-open:hover { border-color: var(--accent); color: var(--accent); }



.transform-mode-btns {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.mode-btn {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: 'Karla', sans-serif;
  font-size: 10px;
  cursor: pointer;
  border-radius: 3px;
  text-align: center;
  transition: all 0.15s;
}
.mode-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(232,19,42,0.08); }



.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 8px;
}
.preset-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 10px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(232,19,42,0.06); }
.empty-objects {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}



.extrude-color-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 8px;
}
.extrude-color-btn {
  flex: 1;
  padding: 5px 0;
  border: none;
  background: var(--bg);
  color: var(--muted);
  font-family: 'Karla', sans-serif;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}
.extrude-color-btn + .extrude-color-btn {
  border-left: 1px solid var(--border);
}
.extrude-color-btn.active-white {
  background: #fff;
  color: #111;
}
.extrude-color-btn.active-black {
  background: #111;
  color: #fff;
  border-color: #555;
}
.extrude-color-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}


.text-input-row {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.text-name-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 4px;
  transition: border-color 0.15s;
  min-width: 0;
  letter-spacing: 1px;
}
.text-name-input:focus { outline: none; border-color: var(--accent); }
.text-name-input::placeholder { color: var(--muted); letter-spacing: 0; font-size: 11px; }
.text-place-btn {
  padding: 6px 10px;
  border: 1px solid var(--accent);
  background: rgba(232,19,42,0.1);
  color: var(--accent);
  font-family: 'Karla', sans-serif;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.text-place-btn:hover { background: var(--accent); color: #fff; }
.text-place-btn:disabled { opacity: 0.4; pointer-events: none; }

.text-preview-wrap {
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  text-align: center;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.text-preview-label {
  font-size: 24px;
  color: var(--text);
  letter-spacing: 3px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: font-family 0.1s;
}
.text-font-status {
  font-size: 9px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
  opacity: 0.8;
}


.qr-input-wrap {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.qr-url-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Karla', sans-serif;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 4px;
  transition: border-color 0.15s;
  min-width: 0;
}
.qr-url-input:focus { outline: none; border-color: var(--accent); }
.qr-url-input::placeholder { color: var(--muted); }
.qr-gen-btn {
  padding: 5px 10px;
  border: 1px solid var(--accent);
  background: rgba(232,19,42,0.1);
  color: var(--accent);
  font-family: 'Karla', sans-serif;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.qr-gen-btn:hover { background: var(--accent); color: #fff; }


.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.qr-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.qr-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 28px 22px;
  width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transform: scale(0.94);
  transition: transform 0.2s;
}
.qr-modal-overlay.open .qr-modal { transform: scale(1); }
.qr-modal-title {
  font-family: 'Karla', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  align-self: center;
  text-align: center;
}
.qr-modal-url {
  font-size: 10px;
  color: var(--muted);
  word-break: break-all;
  text-align: center;
  max-width: 280px;
  line-height: 1.5;
}
.qr-canvas-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
#qrCanvas { display: block; }
.qr-modal-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.qr-download-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-family: 'Karla', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.qr-download-btn:hover { background: #c0101f; border-color: #c0101f; }
.qr-close-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: 'Karla', sans-serif;
  font-size: 11px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s;
}
.qr-close-btn:hover { border-color: var(--muted); color: var(--text); }
.qr-note {
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  opacity: 0.7;
}

/* ── Phones & small tablets: one column, 3D view pinned on top ── */
@media (max-width: 900px) {
  body { height: auto; min-height: 100vh; overflow: auto; }
  header { padding: 0 12px; gap: 10px; }
  .logo { position: static; transform: none; font-size: 16px; }
  .header-actions .btn { padding: 6px 10px; }
  .main { flex-direction: column; overflow: visible; }
  .viewport-wrap { order: -1; position: sticky; top: 0; z-index: 20; flex: none;
                   height: 42vh; min-height: 260px; border-bottom: 1px solid var(--border); }
  .viewport-overlay { flex-wrap: wrap; right: 12px; }
  .left-panel, .right-panel { width: 100%; border: none; overflow: visible; }
  .right-panel { border-top: 1px solid var(--border); }
  .no-selection { height: 110px; }
  .preset-grid { grid-template-columns: repeat(3, 1fr); }
  .preset-btn { padding: 10px 6px; }
  .statusbar { flex-wrap: wrap; height: auto; min-height: 26px; padding: 4px 12px; gap: 4px 16px; }
  /* 16px stops iPhones zooming in when a field is tapped */
  .text-name-input, .qr-url-input, .color-hex, .prop-input, #exportFilename { font-size: 16px; }
  .modal { padding: 18px 16px; }
  .export-warning-title { font-size: 14px; }
}
