/* ========================================================
   Illumascend Event Portal — Phase 1 static prototype
   Mobile-first, healthcare-association warm-professional vibe
   ======================================================== */

/* CSS variables — driven by event JSON at runtime via inline overrides */
:root {
  --primary: #1d5582;          /* event-driven, default deep blue */
  --primary-dark: #143f60;
  --accent: #d97757;           /* warm coral (matches Illumascend) */
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #999;
  --border: #e5e5e0;
  --border-strong: #ccc;
  --shadow-sm: 0 1px 2px rgba(20, 30, 50, 0.04), 0 1px 3px rgba(20, 30, 50, 0.06);
  --shadow-md: 0 2px 8px rgba(20, 30, 50, 0.06), 0 4px 16px rgba(20, 30, 50, 0.08);
  --shadow-lg: 0 8px 24px rgba(20, 30, 50, 0.08), 0 16px 40px rgba(20, 30, 50, 0.10);
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* override class-specific display rules */
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* =================== LOGIN VIEW =================== */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg) 0%, #f1ede5 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px 24px;
  text-align: center;
}

.login-logos {
  margin-bottom: 24px;
}

.assoc-logo {
  height: 64px;
  max-width: 240px;
  object-fit: contain;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 28px;
}

.login-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 12px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.btn-primary {
  margin-top: 20px;
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: translateY(1px); }

.login-help {
  font-size: 13px;
  color: var(--text-muted);
  margin: 16px 0 0;
  text-align: center;
}

.login-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.powered-by {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.powered-by a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.powered-by a:hover { text-decoration: underline; }

/* =================== DASHBOARD VIEW =================== */
.topbar {
  background: var(--primary);
  color: white;
  padding: env(safe-area-inset-top) 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.topbar-logo {
  height: 32px;
  width: 32px;
  background: white;
  border-radius: 6px;
  padding: 2px;
  object-fit: contain;
  flex-shrink: 0;
}
.topbar-info {
  flex: 1;
  min-width: 0;
}
.topbar-event {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-meta {
  font-size: 11px;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-logout {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.topbar-logout:hover { background: rgba(255,255,255,0.25); }

.tab-content {
  padding: 16px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}

/* =================== TABBAR =================== */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(6, 1fr);  /* Exhibitors + Attendees + Floor + Info + Chat + Local */
  z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
}

.tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}
.tab-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.75;
}
.tab-btn[aria-selected="true"] {
  color: var(--primary);
}

/* =================== CARDS & SECTIONS =================== */
.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}
.section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 18px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-row .meta {
  flex: 1;
  min-width: 0;
}
.card-row .badge {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 100px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.card .title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0 0 2px; }
.card .subtitle { font-size: 13px; color: var(--text-secondary); margin: 0; }
.card .note { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

/* =================== ATTENDEES TAB =================== */
.company-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.company-logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.company-logo-fallback {
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0;
  border: none;
}

.attendee-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.specialty-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  display: inline-block;
  letter-spacing: 0.01em;
}

.attendee-bio {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.4;
  font-style: italic;
}
.attendee-placeholder {
  color: var(--text-muted) !important;
  font-style: italic;
  font-weight: 500 !important;
}

/* =================== EMPTY STATE =================== */
.empty-state {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.empty-state svg {
  width: 56px;
  height: 56px;
  color: var(--primary);
  opacity: 0.5;
  margin-bottom: 14px;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.empty-state p {
  font-size: 13px;
  margin: 0;
  line-height: 1.55;
  max-width: 360px;
  margin: 0 auto;
}

/* =================== LOCAL ICON BADGES (polish) =================== */
.local-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.local-icon svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

.search-bar {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.search-bar:focus {
  outline: none;
  border-color: var(--primary);
}

/* =================== INFO TAB =================== */
.info-block {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.info-block h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.info-block p {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  line-height: 1.6;
}

.agenda-day-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 0 6px;
  margin-top: 10px;
  border-bottom: 2px solid var(--primary);
}
.agenda-day-header:first-child { margin-top: 0; padding-top: 4px; }
.agenda-day-label {
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: var(--primary);
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.agenda-day-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.agenda-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.agenda-item:last-child { border-bottom: none; }
.agenda-time {
  flex-shrink: 0;
  width: 110px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.agenda-detail {
  flex: 1;
  min-width: 0;
}
.agenda-title { font-size: 14px; font-weight: 600; color: var(--text); margin: 0 0 2px; }
.agenda-location { font-size: 12px; color: var(--text-muted); margin: 0; }

/* =================== CHAT TAB =================== */
.chat-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .chat-split {
    grid-template-columns: 280px 1fr;
    align-items: start;
  }
}

/* Mobile: when a thread is open, hide list and show thread */
.chat-split .chat-list { display: block; }
.chat-split .chat-thread { display: none; }
.chat-split.show-thread .chat-list { display: none; }
.chat-split.show-thread .chat-thread { display: block; }
@media (min-width: 768px) {
  /* Desktop: both panes always visible */
  .chat-split .chat-list,
  .chat-split .chat-thread { display: block !important; }
}

.chat-list {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.conv-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 14px 6px;
  background: var(--bg);
}

.conv-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: var(--bg); }
.conv-item.active {
  background: linear-gradient(90deg, rgba(29,85,130,0.06) 0%, rgba(29,85,130,0) 100%);
  border-left: 3px solid var(--primary);
  padding-left: 11px;
}

.conv-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.conv-avatar-lobby {
  background: var(--accent);
}
.conv-avatar-lobby svg {
  width: 20px;
  height: 20px;
}

.conv-meta {
  flex: 1;
  min-width: 0;
}
.conv-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}
.conv-badge-lobby {
  font-size: 10px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  padding: 1px 6px;
  border-radius: 100px;
  letter-spacing: 0.03em;
}
.conv-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-preview em { color: var(--text-muted); font-style: italic; }
.conv-unread {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.chat-thread {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.thread-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.thread-back {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.thread-back svg { width: 20px; height: 20px; }
@media (min-width: 768px) {
  .thread-back { display: none; }   /* desktop: no back button needed (always side-by-side) */
}

.thread-title-block { flex: 1; min-width: 0; }
.thread-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.empty-thread {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.chat-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.45;
}
.chat-banner strong { display: block; margin-bottom: 2px; font-size: 13px; }

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  flex: 1;
  min-height: 200px;
  max-height: 50vh;
  overflow-y: auto;
}
.chat-msg {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.chat-msg .from {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.chat-msg .when {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}
.chat-msg .body {
  font-size: 14px;
  color: var(--text);
  margin: 4px 0 0;
}

.chat-composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.chat-composer input {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  box-shadow: var(--shadow-sm);
}
.chat-composer button {
  background: var(--primary);
  color: white;
  border: none;
  font-family: inherit;
  padding: 0 18px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.chat-composer button:hover { background: var(--primary-dark); }

/* =================== FLOOR PLAN TAB =================== */
.floor-wrap {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 14px;
}
.floor-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}
.floor-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin: 12px 0 0;
  text-align: center;
  font-style: italic;
}

/* =================== SPONSOR BAND =================== */
.sponsor-band {
  background: linear-gradient(90deg, #fffaf3 0%, #fdf2e8 100%);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sponsor-band strong {
  color: var(--text);
  font-weight: 700;
}
.sponsor-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(217, 119, 87, 0.12);
  padding: 3px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}
.sponsor-tagline {
  color: var(--text-secondary);
  font-style: italic;
}
.card-sponsored {
  position: relative;
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}
.sponsor-tag-card {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: rgba(217, 119, 87, 0.12);
  padding: 2px 6px;
  border-radius: 100px;
}

/* =================== LOCAL TAB =================== */
.local-section { margin-bottom: 24px; }
.local-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}

/* =================== POWERED-BY FOOTER (dashboard) =================== */
.dashboard-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin: 24px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.dashboard-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* =================== RESPONSIVE =================== */
@media (min-width: 768px) {
  .tab-btn { font-size: 12px; }
  .tab-btn svg { width: 24px; height: 24px; }
}
