/* ============================================================
   WantedLived — Main Stylesheet
   YouTube live stream tracking & analytics SaaS
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --bg-base:       #0d1117;
  --bg-surface:    #161b22;
  --bg-elevated:   #1c2330;
  --bg-overlay:    #21262d;

  --red:           #e53e3e;
  --red-hover:     #c53030;
  --red-glow:      rgba(229, 62, 62, 0.25);

  --blue:          #4299e1;
  --blue-hover:    #2b6cb0;
  --blue-glow:     rgba(66, 153, 225, 0.2);

  --text-primary:  #f0f6fc;
  --text-secondary:#8b949e;
  --text-muted:    #484f58;

  --border:        rgba(240, 246, 252, 0.08);
  --border-strong: rgba(240, 246, 252, 0.14);

  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-full:   9999px;

  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-red:    0 0 20px var(--red-glow);
  --shadow-blue:   0 0 20px var(--blue-glow);

  --font-sans:     system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:     'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;

  --nav-h:         60px;
  --transition:    0.18s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  height: var(--nav-h);
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.navbar-brand .brand-dot {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red);
  animation: pulse-dot 2s ease infinite;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  object-fit: cover;
  cursor: pointer;
  transition: border-color var(--transition);
}

.user-avatar:hover { border-color: var(--red); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 64px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(229,62,62,0.08) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: -10%;
  width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(66,153,225,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(229,62,62,0.1);
  border: 1px solid rgba(229,62,62,0.25);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  margin-bottom: 24px;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-title .accent { color: var(--red); }

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 40px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.hero-stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   FEATURES GRID
   ============================================================ */
.features-section { padding: 96px 0; }

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 750;
  letter-spacing: -0.025em;
  margin-bottom: 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.feature-icon.red  { background: rgba(229,62,62,0.12); color: var(--red); }
.feature-icon.blue { background: rgba(66,153,225,0.12); color: var(--blue); }

.feature-title {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================================================
   CARD (shared)
   ============================================================ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
}

.card-body { padding: 20px; }

/* ============================================================
   DASHBOARD — Channel Cards
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 32px 0 64px;
}

.channel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.channel-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.channel-thumbnail {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-overlay);
}

.channel-info { flex: 1; min-width: 0; }

.channel-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(229,62,62,0.12);
  border: 1px solid rgba(229,62,62,0.3);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--red);
  flex-shrink: 0;
}

.live-dot {
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--red);
  animation: pulse-dot 1.6s ease infinite;
}

/* ============================================================
   LIVE PAGE
   ============================================================ */
.live-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  padding: 24px 0 64px;
}

.live-info-card { margin-bottom: 20px; }

.viewers-count {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.viewers-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chart-area {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.chat-feed {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 480px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-overlay) transparent;
}

.chat-msg { font-size: 0.83rem; line-height: 1.5; }

.chat-author {
  font-weight: 650;
  color: var(--blue);
  margin-right: 4px;
}

.chat-input-wrap {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15);
}

.add-channel-form {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-hover);
  box-shadow: var(--shadow-red);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: #9b2c2c;
  transform: scale(0.97);
  box-shadow: none;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--blue);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--blue-hover);
  box-shadow: var(--shadow-blue);
  transform: translateY(-1px);
}

.btn-secondary:active {
  background: #1a4f7a;
  transform: scale(0.97);
  box-shadow: none;
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-outline:active {
  transform: scale(0.97);
}

.btn-outline:focus-visible {
  outline: 2px solid var(--text-secondary);
  outline-offset: 2px;
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.btn-full { width: 100%; justify-content: center; }

.btn-large { padding: 14px 32px; font-size: 1rem; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(16px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal-content { transform: translateY(0); }

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-card);
  min-width: 260px;
  animation: slide-in 0.22s ease;
}

.toast.success { border-left: 3px solid #48bb78; }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }

/* ============================================================
   PRICING
   ============================================================ */
.pricing-section { padding: 96px 0; text-align: center; }

.pricing-card {
  max-width: 400px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--blue));
}

.pricing-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  margin-bottom: 20px;
}

.pricing-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.pricing-price {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}

.pricing-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.pricing-features {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pricing-features li::before {
  content: '';
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(72,187,120,0.15);
  border: 1.5px solid rgba(72,187,120,0.4);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 8l2.5 2.5L12 5' stroke='%2348bb78' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 14px;
  background-repeat: no-repeat;
  background-position: center;
}

/* ============================================================
   FOOTER
   ============================================================ */
/* ── Nav container (index, terms, privacy) ── */
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-dashboard {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-dashboard:hover { color: var(--text-primary); }

.user-avatar img {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  object-fit: cover;
  cursor: pointer;
  transition: border-color var(--transition);
}

.user-avatar img:hover { border-color: var(--red); }

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--text-secondary); }

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.youtube-attribution {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 8px;
}

.business-info {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

/* ── Site footer (terms, privacy) ── */
footer.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

footer.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

footer.site-footer a:hover {
  color: var(--text-primary);
}

/* ── Global focus & interactive states ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,62,62,0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(229,62,62,0); }
}

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

@keyframes slide-in {
  from { transform: translateX(24px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
  .live-layout   { grid-template-columns: 1fr; }
  .chat-feed     { height: 340px; }
  .hero-stats    { flex-wrap: wrap; gap: 24px; }
  .add-channel-form { flex-direction: column; }
  .pricing-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .features-grid   { grid-template-columns: 1fr; }
  .navbar-nav      { display: none; }
  .hero-cta        { flex-direction: column; }
  .footer-inner    { flex-direction: column; text-align: center; }
  .footer-links    { justify-content: center; flex-wrap: wrap; }
  .footer-content  { flex-direction: column; text-align: center; }
}
