/* HiddenPrints – Spotify 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: hidden;
}

.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 {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.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); }

#viewport { touch-action: none; }

/* ---------- phones and narrow windows ---------- */
@media (max-width: 900px) {
  body { height: auto; min-height: 100vh; overflow: visible; }
  header { padding: 0 12px; gap: 8px; position: sticky; top: 0; }
  .logo { position: static; transform: none; font-size: 16px; }
  .btn-long { display: none; }
  .header-actions .btn { padding: 7px 12px; }

  .main { flex-direction: column; overflow: visible; flex: none; }
  .viewport-wrap {
    order: -1; flex: none;
    height: 46vh; height: 46svh; min-height: 260px;
    position: sticky; top: 52px; z-index: 5;
    border-bottom: 1px solid var(--border);
  }
  .left-panel, .right-panel {
    width: 100%; border: none; overflow: visible; flex-shrink: 0;
  }
  .right-panel { border-top: 1px solid var(--border); }
  .objects-list { flex: none; overflow: visible; }
  .no-selection { padding: 24px 14px; }

  .viewport-overlay { top: 8px; left: 8px; right: 8px; flex-wrap: wrap; }
  .grid-toggle { bottom: 8px; left: 8px; }
  .grid-toggle .btn { padding: 8px 12px; }

  .statusbar { flex-wrap: wrap; height: auto; padding: 6px 12px; gap: 4px 16px; }

  .modal-overlay { align-items: flex-start; overflow-y: auto; padding: 12px; }
  .modal { width: 100% !important; max-width: 520px; padding: 18px; }
  .format-btn { padding: 10px 6px; }

  /* 16px stops iPhones zooming the page when a field is tapped */
  .prop-input, .color-hex, .social-input, #exportFilename, .bed-custom input { font-size: 16px; }
  .prop-input { width: 120px; }
}


.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-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-custom { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.bed-custom .bed-lbl { min-width: 46px; }
.bed-custom input { flex: 0 0 auto; width: 84px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.bed-custom input::-webkit-outer-spin-button,
.bed-custom input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bed-hint { font-size: 10px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.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: 8px 10px; margin: -4px 0 12px; }
@media (max-width: 900px) { .bed-custom input, #exportFilename { font-size: 16px; } }  .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); }

.empty-objects {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
