@import url('/static/fonts/fonts.css');
@import url('./tokens.css');

* {
  box-sizing: border-box;
  transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease, color 150ms ease;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-root);
  color: var(--text-primary);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  min-height: 100vh;
  overflow: hidden;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.monospace {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
}

.muted   { color: var(--text-secondary); }
.dim     { color: var(--text-disabled); }
.error   { color: var(--accent-error); }
.warn    { color: var(--accent-warn); }
.success { color: var(--accent-success); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-3) 0;
}

button {
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 8px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
}
button:disabled { cursor: not-allowed; opacity: 0.5; }

.btn-primary {
  background: var(--accent-white);
  color: #000;
  border-color: var(--accent-white);
  font-weight: 500;
}
.btn-primary:hover:not(:disabled) { background: #f5f5f5; }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--text-primary); }

.btn-danger {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.btn-danger:hover:not(:disabled) {
  border-color: var(--accent-error);
  color: var(--accent-error);
}

input, textarea, select {
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--border-hover); }

/* Animations — strict ease, short. */
@keyframes enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.enter { animation: enter 200ms ease-out both; }

/* Signal indicator. */
.signal {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-disabled);
  vertical-align: middle;
}
.signal.ok    { background: var(--accent-success); box-shadow: 0 0 6px var(--accent-success); }
.signal.warn  { background: var(--accent-warn);    box-shadow: 0 0 6px var(--accent-warn); }
.signal.bad   { background: var(--accent-error);   box-shadow: 0 0 6px var(--accent-error); }
.signal.idle  { background: var(--text-disabled); }

/* Toast container — pinned just under the topbar so it never collides with the
   bottom controls bar in the room view. */
#toasts {
  position: fixed;
  top: 72px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px;
  pointer-events: auto;
  animation: enter 200ms ease-out;
  max-width: 420px;
}

/* Modal. */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  width: min(440px, 92vw);
  box-shadow: var(--shadow-elevated);
  animation: enter 200ms ease-out;
}
.modal h2 { margin: 0 0 var(--space-3); font-size: 18px; font-weight: 500; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: var(--space-4); }

/* Scrollbar, dark, minimal. */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #222; border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Cookie / storage notice — floating chip, bottom-right */
.cookie-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  max-width: 300px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  animation: enter 200ms ease-out;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice__text {
  flex: 1;
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.cookie-notice__text a { color: var(--accent-blue); }
.cookie-notice__btn {
  flex-shrink: 0;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}
.cookie-notice__btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
@media (max-width: 480px) {
  .cookie-notice { right: 12px; left: 12px; bottom: 16px; max-width: none; }
}
