/* styles.css */
:root {
  --snap-yellow: #FFFC00;
  --snap-yellow-hover: #F2EE00;
  --ink: #0D0E12;
  --ink-muted: #5C6270;
  --surface: #FFFFFF;
  --surface-soft: #F4F6F9;
  --border: #E5E8EE;
  --snap-red: #FF2D55;
  --snap-blue: #0099FF;
  --snap-mint: #00C853;
  --snap-amber: #FF6B00;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 2px 10px rgba(13, 14, 18, 0.06);
  --shadow-md: 0 12px 32px rgba(13, 14, 18, 0.12);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background: var(--surface-soft);
  color: var(--ink);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* AUTH OVERLAY */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, var(--snap-yellow) 0%, #FFF799 50%, #FFFFFF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border-radius: 26px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--ink);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-ghost {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--snap-yellow);
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.brand-badge h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-sub {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 600;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.auth-tab {
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-muted);
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field input,
.inline-form-row input,
.annotate-toolbar input[type="text"],
.annotate-toolbar select,
.sfu-controls-row input,
.sfu-controls-row select,
.chat-send-form input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 14px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
}

.field input:focus {
  border-color: var(--ink);
}

.form-error {
  background: #FFF0F3;
  color: var(--snap-red);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.quick-demo-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.quick-demo-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.quick-demo-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* BUTTONS */
.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-full {
  width: 100%;
  padding: 13px;
  font-size: 15px;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 12px;
}

.btn-primary {
  background: var(--snap-yellow);
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

.btn-primary:hover {
  background: var(--snap-yellow-hover);
}

.btn-dark {
  background: var(--ink);
  color: #FFFFFF;
}

.btn-danger {
  background: var(--snap-red);
  color: #FFFFFF;
}

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.btn-chip {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 6px 12px;
  font-size: 12px;
}

.btn-chip:hover {
  background: var(--snap-yellow);
  border-color: var(--ink);
}

/* APP SHELL */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.top-bar {
  height: 60px;
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 20;
  flex-shrink: 0;
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--snap-yellow);
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.top-username {
  font-weight: 800;
  font-size: 14px;
}

.status-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill.online {
  color: var(--snap-mint);
}

.status-pill.connecting {
  color: var(--snap-amber);
}

.screen-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.icon-btn {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.admin-btn {
  background: var(--ink);
  color: var(--snap-yellow);
  border-color: var(--ink);
}

/* 5-SCREEN HORIZONTAL VIEWPORT */
.screens-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--surface-soft);
}

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 20px;
  display: none;
  max-width: 1180px;
  margin: 0 auto;
}

.screen.active {
  display: block;
}

.screen.active-camera-screen {
  max-width: none;
  padding: 0;
  background: #0B0D11;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.panel-header h2 {
  font-size: 22px;
  font-weight: 800;
}

.muted {
  font-size: 13px;
  color: var(--ink-muted);
}

.muted-light {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.section-block {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.section-block h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.list-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inbox-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 820px) {
  .inbox-layout {
    grid-template-columns: 1fr;
  }
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.snap-square {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.snap-square.red {
  background: var(--snap-red);
}

.snap-square.blue {
  background: var(--snap-blue);
}

.snap-square.mint {
  background: var(--snap-mint);
}

.snap-square.amber {
  background: var(--snap-amber);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.badge-yellow {
  background: var(--snap-yellow);
  color: var(--ink);
}

.badge-red {
  background: var(--snap-red);
  color: #FFFFFF;
}

.badge-mint {
  background: #E8F9EE;
  color: #067D38;
}

.badge-dark {
  background: var(--ink);
  color: #FFFFFF;
}

/* CAMERA STAGE */
.camera-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0D0E12;
}

#camera-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: cover;
  cursor: crosshair;
}

.camera-hud-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: none;
}

.hud-pill {
  background: rgba(13, 14, 18, 0.72);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.18);
  pointer-events: auto;
}

.hud-btn {
  cursor: pointer;
}

.camera-hud-bottom {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.ar-carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 10px;
}

.ar-pill {
  background: rgba(13, 14, 18, 0.75);
  color: #FFFFFF;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.ar-pill.active {
  background: var(--snap-yellow);
  color: var(--ink);
  border-color: var(--ink);
}

.shutter-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 5px solid #FFFFFF;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.shutter-btn:hover {
  border-color: var(--snap-yellow);
  transform: scale(1.06);
}

.shutter-hint,
.snap-ar-credit {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 700;
}

/* ANNOTATE & DESTINATION PANEL */
.annotate-panel {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  max-width: 820px;
  margin: 0 auto;
  background: rgba(13, 14, 18, 0.88);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.annotate-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}

.annotate-toolbar input[type="color"] {
  width: 44px;
  height: 40px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.destination-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dest-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--snap-yellow);
}

.chips-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.recipient-chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.recipient-chip.selected {
  background: var(--snap-yellow);
  color: var(--ink);
  border-color: var(--snap-yellow);
}

.dest-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* SNAP MAP */
.map-stage-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

#snap-map-canvas {
  width: 100%;
  height: 360px;
  display: block;
  cursor: pointer;
}

.map-hud-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.ghost-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cards-grid,
.stories-grid,
.memories-grid,
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.story-card,
.memory-card,
.spotlight-card {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spotlight-card {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* BOTTOM NAVIGATION */
.bottom-nav {
  height: 66px;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 20;
  flex-shrink: 0;
}

.nav-tab {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-muted);
  cursor: pointer;
  position: relative;
}

.nav-ico {
  font-size: 19px;
}

.nav-tab.active {
  color: var(--ink);
  background: rgba(255, 252, 0, 0.35);
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: 26%;
  background: var(--snap-red);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 14, 18, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 500;
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.modal-wide {
  max-width: 860px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.snap-viewer-card {
  background: #0D0E12;
  color: #FFFFFF;
  max-width: 480px;
}

.snap-viewer-top,
.snap-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.snap-viewer-media-wrap {
  position: relative;
  margin: 12px 0;
  border-radius: 16px;
  overflow: hidden;
  background: #171A21;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.snap-viewer-media-wrap img {
  max-width: 100%;
  max-height: 55vh;
  display: block;
}

.viewer-caption {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #FFFFFF;
  text-align: center;
  padding: 8px 12px;
  font-weight: 700;
}

.chat-messages-box {
  height: 280px;
  overflow-y: auto;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.chat-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  max-width: 82%;
  font-size: 13px;
}

.chat-bubble.me {
  align-self: flex-end;
  background: var(--snap-blue);
  color: #FFFFFF;
}

.chat-bubble.them {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
}

.chat-send-form,
.inline-form-row,
.sfu-controls-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-send-form input,
.inline-form-row input {
  flex: 1;
}

.telemetry-box {
  margin-top: 12px;
  background: #0D0E12;
  color: #A7F3D0;
  padding: 14px;
  border-radius: 14px;
  font-size: 12px;
  overflow-x: auto;
  max-height: 240px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.kpi-card .kpi-val {
  font-size: 22px;
  font-weight: 800;
}

.kpi-card .kpi-lbl {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 700;
}

.admin-actions-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 760px) {
  .admin-split {
    grid-template-columns: 1fr;
  }
}

.toast-container {
  position: fixed;
  top: 70px;
  right: 16px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--ink);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--snap-yellow);
}

.inline-card {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.inline-card h4 {
  margin-bottom: 10px;
  font-size: 14px;
}
