/* Broadcaster Hub — profile, stats, history, Go Live */

@keyframes hubRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes liveSweep {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.hub-page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  animation: hubRise 0.45s ease-out;
}

.hub-hero {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding: 1.5rem 0 1.75rem;
  border-bottom: 1px solid rgba(16, 24, 32, 0.1);
}

@media (min-width: 768px) {
  .hub-hero {
    grid-template-columns: 1.4fr auto;
    align-items: end;
  }
}

.hub-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--steel);
}

.hub-title {
  margin-top: 0.45rem;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 0.95;
  color: var(--ink);
}

.hub-subtitle {
  margin-top: 0.75rem;
  max-width: 34rem;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(16, 24, 32, 0.68);
}

.hub-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.hub-go-live {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 10rem;
  background: var(--signal);
  padding: 0.9rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.hub-go-live:hover {
  background: var(--signal-hover);
  transform: translateY(-1px);
}

.hub-go-live.is-live {
  background:
    linear-gradient(90deg, #d62828, #b82222, #d62828);
  background-size: 200% 200%;
  animation: liveSweep 2.4s linear infinite;
}

.hub-secondary-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--steel);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}

.hub-tab {
  border: 1px solid rgba(16, 24, 32, 0.12);
  background: transparent;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(16, 24, 32, 0.65);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hub-tab:hover {
  border-color: var(--steel);
  color: var(--ink);
}

.hub-tab.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.hub-section {
  animation: hubRise 0.35s ease-out;
}

.hub-section-title {
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1;
  color: var(--ink);
}

.hub-section-copy {
  margin-top: 0.55rem;
  margin-bottom: 1.25rem;
  max-width: 36rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(16, 24, 32, 0.68);
}

.hub-metrics {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 640px) {
  .hub-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .hub-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

.hub-metric {
  padding: 0.15rem 0 0.85rem;
  border-bottom: 1px solid rgba(16, 24, 32, 0.1);
}

.hub-metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(16, 24, 32, 0.55);
}

.hub-metric-value {
  margin-top: 0.4rem;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink);
}

.hub-metric-note {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: rgba(16, 24, 32, 0.6);
}

.hub-tier-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  margin-bottom: 1.75rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(16, 24, 32, 0.08);
  border-bottom: 1px solid rgba(16, 24, 32, 0.08);
}

.hub-tier-name {
  font-family: "Archivo Black", sans-serif;
  font-size: 1.15rem;
  color: var(--ink);
}

.hub-tier-meta {
  font-size: 0.9rem;
  color: rgba(16, 24, 32, 0.65);
}

.hub-history {
  display: grid;
  gap: 0;
}

.hub-history-row {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(16, 24, 32, 0.1);
}

@media (min-width: 768px) {
  .hub-history-row {
    grid-template-columns: 1.5fr 0.7fr 0.7fr 0.7fr;
    gap: 1rem;
    align-items: center;
  }
}

.hub-history-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.hub-history-meta {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: rgba(16, 24, 32, 0.6);
}

.hub-history-stat {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(16, 24, 32, 0.78);
}

.hub-history-empty {
  padding: 1.25rem 0;
  color: rgba(16, 24, 32, 0.62);
}

.hub-form {
  display: grid;
  gap: 1rem;
  max-width: 36rem;
}

.hub-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(16, 24, 32, 0.6);
}

.hub-input,
.hub-select,
.hub-textarea {
  width: 100%;
  border: 1px solid rgba(16, 24, 32, 0.14);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 0.9rem;
  color: var(--ink);
  outline: none;
}

.hub-textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.hub-input:focus,
.hub-select:focus,
.hub-textarea:focus {
  border-color: var(--steel);
  box-shadow: 0 0 0 2px rgba(31, 75, 110, 0.18);
}

.hub-form-row {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .hub-form-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.hub-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 0.8rem 1.25rem;
  font-weight: 700;
  color: #fff;
  transition: background 0.15s ease;
}

.hub-save:hover {
  background: var(--steel);
}

.hub-status {
  font-size: 0.88rem;
  color: var(--steel);
}

.hub-status.is-error {
  color: var(--signal);
}

.hub-note {
  margin-top: 2rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(16, 24, 32, 0.55);
}

/* Go Live overlay */
.hub-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 0;
  background: rgba(16, 24, 32, 0.55);
}

@media (min-width: 768px) {
  .hub-modal-backdrop {
    place-items: center;
    padding: 1.5rem;
  }
}

.hub-modal {
  width: min(42rem, 100%);
  max-height: min(92vh, 52rem);
  overflow: auto;
  background:
    radial-gradient(ellipse 70% 40% at 100% 0%, rgba(31, 75, 110, 0.16), transparent 55%),
    linear-gradient(180deg, #f7fafc 0%, #eef3f7 100%);
  border: 1px solid rgba(16, 24, 32, 0.12);
  padding: 1.35rem 1.25rem 1.5rem;
  animation: hubRise 0.3s ease-out;
}

@media (min-width: 768px) {
  .hub-modal {
    padding: 1.75rem;
  }
}

.hub-modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.hub-modal-title {
  font-family: "Archivo Black", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--ink);
}

.hub-modal-copy {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(16, 24, 32, 0.65);
}

.hub-modal-close {
  border: 1px solid rgba(16, 24, 32, 0.14);
  background: transparent;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.hub-preview-stage {
  position: relative;
  margin: 1rem 0;
  min-height: 14rem;
  background: #101820;
  overflow: hidden;
}

.hub-preview-video {
  display: block;
  width: 100%;
  min-height: 14rem;
  max-height: 40vh;
  object-fit: cover;
  background: #0b1118;
}

.hub-preview-fallback {
  display: grid;
  place-items: center;
  min-height: 14rem;
  padding: 1.25rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.hub-live-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--signal);
  padding: 0.28rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.hub-live-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #fff;
  animation: pulseDot 1.8s ease-in-out infinite;
}

.hub-setup-status {
  display: grid;
  gap: 0.55rem;
  margin: 0.85rem 0 1.1rem;
}

.hub-setup-line {
  font-size: 0.88rem;
  color: rgba(16, 24, 32, 0.72);
}

.hub-setup-line.is-ready {
  color: var(--steel);
  font-weight: 600;
}

.hub-setup-line.is-error {
  color: var(--signal);
  font-weight: 600;
}

.hub-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid rgba(16, 24, 32, 0.16);
  background: transparent;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hub-btn:hover {
  border-color: var(--ink);
}

.hub-btn.is-primary {
  border-color: var(--signal);
  background: var(--signal);
  color: #fff;
}

.hub-btn.is-primary:hover {
  background: var(--signal-hover);
  border-color: var(--signal-hover);
}

.hub-btn.is-dark {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.hub-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hub-live-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(16, 24, 32, 0.75);
}
