/*
Theme Name: TrueBroadcast
Theme URI: https://truebroadcast.com
Description: Custom dark theme for the TrueBroadcast Perspective Engine. Designed to work seamlessly with the TrueBroadcast plugin.
Version: 1.0.0
Author: TrueBroadcast
Author URI: https://truebroadcast.com
License: GPL-2.0+
Text Domain: truebroadcast-theme
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif&family=IBM+Plex+Mono:wght@400;500;700&display=swap');

:root {
  --tb-bg: #07070A;
  --tb-bg2: #0D0D11;
  --tb-bg3: #141418;
  --tb-text: #E0E0E0;
  --tb-text2: #999;
  --tb-text3: #555;
  --tb-accent: #4ABDE8;
  --tb-accent2: #3CC9A3;
  --tb-red: #E85454;
  --tb-amber: #D4943A;
  --tb-purple: #A87FE0;
  --tb-border: rgba(255,255,255,0.06);
  --tb-border2: rgba(255,255,255,0.1);
  --tb-font: 'DM Sans', sans-serif;
  --tb-serif: 'Instrument Serif', serif;
  --tb-mono: 'IBM Plex Mono', monospace;
  --tb-radius: 8px;
  --tb-max-width: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--tb-bg);
  color: var(--tb-text);
  font-family: var(--tb-font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--tb-accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #6dd0f0; }

img { max-width: 100%; height: auto; }

/* ─── Site Header ─── */
.tb-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,7,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tb-border);
}
.tb-site-header-inner {
  max-width: var(--tb-max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tb-site-logo {
  font-family: var(--tb-serif);
  font-size: 24px;
  color: var(--tb-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tb-site-logo a { color: inherit; }
.tb-site-logo .tb-logo-accent { color: var(--tb-accent); }
.tb-site-logo .tb-logo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--tb-red);
  box-shadow: 0 0 8px rgba(232,84,84,0.4);
  animation: tb-pulse 2s infinite;
}
@keyframes tb-pulse { 0%,100%{opacity:.3} 50%{opacity:1} }

/* ─── Main Nav ─── */
.tb-site-nav { display: flex; align-items: center; gap: 24px; }
.tb-site-nav a {
  font-size: 14px;
  color: var(--tb-text2);
  font-weight: 500;
  transition: color 0.2s;
}
.tb-site-nav a:hover { color: var(--tb-text); }
.tb-site-nav a.current { color: var(--tb-accent); }

/* ─── User Menu ─── */
.tb-user-area { position: relative; }
.tb-user-trigger {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 6px 12px;
  border-radius: 24px; border: 1px solid var(--tb-border);
  background: transparent; color: var(--tb-text);
  font-family: var(--tb-font); font-size: 13px; font-weight: 500;
  transition: all 0.2s;
}
.tb-user-trigger:hover { border-color: var(--tb-border2); background: var(--tb-bg3); }
.tb-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--tb-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  overflow: hidden;
}
.tb-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tb-user-credits {
  font-family: var(--tb-mono); font-size: 11px;
  color: var(--tb-accent2); font-weight: 700;
}
.tb-user-dropdown {
  display: none;
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  background: var(--tb-bg2); border: 1px solid var(--tb-border2);
  border-radius: var(--tb-radius); padding: 8px 0;
  min-width: 200px; box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 200;
}
.tb-user-area:hover .tb-user-dropdown,
.tb-user-area:focus-within .tb-user-dropdown { display: block; }
.tb-user-dropdown-header {
  padding: 12px 16px; border-bottom: 1px solid var(--tb-border);
}
.tb-user-dropdown-name { font-weight: 600; font-size: 14px; color: var(--tb-text); }
.tb-user-dropdown-email { font-size: 12px; color: var(--tb-text3); }
.tb-user-dropdown-credits {
  padding: 10px 16px; border-bottom: 1px solid var(--tb-border);
  font-family: var(--tb-mono); font-size: 13px;
}
.tb-user-dropdown a {
  display: block; padding: 8px 16px; font-size: 13px; color: var(--tb-text2);
}
.tb-user-dropdown a:hover { background: var(--tb-bg3); color: var(--tb-text); }
.tb-user-dropdown .tb-logout { color: var(--tb-red); }
.tb-user-dropdown .tb-logout:hover { background: rgba(232,84,84,0.08); }

/* Login button for guests */
.tb-login-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 20px;
  background: var(--tb-accent); color: #fff;
  font-size: 13px; font-weight: 600; border: none; cursor: pointer;
  font-family: var(--tb-font); transition: all 0.2s;
}
.tb-login-btn:hover { background: #5bc8ef; color: #fff; }

/* ─── Main Content ─── */
.tb-site-main {
  min-height: calc(100vh - 64px - 80px);
}
.tb-site-main-inner {
  max-width: var(--tb-max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.tb-page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 0;
}
.tb-page-content h1 {
  font-family: var(--tb-serif); font-size: 36px; font-weight: 400;
  margin-bottom: 24px; color: #F0F0F0;
}
.tb-page-content h2 {
  font-family: var(--tb-serif); font-size: 26px; font-weight: 400;
  margin: 32px 0 16px; color: #F0F0F0;
}
.tb-page-content p { margin-bottom: 16px; color: var(--tb-text2); line-height: 1.8; }
.tb-page-content ul, .tb-page-content ol { margin: 0 0 16px 24px; color: var(--tb-text2); }
.tb-page-content li { margin-bottom: 8px; line-height: 1.7; }

/* ─── Site Footer ─── */
.tb-site-footer {
  border-top: 1px solid var(--tb-border);
  padding: 32px 0;
}
.tb-site-footer-inner {
  max-width: var(--tb-max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.tb-footer-logo {
  font-family: var(--tb-serif); font-size: 18px;
  color: var(--tb-text3);
}
.tb-footer-logo .tb-logo-accent { color: var(--tb-accent); opacity: 0.5; }
.tb-footer-links { display: flex; gap: 20px; }
.tb-footer-links a { font-size: 13px; color: var(--tb-text3); }
.tb-footer-links a:hover { color: var(--tb-text2); }
.tb-footer-copy { font-size: 12px; color: var(--tb-text3); font-family: var(--tb-mono); }

/* ─── Pricing Page ─── */
.tb-pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin: 32px 0;
}
.tb-price-card {
  background: var(--tb-bg2); border: 1px solid var(--tb-border);
  border-radius: 12px; padding: 28px; text-align: center;
}
.tb-price-card.featured { border-color: var(--tb-accent); }
.tb-price-card-name { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--tb-text); }
.tb-price-card-price { font-family: var(--tb-serif); font-size: 36px; color: var(--tb-text); margin-bottom: 4px; }
.tb-price-card-period { font-size: 13px; color: var(--tb-text3); margin-bottom: 20px; }
.tb-price-card-features { text-align: left; margin-bottom: 24px; }
.tb-price-card-features li { font-size: 14px; color: var(--tb-text2); padding: 4px 0; list-style: none; }
.tb-price-card-features li::before { content: "✓ "; color: var(--tb-accent2); font-weight: 700; }
.tb-price-cta {
  display: inline-block; padding: 10px 28px; border-radius: 24px;
  font-size: 14px; font-weight: 600; cursor: pointer; border: none;
  font-family: var(--tb-font); transition: all 0.2s;
}
.tb-price-cta-primary { background: var(--tb-accent); color: #fff; }
.tb-price-cta-primary:hover { background: #5bc8ef; color: #fff; }
.tb-price-cta-secondary { background: var(--tb-bg3); color: var(--tb-text2); border: 1px solid var(--tb-border); }

/* ─── Blog ─── */
.tb-blog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 32px 0; }
.tb-blog-card {
  background: var(--tb-bg2); border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius); overflow: hidden; transition: border-color 0.2s;
}
.tb-blog-card:hover { border-color: var(--tb-border2); }
.tb-blog-card-body { padding: 20px; }
.tb-blog-card-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.tb-blog-card-title a { color: var(--tb-text); }
.tb-blog-card-title a:hover { color: var(--tb-accent); }
.tb-blog-card-excerpt { font-size: 14px; color: var(--tb-text3); line-height: 1.6; }
.tb-blog-card-meta { font-size: 12px; color: var(--tb-text3); margin-top: 12px; font-family: var(--tb-mono); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .tb-site-header-inner { height: 56px; padding: 0 16px; }
  .tb-site-logo { font-size: 20px; }
  .tb-site-nav { gap: 12px; }
  .tb-site-nav a { font-size: 12px; }
  .tb-page-content { padding: 32px 0; }
  .tb-page-content h1 { font-size: 28px; }
  .tb-pricing-grid { grid-template-columns: 1fr; }
  .tb-blog-grid { grid-template-columns: 1fr; }
  .tb-site-footer-inner { flex-direction: column; text-align: center; }
}

/* ─── WP Admin Bar Fix ─── */
body.admin-bar .tb-site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .tb-site-header { top: 46px; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--tb-bg); }
::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }
