/* TrendAI Design System — Breach Protocol */

@font-face {
  font-family: 'Gotham';
  src: url('/brand/fonts/Gotham/Gotham Bold.otf') format('opentype');
  font-weight: 700;
}
@font-face {
  font-family: 'Work Sans';
  src: url('/brand/fonts/WorkSans/WorkSans-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Work Sans';
  src: url('/brand/fonts/WorkSans/WorkSans-Medium.ttf') format('truetype');
  font-weight: 500;
}
@font-face {
  font-family: 'Work Sans';
  src: url('/brand/fonts/WorkSans/WorkSans-SemiBold.ttf') format('truetype');
  font-weight: 600;
}
@font-face {
  font-family: 'Work Sans';
  src: url('/brand/fonts/WorkSans/WorkSans-Bold.ttf') format('truetype');
  font-weight: 700;
}
@font-face {
  font-family: 'Inter';
  src: url('/brand/fonts/Inter/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Inter';
  src: url('/brand/fonts/Inter/Inter-Medium.ttf') format('truetype');
  font-weight: 500;
}
@font-face {
  font-family: 'Inter';
  src: url('/brand/fonts/Inter/Inter-SemiBold.ttf') format('truetype');
  font-weight: 600;
}
@font-face {
  font-family: 'Inter';
  src: url('/brand/fonts/Inter/Inter-Bold.ttf') format('truetype');
  font-weight: 700;
}

:root {
  --background:   #000000;
  --card:         #0a0a0a;
  --card-border:  #1a1a1a;
  --input-bg:     #111111;
  --input-border: #333333;
  --foreground:   #e5e5e5;
  --muted:        #888888;
  --muted-2:      #666666;
  --placeholder:  #444444;
  --red:          #d71920;
  --red-dark:     #b81419;
  --amber:        #ff9500;
  --signal:       #2e0fe4;
  --error:        #ff6b6f;
  --success:      #22c55e;
  --warning:      #ff9500;
  --gold:         #ffd700;
  --silver:       #c0c0c0;
  --bronze:       #cd7f32;
}

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

html, body {
  height: 100%;
  background: var(--background);
  color: var(--foreground);
  font-family: 'Work Sans', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── TYPOGRAPHY ── */

h1, h2, h3, .heading {
  font-family: 'Gotham', 'Work Sans', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--foreground);
}
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

.label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.muted { color: var(--muted); }
.error-text { color: var(--error); font-size: 12px; }
.success-text { color: var(--success); font-size: 12px; }

/* ── BUTTONS ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-family: 'Work Sans', ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--red) 0%, var(--amber) 100%);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--input-border);
}
.btn-outline:hover:not(:disabled) { border-color: var(--red); color: var(--foreground); }

.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { opacity: 0.85; transform: translateY(-1px); }

.btn-success {
  background: var(--success);
  color: #000;
}
.btn-success:hover:not(:disabled) { opacity: 0.85; transform: translateY(-1px); }

.btn-sm { padding: 7px 14px; font-size: 11px; }
.btn-lg { padding: 16px 32px; font-size: 15px; }
.btn-full { width: 100%; }

/* ── CARD ── */

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.card-sm { padding: 16px 20px; border-radius: 12px; }

/* ── INPUTS ── */

.input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Work Sans', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--red); }
.input::placeholder { color: var(--placeholder); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group { margin-bottom: 18px; }

/* ── BADGE ── */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-red    { background: rgba(215,25,32,0.2);  color: var(--red); }
.badge-green  { background: rgba(34,197,94,0.2);  color: var(--success); }
.badge-amber  { background: rgba(255,149,0,0.2);  color: var(--amber); }
.badge-gray   { background: rgba(136,136,136,0.15); color: var(--muted); }
.badge-blue   { background: rgba(59,130,246,0.2); color: #60a5fa; }

/* ── MODAL ── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal { max-width: 480px; width: 90%; max-height: 90vh; overflow-y: auto; }

/* ── SPINNER ── */

.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--input-border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── METRICS BAR ── */

.metrics-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.metric {
  flex: 1;
  min-width: 120px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px 16px;
}

.metric-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.metric-value {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--foreground);
}

.metric-value.danger { color: var(--error); }
.metric-value.warning { color: var(--warning); }
.metric-value.success { color: var(--success); }

/* ── VOTE BAR ── */

.vote-bar {
  height: 6px;
  background: var(--card-border);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.vote-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--amber));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ── COUNTDOWN ── */

.countdown {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 80px;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--foreground);
  line-height: 1;
}
.countdown.urgent { color: var(--error); }
.countdown.warning { color: var(--warning); }

/* ── PHASE BADGE ── */

.phase-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.phase-discussion { background: rgba(46,15,228,0.2); color: #818cf8; }
.phase-voting    { background: rgba(255,149,0,0.2); color: var(--amber); }
.phase-disruption { background: rgba(215,25,32,0.2); color: var(--red); }
.phase-results   { background: rgba(34,197,94,0.2); color: var(--success); }

/* ── DISRUPTION CARD ── */

.disruption-card {
  background: rgba(215,25,32,0.06);
  border: 1px solid rgba(215,25,32,0.3);
  border-radius: 16px;
  padding: 24px;
  animation: pulse-border 2s ease-in-out infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: rgba(215,25,32,0.3); }
  50%       { border-color: rgba(215,25,32,0.8); }
}

/* ── OPTION CARDS ── */

.option-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.option-card:hover:not(.disabled):not(.selected) {
  border-color: var(--muted);
}
.option-card.selected {
  border-color: var(--red);
  background: rgba(215,25,32,0.06);
}
.option-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.option-card .option-label {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.option-card .option-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.option-card .option-effects {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.effect-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--card-border);
  color: var(--muted);
}
.effect-chip.positive { background: rgba(34,197,94,0.15); color: var(--success); }
.effect-chip.negative { background: rgba(215,25,32,0.15); color: var(--error); }
.effect-chip.locked   { background: rgba(255,149,0,0.15); color: var(--amber); }

/* ── LOGO ── */

.logo { height: 28px; width: auto; }
.logo-sm { height: 20px; }

/* ── NAV ── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(8px);
  z-index: 100;
}

/* ── TABS ── */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab.active { color: var(--foreground); border-bottom-color: var(--red); }
.tab:hover:not(.active) { color: var(--foreground); }

/* ── TABLE ── */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--card-border);
}
td {
  padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px; color: var(--foreground);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── SCOREBOARD RANKS ── */

.rank-1 { color: var(--gold); }
.rank-2 { color: var(--silver); }
.rank-3 { color: var(--bronze); }

/* ── UTILITY ── */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.w-full { width: 100%; }

/* ── GRADIENT TEXT ── */

.gradient-text {
  background: linear-gradient(135deg, var(--red) 0%, var(--amber) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── TOAST NOTIFICATIONS ── */

.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  max-width: 320px;
  animation: slide-in 0.2s ease;
}
.toast.toast-error  { border-color: var(--error); }
.toast.toast-success { border-color: var(--success); }
.toast.toast-warning { border-color: var(--warning); }
@keyframes slide-in { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── ELIMINATED STATE ── */

.eliminated-overlay {
  position: fixed; inset: 0;
  background: rgba(215,25,32,0.15);
  border: 4px solid var(--red);
  z-index: 500;
  pointer-events: none;
  animation: eliminated-pulse 1.5s ease-in-out infinite;
}
@keyframes eliminated-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ── RESPONSIVE ── */

@media (max-width: 600px) {
  .card { padding: 20px 16px; border-radius: 12px; }
  .countdown { font-size: 56px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
