/* ============================================================
   shared.css — EchoParrot
   Design tokens, reset, typography, and components used on
   BOTH the home page and the room page.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---- Design tokens ---- */
:root {
  /* Colors */
  --bg:           #1c1c1e;
  --surface:      #2c2c2e;
  --surface2:     #3a3a3c;
  --border:       rgba(255,255,255,0.08);
  --text:         #f5f5f7;
  --text-muted:   rgba(255,255,255,0.45);
  --accent:       #1a73e8;
  --accent-hover: #1557b0;
  --danger:       #ea4335;
  --danger-hover: #c5221f;
  --success:      #34a853;
  --warn:         #fbbc04;

  /* Geometry */
  --radius:    16px;
  --radius-sm: 10px;

  /* Motion */
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Base ---- */
html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ---- Shared: toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

/* ---- Shared: spinner animation ---- */
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Shared: top navigation bar (home / dial / install)
   ============================================================ */
.ep-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: rgba(28, 28, 30, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.ep-nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700; color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.ep-nav-brand img { display: block; }
.ep-nav-links { display: flex; gap: 2px; margin-left: 6px; }
.ep-nav-link {
  color: var(--text-muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.ep-nav-link:hover { color: var(--text); background: var(--surface); }
.ep-nav-link.active { color: var(--text); background: var(--surface); }
.ep-nav-spacer { flex: 1; }
.ep-nav-auth { display: flex; align-items: center; gap: 8px; }
.ep-nav-auth [hidden] { display: none !important; }

.ep-auth-btn {
  align-items: center; display: inline-flex; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 600; line-height: 1;
  min-height: 34px; padding: 0 14px; text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.ep-auth-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-auth-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.ep-auth-ghost { background: transparent; color: var(--text); }
.ep-auth-ghost:hover { background: var(--surface2); color: var(--text); }
.ep-auth-user {
  border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted);
  font-size: 12px; max-width: min(220px, 38vw); overflow: hidden;
  padding: 7px 11px; text-overflow: ellipsis; white-space: nowrap;
}

/* Pages that show the nav clear its fixed height. */
body.has-nav { padding-top: 56px; }

@media (max-width: 560px) {
  .ep-nav { gap: 6px; padding: 0 10px; }
  .ep-nav-brand span { display: none; }
  .ep-nav-link { padding: 8px 10px; font-size: 13px; }
  .ep-auth-btn { padding: 0 10px; font-size: 12px; }
}
