/* Hub-specific styles — extends theme.css design tokens */

/* ---- NAV ---- */
.hub-body {
  min-height: 100vh;
  background: var(--bg);
}

.hub-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 6, 11, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hub-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: var(--space-md);
}

.hub-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.hub-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.hub-logo:hover { color: var(--accent); }

.hub-badge {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 232, 157, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
}

.hub-tabs {
  display: flex;
  gap: 0.25rem;
}

.hub-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.hub-tab:hover { color: var(--fg); background: rgba(255,255,255,0.04); }
.hub-tab.active { color: var(--accent); background: var(--accent-dim); }
.hub-tab svg { opacity: 0.7; }
.hub-tab.active svg { opacity: 1; }

/* ---- MAIN AREA ---- */
.hub-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-md);
}

.hub-panel { display: none; }
.hub-panel.active { display: block; }
.hidden { display: none !important; }

/* ---- PANEL HEADER ---- */
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.panel-sub {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* ---- BUTTONS ---- */
.btn-primary {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #000;
  background: var(--accent);
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.full-width { width: 100%; justify-content: center; }

.btn-ghost {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.2); }
.btn-ghost.full-width { width: 100%; }

.btn-icon {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: color 0.2s;
}

.btn-icon:hover { color: var(--fg); }
.btn-icon.danger:hover { color: #ff5555; }

/* ---- FILTER CHIPS ---- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.chip {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover { border-color: rgba(0,232,157,0.3); color: var(--accent); }
.chip.active { background: var(--accent-dim); border-color: rgba(0,232,157,0.3); color: var(--accent); }

/* ---- DATA TABLE ---- */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead {
  background: var(--bg-card);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.data-table th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--fg);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.empty-row td {
  text-align: center;
  color: var(--fg-muted);
  padding: 2rem;
  font-size: 0.9rem;
}

/* Status badges */
.status-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  cursor: pointer;
}

.status-idea     { background: rgba(136,136,160,0.15); color: #8888a0; }
.status-scripted { background: rgba(100,149,237,0.15); color: #6495ed; }
.status-filmed   { background: rgba(255,165,0,0.15);   color: #ffa500; }
.status-published { background: rgba(0,232,157,0.15);  color: var(--accent); }

/* Niche tag */
.niche-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  color: var(--fg-muted);
  text-transform: capitalize;
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: var(--space-md);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.modal-close:hover { color: var(--fg); }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: var(--space-md);
}

/* ---- FORMS ---- */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-field label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}

.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.2s;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(0,232,157,0.4);
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: rgba(136,136,160,0.6); }

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: var(--space-md);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--fg);
}

/* ---- SCRIPTS PANEL ---- */
.scripts-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  align-items: start;
}

.niche-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.niche-pill {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.niche-pill:hover { border-color: rgba(0,232,157,0.3); color: var(--accent); }
.niche-pill.active { background: var(--accent-dim); border-color: rgba(0,232,157,0.3); color: var(--accent); }

.script-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: var(--space-md) 0 1rem;
  color: var(--fg-muted);
  font-size: 0.8rem;
}
.script-divider::before, .script-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.06);
}

.script-section {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border-left: 3px solid transparent;
}

.script-section:nth-child(1) { border-left-color: var(--accent); }
.script-section:nth-child(2) { border-left-color: #6495ed; }
.script-section:nth-child(3) { border-left-color: #ffa500; }

.script-section-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.hook-label { color: var(--accent); }
.body-label { color: #6495ed; }
.cta-label  { color: #ffa500; }

.script-section p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
}

/* Script history list */
.history-item {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.history-item:hover { border-color: rgba(0,232,157,0.2); }
.history-item:last-child { margin-bottom: 0; }

.history-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.history-item-topic {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.4;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-meta {
  font-size: 0.75rem;
  color: var(--fg-muted);
}

/* ---- AFFILIATE PANEL ---- */
.affiliate-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-md);
  align-items: start;
}

.affiliate-form-card { position: sticky; top: 80px; }

/* Tracking URL copy button */
.tracking-url-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tracking-url-text {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--fg-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.click-count {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---- SPINNER ---- */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: var(--fg);
  z-index: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slide-up 0.2s ease;
}

.toast.success { border-color: rgba(0,232,157,0.3); color: var(--accent); }
.toast.error   { border-color: rgba(255,85,85,0.3);  color: #ff5555; }

@keyframes slide-up {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.empty-state {
  color: var(--fg-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 1.5rem 0;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hub-nav-inner { padding: 0 1rem; }
  .hub-badge { display: none; }
  .hub-tab span { display: none; }

  .hub-main { padding: 1rem; }

  .panel-header { flex-direction: column; align-items: flex-start; }
  .panel-header .btn-primary { align-self: flex-start; }

  .scripts-layout { grid-template-columns: 1fr; }
  .affiliate-layout { grid-template-columns: 1fr; }
  .affiliate-form-card { position: static; }

  .form-row.two-col { grid-template-columns: 1fr; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn-ghost { order: 2; }
  .modal-actions .btn-primary { order: 1; }
}

/* ---- PRO / PAYWALL ---- */
.hub-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.hub-upgrade-btn {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: #000;
  background: var(--accent);
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.hub-upgrade-btn:hover { opacity: 0.85; }

.hub-pro-badge {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,232,157,0.25);
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
}

.free-counter {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

/* Paywall overlay */
.paywall-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6,6,11,0.92);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

#tab-scripts { position: relative; }

.paywall-box {
  background: var(--bg-card);
  border: 1px solid rgba(0,232,157,0.2);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.paywall-icon { font-size: 2.5rem; }

.paywall-box h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.paywall-box p {
  color: var(--fg-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.paywall-link {
  font-size: 0.82rem;
  color: var(--fg-muted);
  text-decoration: underline;
}
.paywall-link:hover { color: var(--accent); }

/* Pro niche pills — locked for free */
.niche-pill.pro-niche.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.pro-lock-icon { font-size: 0.65rem; }

/* Bulk card */
.bulk-card { margin-top: var(--space-md); }

.bulk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.pro-feature-tag {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0,232,157,0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
}

.bulk-hooks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bulk-hook-item {
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.5;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.bulk-hook-num {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.bulk-upgrade-prompt {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  border: 1px dashed rgba(0,232,157,0.2);
}

.bulk-upgrade-prompt p { font-size: 0.88rem; color: var(--fg-muted); }

.scripts-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* CSV export btn — shown but muted for free */
#btn-csv-export.locked {
  opacity: 0.4;
  cursor: not-allowed;
}
