/* URBot Guest — Mobile-first concierge portal */
:root {
  --bg: #0a0e1a;
  --surface: #151a2e;
  --surface2: #1c2240;
  --accent: #0ea5e9;
  --accent-glow: rgba(14,165,233,0.15);
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f97316;
  --text: #f1f5f9;
  --dim: #94a3b8;
  --border: rgba(255,255,255,0.08);
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.view { min-height: 100vh; }

/* ======= LANDING ======= */
.landing-hero {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}
.logo-mark { font-size: 4rem; margin-bottom: 1rem; }
.landing-hero h1 { font-size: 2.2rem; font-weight: 900; margin-bottom: 0.5rem; }
.accent { color: var(--accent); }
.hero-sub { color: var(--dim); font-size: 1rem; margin-bottom: 2.5rem; line-height: 1.6; }

.how-it-works {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  text-align: left;
}
.step-icon { font-size: 1.5rem; flex-shrink: 0; }

.manual-entry { margin-top: 1rem; }
.manual-label { color: var(--dim); font-size: 0.85rem; margin-bottom: 0.75rem; }
.code-input-row { display: flex; gap: 0.5rem; }
.code-input {
  flex: 1;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1.5px solid rgba(14,165,233,0.3);
  border-radius: 10px;
  color: var(--text);
  font-size: 1.1rem;
  font-family: monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
}
.code-input:focus { outline: none; border-color: var(--accent); }
.btn-join {
  padding: 0.85rem 1.75rem;
  background: linear-gradient(135deg, var(--accent), #3b82f6);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-join:hover { transform: translateY(-1px); }

.privacy-banner {
  max-width: 480px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--dim);
  text-align: center;
  line-height: 1.5;
}

/* ======= JOINING ======= */
.join-card {
  text-align: center;
  padding: 6rem 2rem;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--surface2);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.join-card h2 { margin-bottom: 0.5rem; }
.join-card p { color: var(--dim); }

/* ======= CHAT ======= */
.chat-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(10,14,26,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.chat-header-left { display: flex; align-items: center; gap: 0.75rem; }
.chat-avatar { font-size: 2rem; }
.chat-bot-name { font-weight: 700; font-size: 1rem; }
.chat-est-name { font-size: 0.8rem; color: var(--dim); }
.btn-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
}

.chat-body {
  flex: 1;
  padding: 1rem;
  min-height: calc(100vh - 120px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg {
  max-width: 85%;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.55;
  word-wrap: break-word;
}
.msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-system {
  align-self: center;
  background: rgba(14,165,233,0.08);
  border: 1px solid rgba(14,165,233,0.2);
  color: var(--dim);
  font-size: 0.85rem;
  text-align: center;
  border-radius: 8px;
}
.msg-typing {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem 1.5rem;
}
.typing-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--dim);
  border-radius: 50%;
  margin: 0 2px;
  animation: typingBounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

.chat-input-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.btn-send {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-send:hover { transform: scale(1.05); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ======= SIDEBAR ======= */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 50;
  padding: 1.5rem;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform 0.2s;
}
.sidebar[hidden] { display: block; transform: translateX(100%); pointer-events: none; }
.sidebar-section { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.sidebar-section h3 { font-size: 0.9rem; margin-bottom: 0.5rem; }
.sidebar-dim { font-size: 0.82rem; color: var(--dim); margin-bottom: 0.25rem; }
.sidebar-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.sidebar-footer { margin-top: 2rem; font-size: 0.75rem; color: var(--dim); }
.sidebar-footer a { color: var(--accent); text-decoration: none; }

/* ======= BUTTONS ======= */
.btn-action {
  display: block;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s;
}
.btn-action:hover { transform: translateY(-1px); }
.btn-keep { background: linear-gradient(135deg, var(--green), #16a34a); color: #fff; }
.btn-delete { background: var(--surface2); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.btn-safety { background: linear-gradient(135deg, var(--red), var(--orange)); color: #fff; }
.btn-upgrade { background: linear-gradient(135deg, var(--accent), #6366f1); color: #fff; }

/* ======= ENDED ======= */
.ended-card {
  text-align: center;
  padding: 6rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}
.ended-icon { font-size: 4rem; margin-bottom: 1.5rem; }
.ended-card h2 { margin-bottom: 0.75rem; }
.ended-card p { color: var(--dim); margin-bottom: 1.5rem; line-height: 1.6; }
#ended-actions { display: flex; flex-direction: column; gap: 0.75rem; max-width: 300px; margin: 0 auto; }

/* ======= CHANNEL PICKER ======= */
.channel-picker {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
}
.channel-picker h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}
.picker-sub {
  font-size: 0.85rem;
  color: var(--dim);
  margin-bottom: 1rem;
}
.channel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.channel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.channel-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.channel-btn.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.channel-icon { font-size: 1.6rem; }
.channel-name { font-size: 0.9rem; font-weight: 600; }
.channel-desc { font-size: 0.72rem; color: var(--dim); }
.channel-btn[hidden] { display: none; }

/* ======= RESPONSIVE ======= */
@media (max-width: 480px) {
  .landing-hero { padding: 2.5rem 1rem 1.5rem; }
  .landing-hero h1 { font-size: 1.8rem; }
  .msg { max-width: 92%; }
  .channel-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
}
