/* Conference Attendee Admin — Sample App skin.
   Intentionally distinct from the Admin tooling so the right column reads
   as "the visitor's front-end app", not a tech panel. Coral primary +
   deep navy + cream surface. */

.sample-app {
  --brand-primary: #ea580c;
  --brand-primary-hover: #c2410c;
  --brand-deep: #1e1b4b;
  --brand-accent: #4338ca;
  --brand-surface: #ffffff;
  --brand-bg: linear-gradient(180deg, #fff7ed 0%, #ffffff 65%);
  --brand-text: #1e293b;
  --brand-text-muted: #64748b;
  --brand-text-light: #94a3b8;
  --brand-border: rgba(30,27,75,0.08);
  --brand-radius: 14px;
  --brand-radius-sm: 8px;
  --brand-shadow: 0 6px 22px rgba(30,27,75,0.08);

  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--brand-bg);
  border: 1px solid var(--brand-border);
  border-radius: var(--brand-radius);
  box-shadow: var(--brand-shadow);
  color: var(--brand-text);
  overflow: hidden;
}

/* Hero header */
.sample-app__event-header {
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #ea580c 130%);
  color: #fff;
}
/* Brand block — rendered above the welcome line when SAMPLE_APP_LOGO /
   SAMPLE_APP_MARK env vars are configured. Mark sits left of the logo. */
.sample-app__brand {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px;
}
.sample-app__brand-mark { height: 28px; width: auto; object-fit: contain; }
.sample-app__brand-logo { height: 22px; width: auto; object-fit: contain; }

.sample-app__welcome {
  margin: 0 0 6px;
  font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.02em;
}
.sample-app__event-name { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.sample-app__event-sub { margin: 0; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.85); }
.sample-app__event-tagline {
  margin: 6px 0 0; font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em; text-transform: uppercase;
}

/* Sign-in card */
.sample-app__signin {
  padding: 28px 24px;
  text-align: center;
}
.sample-app__signin-msg { margin: 0 0 14px; font-size: 13px; color: var(--brand-text-muted); }
.sample-app__signin-msg strong { display: block; font-size: 16px; color: var(--brand-text); margin-bottom: 4px; }
.sample-app__signin-btn {
  padding: 12px 30px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, #f59e0b 100%);
  color: #fff;
  border: none; border-radius: var(--brand-radius-sm);
  font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(234,88,12,0.25);
}
.sample-app__signin-btn:hover { filter: brightness(0.95); }

/* Attendees view */
.sample-app__body {
  padding: 18px 20px 20px;
}

.sample-app__stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.sample-app__stat {
  display: flex; flex-direction: column;
  padding: 8px 14px; border-radius: 10px;
  background: rgba(234,88,12,0.07);
  border: 1px solid rgba(234,88,12,0.15);
  font-size: 11px; color: var(--brand-text-muted);
  font-weight: 500;
}
.sample-app__stat strong {
  color: var(--brand-primary); font-size: 18px; font-weight: 800;
  line-height: 1; margin-bottom: 2px;
}

/* Table */
.sample-app__table {
  width: 100%; border-collapse: collapse;
  background: var(--brand-surface);
  border-radius: var(--brand-radius-sm);
  border: 1px solid var(--brand-border);
  overflow: hidden;
  font-size: 13px;
}
.sample-app__table th {
  padding: 9px 12px; text-align: left;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(30,27,75,0.03);
  color: var(--brand-text-muted);
  border-bottom: 1px solid var(--brand-border);
}
.sample-app__table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--brand-border);
}
.sample-app__table tbody tr:last-child td { border-bottom: none; }
.sample-app__table tbody tr:hover td { background: rgba(234,88,12,0.03); }

/* Tag chips */
.sample-app__tag {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
}
.sample-app__tag--vip {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e; border: 1px solid #fcd34d;
}
.sample-app__tag--speaker {
  background: rgba(67,56,202,0.1); color: var(--brand-accent);
  border: 1px solid rgba(67,56,202,0.2);
}
.sample-app__tag--attendee {
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}

.sample-app__remove {
  width: 22px; height: 22px; border-radius: 50%;
  background: transparent; color: #dc2626;
  border: none; cursor: pointer;
  font-size: 14px; font-weight: 700; line-height: 1;
  transition: all 0.15s ease;
}
.sample-app__remove:hover { background: #fee2e2; color: #991b1b; }

/* Inline add row in tfoot */
.sample-app__add-row td {
  background: #fff7ed;
  border-top: 2px dashed rgba(234,88,12,0.25);
  padding: 8px 12px;
}
.sample-app__add-name {
  width: 100%; box-sizing: border-box;
  padding: 4px 0; font-size: 13px;
  border: none; background: transparent; outline: none;
  color: var(--brand-text);
}
.sample-app__add-name::placeholder { color: var(--brand-text-muted); opacity: 0.75; font-style: italic; }
.sample-app__add-tag {
  width: 100%; box-sizing: border-box;
  padding: 3px 6px; font-size: 11px;
  border: 1px solid rgba(234,88,12,0.3); border-radius: 4px;
  background: var(--brand-surface); color: var(--brand-text);
}
.sample-app__add-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: none; cursor: pointer;
  background: #16a34a; color: #fff;
  font-size: 16px; font-weight: 700; line-height: 1;
  transition: background 0.15s ease;
}
.sample-app__add-btn:hover { background: #15803d; }

/* Hide Type + Add affordances until a name is typed */
.sample-app__add-tag,
.sample-app__add-btn {
  opacity: 0; pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.sample-app__add-row--active .sample-app__add-tag,
.sample-app__add-row--active .sample-app__add-btn {
  opacity: 1; pointer-events: auto; transform: none;
}

/* Collapsible API call log */
.sample-app__call-log {
  margin-top: 14px;
  border: 1px solid rgba(30,27,75,0.08);
  border-radius: var(--brand-radius-sm);
  background: transparent;
}
.sample-app__call-log-summary {
  padding: 6px 10px;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--brand-text-muted);
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px;
  user-select: none;
  opacity: 0.75;
}
.sample-app__call-log-summary:hover { opacity: 1; }
.sample-app__call-log-summary::-webkit-details-marker { display: none; }
.sample-app__call-log-chevron {
  display: inline-block;
  width: 0; height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
  transition: transform 0.2s;
}
.sample-app__call-log[open] .sample-app__call-log-chevron { transform: rotate(180deg); }
.sample-app__call-log-aside { font-weight: 400; opacity: 0.7; margin-left: 2px; }
.sample-app__call-log-count {
  margin-left: auto;
  font-size: 10px; font-weight: 400;
  color: var(--brand-text-light);
}
.sample-app__call-log-entries {
  border-top: 1px solid rgba(30,27,75,0.08);
  max-height: 240px; overflow-y: auto;
}
.sample-app__call-log-entry {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 11px;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 8px;
  align-items: baseline;
}
.sample-app__call-log-entry:last-child { border-bottom: none; }
.sample-app__call-log-actor {
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
  background: rgba(59,130,246,0.15); color: #1d4ed8;
}
.sample-app__call-log-verb {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  letter-spacing: 0.02em; white-space: nowrap;
}
.sample-app__call-log-verb--GET    { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.sample-app__call-log-verb--POST   { background: rgba(34,197,94,0.12); color: #15803d; }
.sample-app__call-log-verb--DELETE { background: rgba(220,38,38,0.12); color: #b91c1c; }
.sample-app__call-log-verb--default { background: rgba(107,114,128,0.12); color: #4b5563; }
.sample-app__call-log-uri {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; word-break: break-all;
}
.sample-app__call-log-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  white-space: nowrap;
}
.sample-app__call-log-entry--ok .sample-app__call-log-status { background: rgba(34,197,94,0.12); color: #047857; }
.sample-app__call-log-entry--err .sample-app__call-log-status { background: rgba(220,38,38,0.12); color: #b91c1c; }
.sample-app__call-log-detail {
  grid-column: 2 / -1;
  font-size: 10px; color: var(--brand-text-muted);
  margin-top: 2px;
}
.sample-app__call-log-empty {
  padding: 14px 12px; text-align: center;
  font-size: 11px; color: var(--brand-text-light); font-style: italic;
}

/* Generate Executive Summary — branded prominent CTA */
.sample-app__summary-cta {
  margin-top: 14px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--brand-primary) 0%, #f59e0b 100%);
  color: #fff;
  border: none; border-radius: var(--brand-radius-sm);
  font-size: 14px; font-weight: 700; letter-spacing: 0.02em; cursor: pointer;
  box-shadow: 0 4px 14px rgba(234,88,12,0.25);
  transition: filter 0.15s ease;
}
.sample-app__summary-cta:hover:not(:disabled) { filter: brightness(0.95); }
.sample-app__summary-cta:disabled {
  background: #cbd5e1; color: #94a3b8; box-shadow: none; cursor: not-allowed;
}

/* Inline error banner — surfaced when Step 2/3 or the summary call fails.
   Pairs with the kiosk's toast/growl so the visitor sees the failure
   in the Sample App without having to glance at the kiosk side. */
.sample-app__summary-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3px solid #dc2626;
  border-radius: var(--brand-radius-sm);
  font-size: 12px; line-height: 1.5;
  color: #991b1b;
  display: flex; flex-direction: column; gap: 4px;
}
.sample-app__summary-error strong {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
}
[data-theme="dark"] .sample-app__summary-error {
  background: rgba(220,38,38,0.12);
  border-color: rgba(220,38,38,0.3);
  color: #fca5a5;
}

/* AI Executive Briefing card — shows the result of POST /api/db/summary */
.sample-app__summary-card {
  margin-top: 14px;
  background: linear-gradient(135deg, rgba(67,56,202,0.05), rgba(234,88,12,0.03));
  border: 1px solid rgba(67,56,202,0.18);
  border-radius: var(--brand-radius-sm);
  padding: 14px 16px;
  font-size: 13px; line-height: 1.6;
  color: var(--brand-text);
  animation: sample-app-summary-in 0.4s ease;
}
@keyframes sample-app-summary-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.sample-app__summary-title {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: #4338ca; margin-bottom: 8px;
}
[data-theme="dark"] .sample-app__summary-title { color: #c4b5fd; }
.sample-app__summary-body p { margin: 0 0 8px; }
.sample-app__summary-body p:last-child { margin-bottom: 0; }
.sample-app__summary-body strong { color: var(--brand-deep); }
[data-theme="dark"] .sample-app__summary-body strong { color: #e0e7ff; }

/* Section blocks — each briefing paragraph gets an eyebrow label
   followed by prose, with a soft left border for visual chunking so
   the briefing doesn't read as one wall of text. */
.sample-app__summary-section {
  padding: 6px 0 6px 10px;
  border-left: 3px solid rgba(139,92,246,0.25);
  margin: 0 0 10px;
}
.sample-app__summary-section:last-child { margin-bottom: 0; }
.sample-app__summary-section__label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #6d28d9; margin-bottom: 2px;
}
[data-theme="dark"] .sample-app__summary-section { border-left-color: rgba(196,181,253,0.35); }
[data-theme="dark"] .sample-app__summary-section__label { color: #c4b5fd; }
.sample-app__summary-section__body { margin: 0; line-height: 1.55; }
.sample-app__summary-meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 10px;
  color: var(--brand-text-muted);
  display: flex; flex-direction: column; gap: 3px;
}
.sample-app__summary-meta__row {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.sample-app__summary-meta__chip {
  background: rgba(34,197,94,0.12); color: #047857;
  padding: 1px 6px; border-radius: 3px; font-weight: 600;
}
[data-theme="dark"] .sample-app__summary-meta { border-top-color: rgba(255,255,255,0.08); }

/* MCP simulation — secondary "ask the AI agent" panel below the summary CTA.
   Wrapped in a <details> so it stays collapsed at rest and doesn't dominate
   the page until the visitor clicks into it. */
.sample-app__mcp {
  margin-top: 14px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid rgba(67,56,202,0.18);
  border-radius: var(--brand-radius-sm);
}
.sample-app__mcp-title {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-accent);
  margin: 0;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
  list-style: none;
}
.sample-app__mcp-title::-webkit-details-marker { display: none; }
.sample-app__mcp-chevron {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  transition: transform 0.2s;
}
.sample-app__mcp[open] .sample-app__mcp-chevron { transform: rotate(180deg); }
.sample-app__mcp-body {
  padding: 0 14px 14px;
}
.sample-app__mcp-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.sample-app__mcp-btn {
  padding: 10px 12px;
  background: #fff;
  color: var(--brand-deep);
  border: 1px solid rgba(67,56,202,0.2);
  border-radius: var(--brand-radius-sm);
  font-size: 12px; font-weight: 500;
  text-align: left;
  line-height: 1.3;
  min-height: 56px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sample-app__mcp-btn::before {
  content: '✨ '; opacity: 0.85;
}
.sample-app__mcp-btn:hover:not(:disabled) {
  border-color: var(--brand-accent);
  background: rgba(67,56,202,0.04);
}
.sample-app__mcp-btn:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.sample-app__mcp-log {
  margin-top: 10px; padding: 10px;
  border-radius: var(--brand-radius-sm);
  background: #fff;
  border: 1px solid var(--brand-border);
  font-size: 12px; line-height: 1.5;
}
.sample-app__mcp-msg { margin: 0 0 6px; }
.sample-app__mcp-msg:last-child { margin-bottom: 0; }
.sample-app__mcp-msg strong { display: inline-block; min-width: 36px; }
.sample-app__mcp-msg--user strong { color: var(--brand-primary); }
.sample-app__mcp-msg--ai strong { color: var(--brand-accent); }
.sample-app__mcp-msg--err { color: #b91c1c; }
[data-theme="dark"] .sample-app__mcp { background: linear-gradient(135deg, rgba(67,56,202,0.12), rgba(67,56,202,0.05)); }
[data-theme="dark"] .sample-app__mcp-btn { background: rgba(255,255,255,0.04); color: #e0e7ff; }
[data-theme="dark"] .sample-app__mcp-log { background: rgba(255,255,255,0.02); }
[data-theme="dark"] .sample-app__mcp-msg--err { color: #fca5a5; }

.sample-app__mcp-phases {
  display: flex; flex-direction: column; gap: 4px;
  margin: 6px 0; padding: 8px 10px;
  background: rgba(67,56,202,0.04);
  border-radius: 4px;
  border-left: 2px solid var(--brand-accent);
}
.sample-app__mcp-phase {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
}
.sample-app__mcp-phase__icon {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
  background: rgba(67,56,202,0.12); color: var(--brand-accent);
}
.sample-app__mcp-phase--running .sample-app__mcp-phase__icon {
  background: rgba(245,158,11,0.15); color: #b45309;
  animation: sample-app-mcp-pulse 1s ease-in-out infinite;
}
.sample-app__mcp-phase--done .sample-app__mcp-phase__icon {
  background: rgba(34,197,94,0.15); color: #16a34a;
}
.sample-app__mcp-phase--fail .sample-app__mcp-phase__icon {
  background: rgba(220,38,38,0.15); color: #b91c1c;
}
@keyframes sample-app-mcp-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.95); }
}
.sample-app__mcp-phase__label { font-weight: 600; min-width: 110px; }
.sample-app__mcp-phase--fail .sample-app__mcp-phase__label { color: #b91c1c; }
[data-theme="dark"] .sample-app__mcp-phase--fail .sample-app__mcp-phase__label { color: #fca5a5; }
.sample-app__mcp-phase__detail {
  color: var(--brand-text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px; flex: 1; word-break: break-word;
}

/* Loading + empty states */
.sample-app__loading {
  padding: 30px; text-align: center;
  font-size: 12px; color: var(--brand-text-muted); font-style: italic;
}
.sample-app__error {
  padding: 14px;
  font-size: 12px; color: #b91c1c;
  background: #fef2f2; border-radius: 6px;
  margin-bottom: 12px;
}

/* Dark theme adjustments */
[data-theme="dark"] .sample-app {
  --brand-surface: #1e293b;
  --brand-bg: linear-gradient(180deg, #1e1b3a 0%, #1e293b 65%);
  --brand-text: #f1f5f9;
  --brand-text-muted: #94a3b8;
  --brand-border: rgba(255,255,255,0.08);
}
[data-theme="dark"] .sample-app__table { background: rgba(255,255,255,0.02); }
[data-theme="dark"] .sample-app__table th { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .sample-app__tag--attendee {
  background: rgba(255,255,255,0.08); color: #cbd5e1; border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .sample-app__add-row td { background: rgba(234,88,12,0.08); }
[data-theme="dark"] .sample-app__add-name { color: #f1f5f9; }
[data-theme="dark"] .sample-app__add-name::placeholder { color: #94a3b8; opacity: 0.7; }
[data-theme="dark"] .sample-app__call-log { border-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .sample-app__call-log-entries { border-top-color: rgba(255,255,255,0.06); }
[data-theme="dark"] .sample-app__error { background: rgba(220,38,38,0.1); color: #fca5a5; }
