/* ═══════════════════════════════════════════════════════════════
   SEATFLOW  —  styles.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── Design tokens ────────────────────────────────────────────── */
:root {
  --bg:      #f8fafc;
  --surface: #ffffff;
  --high:    #f1f5f9;
  --border:  #cbd5e1;
  --accent:  #3b82f6;
  --purple:  #8b5cf6;
  --green:   #10b981;
  --warn:    #f59e0b;
  --red:     #ef4444;
  --muted:   #64748b;
  --text:    #0f172a;
  --dim:     #475569;

  /* Safe area insets (notch / home bar) */
  --sat: env(safe-area-inset-top);
  --sab: env(safe-area-inset-bottom);
  --sal: env(safe-area-inset-left);
  --sar: env(safe-area-inset-right);
}

/* ── Layout ───────────────────────────────────────────────────── */
html, body, #app {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
}

body {
  padding-top:    var(--sat);
  padding-bottom: var(--sab);
  padding-left:   var(--sal);
  padding-right:  var(--sar);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Typography ───────────────────────────────────────────────── */
button          { font-family: 'DM Mono', monospace; cursor: pointer; }
input, select,
textarea        { font-family: 'DM Mono', monospace; }

/* ── Scrollbars ───────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--high); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; transform: translateY(8px);  } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(400px); } to { opacity: 1; transform: translateX(0); } }
@keyframes sf-pulse-ring {
  0%   { box-shadow: 0 0 0 2px var(--ring,#fff) , 0 0 10px var(--ring,#fff); }
  50%  { box-shadow: 0 0 0 4px var(--ring,#fff) , 0 0 20px var(--ring,#fff); }
  100% { box-shadow: 0 0 0 2px var(--ring,#fff) , 0 0 10px var(--ring,#fff); }
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse   { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes spin    { to { transform: rotate(360deg); } }

.fade-in  { animation: fadeIn  .25s ease forwards; }
.slide-up { animation: slideUp .3s  ease forwards; }
.pulse    { animation: pulse   1.5s ease infinite; }
.spin     { animation: spin    .8s  linear infinite; display: inline-block; }

/* ── Drag ─────────────────────────────────────────────────────── */
[draggable=true]        { cursor: grab; }
[draggable=true]:active { cursor: grabbing; }

/* ── OTP input row ────────────────────────────────────────────── */
.otp-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.otp-row input {
  width: 42px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--high);
  border: 2px solid var(--border);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}

.otp-row input:focus { border-color: var(--accent); }

/* ── QR code wrapper ──────────────────────────────────────────── */
.qr-wrap {
  background: white;
  border-radius: 12px;
  padding: 12px;
  display: inline-block;
}

/* ── Password strength bar ────────────────────────────────────── */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  transition: width .3s, background .3s;
}

/* ── Auth page wrapper ────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  overflow-y: auto;
}

.auth-card {
  width: 400px;
  max-width: 100%;
}

.auth-logo {
  text-align: center;
  margin-bottom: 40px;
}

.auth-logo .icon    { font-size: 96px; margin-bottom: 10px; filter: drop-shadow(0 0 20px #4f6ef755); }
.auth-logo h1       { display: none; }
.auth-logo .tagline { color: var(--dim); font-size: 11px; margin-top: 8px; }

.auth-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

/* ── Tab bar ──────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 22px;
}

.tab-bar button {
  flex: 1;
  padding: 9px 0;
  border: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  transition: all .2s;
  color: var(--dim);
  background: transparent;
}

.tab-bar button.active {
  background: var(--accent);
  color: #fff;
}

/* ── Home dashboard ───────────────────────────────────────────── */
.home-page {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  min-height: 80px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.home-body {
  flex: 1;
  padding: 24px 20px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.chart-card {
  background: var(--high);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chart-card:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--high));
}

/* ── Chart screen ─────────────────────────────────────────────── */
.chart-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  min-height: 80px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  gap: 10px;
}

/* Mobile: Stack logo and controls vertically */
@media (max-width: 640px) {
  .chart-topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: auto;
    padding: 12px 16px;
  }
  
  .chart-topbar > div:last-child {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: 270px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

/* ── Seat grid ────────────────────────────────────────────────── */
.seat {
  width: 44px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all .1s;
  border: none;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.07), inset 0 -3px 0 rgba(0,0,0,0.4);
}

.seat:hover { transform: scale(1.07); }

/* ── Modal overlay ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  z-index: 4500;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  padding: 16px;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

/* ── Toast ────────────────────────────────────────────────────── */
.sf-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 10px;
  padding: 10px 22px;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.3);
  z-index: 3000;
  white-space: nowrap;
  pointer-events: none;
  color: #fff;
}

/* ── Form elements ────────────────────────────────────────────── */
.sf-input {
  background: var(--high);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  width: 100%;
  font-family: 'DM Mono', monospace;
  transition: border-color .15s;
}

.sf-input:focus { border-color: var(--accent); }

.sf-label {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .05em;
  margin-bottom: 6px;
  display: block;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.sf-btn {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: .02em;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
  font-family: 'DM Mono', monospace;
}

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

.sf-btn-primary   { background: var(--accent);  color: #fff;        border: none; }
.sf-btn-secondary { background: var(--high);    color: var(--text); border: 1px solid var(--border); }
.sf-btn-danger    { background: var(--red);     color: #fff;        border: none; }
.sf-btn-ghost     { background: transparent;    color: var(--dim);  border: 1px solid var(--border); }
.sf-btn-success   { background: var(--green);   color: #fff;        border: none; }
.sf-btn-warn      { background: var(--warn);    color: #000;        border: none; }

.sf-btn-primary:hover   { filter: brightness(1.1); }
.sf-btn-secondary:hover { background: var(--border); }
.sf-btn-ghost:hover     { background: var(--high); color: var(--text); }
.sf-btn-danger:hover    { filter: brightness(1.1); }
.sf-btn-success:hover   { filter: brightness(1.1); }

/* ── Badge ────────────────────────────────────────────────────── */
.sf-badge {
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
}

/* ── Divider ──────────────────────────────────────────────────── */
.sf-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.sf-divider-line { flex: 1; height: 1px; background: var(--border); }
.sf-divider-text { font-size: 10px; color: var(--muted); white-space: nowrap; }

/* ── Placing banner ───────────────────────────────────────────── */
.placing-banner {
  background: color-mix(in srgb, var(--warn) 15%, transparent);
  border: 1px solid var(--warn);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── iOS install banner ───────────────────────────────────────── */
.ios-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 500;
}

/* ── PWA install bar ──────────────────────────────────────────── */
.pwa-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 500;
  gap: 10px;
}

/* ── Account avatar ───────────────────────────────────────────── */
.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border: 1px solid var(--accent);
  color: var(--accent);
}

.avatar.lg {
  width: 40px;
  height: 40px;
  font-size: 16px;
  border-width: 2px;
}

/* ── Touch drag-and-drop ──────────────────────────────────────── */
/* Suppress long-press context menu, text selection, and browser drag UI */
[data-seatid], [data-user-chip], [data-group-chip] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  /* Prevent the browser "+" drag cursor / text selection handles */
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  user-drag: none;
}
/* Kill native touch actions on the grid so JS owns all gestures */
[data-grid-scroll], [data-outer-scroll], [data-grid-natural] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* During active drag, completely suppress browser selection & callouts */
.is-dragging, .is-dragging * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  cursor: grabbing !important;
}

/* ── Drag mode — seats stay full size, card minimizes ────────── */
/* The dragged element itself fades (browser handles the drag image),
   but we don't touch seat sizes. Instead we highlight valid targets. */

/* All available seats get a gentle pulse during drag to invite drops */
.is-dragging [data-seatid][data-available='true'] {
  animation: seat-invite .8s ease-in-out infinite alternate;
  cursor: copy !important;
}
@keyframes seat-invite {
  from { box-shadow: none; }
  to   { box-shadow: 0 0 0 2px var(--accent), 0 0 10px var(--accent)66; }
}

/* Occupied seats dim slightly so available ones stand out */
.is-dragging [data-seatid][data-occupied='true'] {
  opacity: 0.45;
}

/* The seat currently under the cursor — shown via JS data-drag-target */
[data-seatid][data-drag-target='true'] {
  transform: scale(1.18) !important;
  z-index: 10;
  position: relative;
}

/* Drag ghost — shown as a small floating pill beside the cursor */
#sf-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  /* positioning/sizing handled entirely by JS */
  transform: translate(12px, -50%);
  transition: opacity .1s;
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
#sf-drag-ghost.visible {
  opacity: 1;
}
/* Preview tooltip shown on the hovered seat */
#sf-seat-preview {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--text);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  transform: translate(-50%, -110%);
  transition: opacity .08s;
  opacity: 0;
}
#sf-seat-preview.visible {
  opacity: 1;
}
.tagline{
	display: none !important;
}
.auth-logo{
	margin-bottom: 0px !important;	
}