/*
 * share.css — visual mirror of the mobile app's SignalDetailScreen.
 *
 * Palette and component dimensions are intentionally identical to
 * ~/zayn-predictions/src/components/ui.tsx and
 * SignalDetailScreen.tsx so the share page reads as the same product
 * surface as the app. If you tweak one, tweak the other.
 */

:root {
  --bg:      #0B0F1A;
  --card:    #131826;
  --text:    #FFFFFF;
  --muted:   #9AA3B2;
  --subtle:  #4C5566;
  --accent:  #5EEAD4;
  --error:   #F87171;
  --border:  #252C3B;

  /* Category colors — must match src/lib/categories.ts */
  --cat-weather:       #60A5FA;
  --cat-sports:        #F59E0B;
  --cat-crypto:        #F97316;
  --cat-fed:           #34D399;
  --cat-entertainment: #C084FC;
  --cat-unknown:       #9AA3B2;

  /* Status colors — must match src/lib/status.ts */
  --status-active:  #5EEAD4;
  --status-closing: #F59E0B;
  --status-won:     #34D399;
  --status-lost:    #F87171;
  --status-expired: #9AA3B2;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

.scroll {
  min-height: 100vh;
  background: var(--bg);
}

.content {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  padding-top: max(56px, env(safe-area-inset-top, 24px));
}

/* ── Brand header ──────────────────────────────────────────────────── */

.page-header {
  margin-bottom: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}
.brand-logo {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
}
.brand-name {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.3px;
}

/* ── Signal card ───────────────────────────────────────────────────── */

.signal-root {
  min-height: 200px;
}

.header-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* CategoryBadge — mirrors src/components/CategoryBadge.tsx */
.pill {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  border-radius: 999px;
  border: 1px solid;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1;
}
.pill ion-icon {
  font-size: 15px;
  margin-right: 6px;
}

/* StatusBadge — mirrors src/components/StatusBadge.tsx */
.status-pill {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  border-radius: 999px;
  border: 1px solid;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  margin-right: 5px;
}

.title {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 20px;
}

.reason-box {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-top: 4px;
  margin-bottom: 24px;
  border-left: 3px solid var(--accent);
}
.reason-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.reason-text {
  color: var(--text);
  font-size: 15px;
  line-height: 22px;
  margin: 0;
}

.stats-grid {
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin-bottom: 20px;
}
.stat {
  flex: 1;
  min-width: 0;
}
.stat-label {
  color: var(--subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 4px;
}
.stat-value {
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}
.stat-value.positive { color: var(--accent); }
.stat-value.negative { color: var(--error); }

/* ── Reactions ─────────────────────────────────────────────────────── */

.reactions-block {
  margin-bottom: 28px;
}
.section-label {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 4px 0 8px;
}
.reaction-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}
.reaction-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  transition: border-color 120ms ease, background 120ms ease;
}
.reaction-chip:hover {
  border-color: var(--subtle);
}
.reaction-chip.active {
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.12);
}
.reaction-chip.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.reaction-emoji {
  font-size: 16px;
}
.reaction-count {
  color: var(--muted);
  font-size: 12px;
  margin-left: 5px;
  font-weight: 600;
}
.reaction-count.zero { color: var(--subtle); }
.reaction-chip.active .reaction-count {
  color: var(--accent);
  font-weight: 700;
}

/* ── Disclaimer ────────────────────────────────────────────────────── */

.disclaimer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.disclaimer-text {
  color: var(--subtle);
  font-size: 11px;
  line-height: 16px;
  margin: 0;
}

/* ── Loading + error states ────────────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}
.error-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
}
.error-msg {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

/* ── Get the app CTA ──────────────────────────────────────────────── */

.cta-block {
  margin-top: 32px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
}
.cta-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
}
.cta-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
  line-height: 20px;
}
.store-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.store-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #000;
  color: #fff;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  min-width: 158px;
  transition: transform 120ms ease, border-color 120ms ease;
}
.store-btn:hover {
  border-color: #555;
  transform: translateY(-1px);
}
.store-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.store-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1;
}
.store-label-small {
  font-size: 10px;
  letter-spacing: 0.2px;
  opacity: 0.85;
  margin-bottom: 3px;
}
.store-label-big {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

/* Narrow phones: stack the store buttons */
@media (max-width: 380px) {
  .store-row { flex-direction: column; align-items: stretch; }
  .store-btn { min-width: 0; justify-content: center; }
}
