/* HiddenPrints – Spotify Photo Frame 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;
}
.right-panel > #selectionProps,
.right-panel > #propsPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

/* ---------- touch devices ---------- */
#viewport { touch-action: none; }
@media (hover: none) {
  .obj-del { opacity: 1; }
}

/* ---------- phones and small tablets ---------- */
@media (max-width: 820px) {
  body { height: auto; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
  header { padding: 0 12px; padding-top: env(safe-area-inset-top, 0px); height: calc(52px + env(safe-area-inset-top, 0px)); gap: 12px; }
  .logo { position: static; transform: none; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
  .main { flex-direction: column; overflow: visible; }
  .viewport-wrap {
    order: -1; flex: none; height: 46vh; height: 46svh; min-height: 260px;
    position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--border);
  }
  .left-panel, .right-panel { width: 100%; border: none; border-top: 1px solid var(--border); overflow: visible; }
  .objects-list { min-height: 80px; }
  .right-panel .panel-section[style*="margin-top:auto"] { margin-top: 0 !important; }
  .prop-input { width: 120px; }
  input, select, textarea { font-size: 16px !important; }   /* stops iOS zooming in on focus */
  .btn { padding: 8px 14px; }
  .statusbar { height: auto; padding: 6px 12px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); flex-wrap: wrap; gap: 4px 16px; }
  .statusbar span:last-child { margin-left: 0 !important; }
  .format-btn { padding-left: 4px; padding-right: 4px; }
}



.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-overlay { padding: 12px; }
.modal { max-width: 100%; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }

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