/* ═══════════════════════════════════════════
   PLAYBOOK SITE — Premium Documentation Hub (Linear/Stripe Style)
   UI/UX Pro Max Edition
   ═══════════════════════════════════════════ */

   :root {
    --bg-base: #0a0a0b;
    --bg-surface: #111214;
    --bg-elevated: #1a1b1e;
    
    --border-dim: rgba(255,255,255,0.06);
    --border-strong: rgba(255,255,255,0.12);
    
    --text-primary: #f7f8f8;
    --text-secondary: #8a8f98;
    --text-muted: #5e646d;
    
    --brand-primary: #5e6ad2;
    --brand-hover: #737fe6;
    
    /* iatiza subtle accents */
    --accent-blue: #2322d6;
    --accent-lime: #c8ff00;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Berkeley Mono', ui-monospace, monospace;
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --sidebar-width: 280px;
    --content-max: 840px;
  }
  
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  
  html { scroll-behavior: smooth; scroll-padding-top: 40px; }
  
  body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }
  
  a { text-decoration: none; color: inherit; }
  
  /* ═══════ LAYOUT ═══════ */
  .layout {
    display: flex;
    min-height: 100vh;
  }
  
  /* ═══════ MOBILE HEADER ═══════ */
  .mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-dim);
    position: sticky; top: 0; z-index: 100;
  }
  .mobile-logo { display: flex; align-items: center; gap: 8px; font-weight: 590; font-size: 14px; }
  .mobile-menu-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; }
  
  /* ═══════ SIDEBAR ═══════ */
  .sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-dim);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 50;
  }
  .sidebar::-webkit-scrollbar { width: 4px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
  
  .sidebar-header {
    padding: 24px 24px 16px;
  }
  .brand { display: flex; align-items: center; gap: 10px; }
  .brand-logo { height: 20px; }
  .brand-badge {
    font-size: 11px; font-weight: 590; color: var(--bg-base);
    background: var(--text-primary); padding: 2px 6px; border-radius: var(--radius-sm);
  }
  
  .sidebar-search { padding: 0 24px 16px; }
  .search-input-wrap {
    position: relative; display: flex; align-items: center;
  }
  .search-icon {
    position: absolute; left: 12px; color: var(--text-secondary);
  }
  .search-input-wrap input {
    width: 100%;
    background: var(--bg-base); border: 1px solid var(--border-dim);
    color: var(--text-primary); font-family: var(--font-sans);
    font-size: 13px; padding: 8px 36px 8px 36px;
    border-radius: var(--radius-md); transition: border-color 0.2s;
  }
  .search-input-wrap input:focus { outline: none; border-color: var(--brand-primary); }
  .search-input-wrap kbd {
    position: absolute; right: 8px; font-family: var(--font-sans);
    font-size: 11px; color: var(--text-muted);
    background: var(--bg-elevated); padding: 2px 4px; border-radius: 4px;
    border: 1px solid var(--border-dim);
  }
  
  .sidebar-nav { padding: 0 16px 24px; flex: 1; }
  .nav-group { margin-bottom: 24px; }
  .nav-label {
    font-size: 11px; font-weight: 590; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-muted);
    padding: 0 8px; margin-bottom: 8px;
  }
  .nav-link {
    display: flex; align-items: center; gap: 10px;
    font-size: 13.5px; color: var(--text-secondary);
    padding: 8px; border-radius: var(--radius-sm);
    transition: all 0.2s; margin-bottom: 2px;
  }
  .nav-link svg { opacity: 0.7; }
  .nav-link:hover, .nav-link.active {
    color: var(--text-primary); background: var(--border-dim);
  }
  .nav-link.active svg { opacity: 1; color: var(--brand-primary); }
  
  .nav-sublinks {
    margin-left: 24px; padding-left: 10px;
    border-left: 1px solid var(--border-dim);
    display: flex; flex-direction: column; gap: 4px; margin-top: 4px;
  }
  .nav-sublink {
    font-size: 12.5px; color: var(--text-muted);
    padding: 4px 8px; border-radius: var(--radius-sm); transition: color 0.2s;
  }
  .nav-sublink:hover, .nav-sublink.active {
    color: var(--text-primary); background: var(--border-dim);
  }
  
  .sidebar-footer {
    padding: 24px; border-top: 1px solid var(--border-dim);
  }
  .btn-download {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; background: var(--brand-primary); color: white;
    font-size: 13px; font-weight: 590; padding: 10px;
    border-radius: var(--radius-md); transition: background 0.2s;
  }
  .btn-download:hover { background: var(--brand-hover); }
  
  /* ═══════ MAIN CONTENT ═══════ */
  .main-content {
    flex: 1; min-width: 0; padding: 48px 64px 80px;
  }
  .content-wrapper {
    max-width: var(--content-max); margin: 0 auto;
  }
  
  .doc-section { margin-bottom: 80px; }
  
  .badge-accent {
    display: inline-block; font-size: 12px; font-weight: 590;
    color: var(--brand-primary); background: rgba(94,106,210,0.1);
    padding: 4px 10px; border-radius: 99px; margin-bottom: 16px;
  }
  
  .doc-title { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 24px; }
  .doc-lead { font-size: 18px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 40px; max-width: 90%; }
  
  .doc-title-h2 { font-size: 24px; font-weight: 600; margin-bottom: 16px; letter-spacing: -0.01em; }
  .doc-body { font-size: 15px; color: var(--text-secondary); margin-bottom: 32px; }
  
  .divider { border: none; border-top: 1px solid var(--border-dim); margin: 60px 0; }
  
  /* UI/UX Pro Max Info Cards */
  .info-card {
    display: flex; gap: 16px; padding: 24px;
    background: var(--bg-surface); border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg); align-items: flex-start;
  }
  .info-icon { color: var(--brand-primary); flex-shrink: 0; }
  .info-content strong { display: block; font-size: 14px; margin-bottom: 4px; color: var(--text-primary); }
  .info-content p { font-size: 14px; color: var(--text-secondary); }
  
  /* Grid 2x2 */
  .grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .def-card {
    padding: 24px; background: var(--bg-surface);
    border: 1px solid var(--border-dim); border-radius: var(--radius-lg);
  }
  .def-card h3 { font-size: 15px; font-weight: 590; margin-bottom: 8px; color: var(--text-primary); }
  .def-card p { font-size: 14px; color: var(--text-secondary); }
  
  /* Formula Visual */
  .formula-visual {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 32px;
  }
  .f-block {
    flex: 1; min-width: 120px; padding: 20px;
    background: var(--bg-surface); border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg); text-align: center; position: relative;
  }
  .f-num {
    position: absolute; top: 12px; left: 12px;
    font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  }
  .f-block strong { display: block; font-size: 13px; font-weight: 700; letter-spacing: 0.05em; margin: 16px 0 4px; }
  .f-block p { font-size: 12px; color: var(--text-secondary); }
  .f-plus { color: var(--text-muted); font-size: 20px; }
  
  /* Tonalities without harsh colors */
  .f-block[data-color="blue"] strong { color: #6ea8fe; }
  .f-block[data-color="purple"] strong { color: #b48afe; }
  .f-block[data-color="green"] strong { color: #4ade80; }
  .f-block[data-color="orange"] strong { color: #fb923c; }
  .f-block[data-color="red"] strong { color: #f87171; }
  
  .txt-blue { color: #6ea8fe; }
  .txt-purple { color: #b48afe; }
  .txt-green { color: #4ade80; }
  .txt-orange { color: #fb923c; }
  .txt-red { color: #f87171; }
  
  .example-box {
    background: #000; border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg); padding: 32px; position: relative;
  }
  .example-label {
    position: absolute; top: -10px; left: 24px; background: var(--bg-base);
    padding: 0 8px; font-size: 11px; font-weight: 590; color: var(--text-muted); text-transform: uppercase;
  }
  .example-box code {
    font-family: var(--font-mono); font-size: 13.5px; line-height: 1.8;
  }
  
  /* Templates Grid */
  .filter-bar {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px;
  }
  .filter-btn {
    background: var(--bg-surface); border: 1px solid var(--border-dim);
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    padding: 6px 14px; border-radius: 99px; cursor: pointer; transition: all 0.2s;
  }
  .filter-btn:hover { border-color: var(--text-muted); color: var(--text-primary); }
  .filter-btn.active { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }
  
  .templates-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
  .template-card {
    background: var(--bg-surface); border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg); transition: border-color 0.2s;
  }
  .template-card:hover { border-color: var(--border-strong); }
  .template-header {
    padding: 20px 24px; display: flex; align-items: center; gap: 16px; cursor: pointer; user-select: none;
  }
  .t-icon {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: var(--border-dim); border-radius: var(--radius-md); color: var(--text-secondary);
  }
  .t-info { flex: 1; }
  .t-name { font-size: 15px; font-weight: 590; color: var(--text-primary); }
  .t-meta { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
  .t-badge {
    font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border-dim);
    color: var(--text-muted); margin-right: 16px;
  }
  .t-chevron { color: var(--text-muted); transition: transform 0.2s; }
  .template-card.open .t-chevron { transform: rotate(180deg); }
  
  .template-body { display: none; padding: 0 24px 24px; border-top: 1px solid var(--border-dim); }
  .template-card.open .template-body { display: block; padding-top: 24px; }
  
  .fourq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
  .fourq { font-size: 13.5px; color: var(--text-secondary); }
  .fourq-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
  .fourq-praque { grid-column: 1 / -1; }
  
  .prompt-box {
    background: #000; border: 1px solid var(--border-strong);
    border-radius: var(--radius-md); padding: 20px; position: relative;
  }
  .prompt-box pre {
    font-family: var(--font-mono); font-size: 13px; line-height: 1.6; color: var(--text-primary);
    white-space: pre-wrap; word-break: break-word;
  }
  .btn-copy {
    position: absolute; top: 12px; right: 12px;
    background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong);
    font-size: 11px; font-weight: 590; padding: 4px 12px; border-radius: 6px; cursor: pointer; transition: all 0.2s;
  }
  .btn-copy:hover { background: var(--text-primary); color: var(--bg-base); }

  /* Example Before/After */
  .example-section { margin-top: 24px; }
  .example-section-label {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--brand-primary); margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
  }
  .example-section-label svg { opacity: 0.7; }
  .example-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .example-col { position: relative; }
  .example-col-label {
    font-size: 11px; font-weight: 590; text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
  }
  .example-col-label.bad { color: #f87171; }
  .example-col-label.good { color: #4ade80; }
  .example-col-content {
    font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7;
    padding: 16px; border-radius: var(--radius-md); color: var(--text-secondary);
  }
  .example-col.bad-col .example-col-content {
    background: rgba(248,113,113,0.06); border: 1px solid rgba(248,113,113,0.15);
  }
  .example-col.good-col .example-col-content {
    background: rgba(74,222,128,0.06); border: 1px solid rgba(74,222,128,0.15);
  }

  /* Practical tip */
  .template-tip {
    display: flex; gap: 12px; padding: 16px;
    background: rgba(94,106,210,0.06); border: 1px solid rgba(94,106,210,0.12);
    border-radius: var(--radius-md); margin-top: 16px; align-items: flex-start;
  }
  .template-tip svg { flex-shrink: 0; color: var(--brand-primary); margin-top: 1px; }
  .template-tip p { font-size: 13.5px; color: var(--text-secondary); }
  .template-tip strong { color: var(--text-primary); }

  /* Image placeholder areas */
  .img-slot {
    width: 100%; min-height: 200px; border-radius: var(--radius-lg);
    background: var(--bg-elevated); border: 1px dashed var(--border-strong);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; margin: 32px 0; color: var(--text-muted); font-size: 13px;
    transition: border-color 0.2s;
  }
  .img-slot:hover { border-color: var(--brand-primary); }
  .img-slot svg { opacity: 0.4; }
  .img-slot-label { max-width: 300px; text-align: center; line-height: 1.4; }

  /* Section illustration */
  .section-illustration {
    width: 100%; aspect-ratio: 16/7; border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(94,106,210,0.08) 100%);
    border: 1px solid var(--border-dim); margin-bottom: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 13px;
  }

  @media (max-width: 768px) {
    .example-columns { grid-template-columns: 1fr; }
  }
  
  /* Advanced */
  .adv-card {
    padding: 24px; background: var(--bg-surface); border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg); margin-bottom: 16px;
  }
  .adv-card h3 { font-size: 16px; font-weight: 590; margin-bottom: 8px; }
  .adv-card p { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
  .code-preview {
    font-family: var(--font-mono); font-size: 13px; color: var(--text-muted);
    background: #000; padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--border-strong);
  }
  
  /* Cheat Sheet */
  .cheat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .cheat-col { padding: 24px; background: var(--bg-surface); border: 1px solid var(--border-dim); border-radius: var(--radius-lg); }
  .cheat-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 590; margin-bottom: 16px; }
  .cheat-list { list-style: none; }
  .cheat-list li { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; padding-left: 16px; position: relative; }
  .cheat-list li::before { content: "•"; position: absolute; left: 0; color: var(--text-muted); }
  
  .cheat-danger .cheat-title { color: #f87171; }
  .cheat-danger .cheat-list li::before { content: "×"; color: #f87171; }
  
  /* Footer */
  .doc-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 40px; border-top: 1px solid var(--border-dim);
    font-size: 13px; color: var(--text-muted);
  }
  .footer-link { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 4px; }
  .footer-link:hover { color: var(--text-primary); }
  
  /* Toast */
  .toast {
    position: fixed; bottom: 32px; right: 32px;
    background: var(--text-primary); color: var(--bg-base);
    padding: 12px 24px; border-radius: var(--radius-md); font-size: 13px; font-weight: 590;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    opacity: 0; transform: translateY(20px); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; z-index: 200;
  }
  .toast.show { opacity: 1; transform: translateY(0); }
  
  /* ═══════ RESPONSIVE ═══════ */
  @media (max-width: 1024px) {
    .main-content { padding: 32px 40px 80px; }
    .grid-2 { grid-template-columns: 1fr; }
    .formula-visual { flex-direction: column; align-items: stretch; }
    .f-plus { text-align: center; margin: -8px 0; }
    .cheat-grid { grid-template-columns: 1fr; }
  }
  
  @media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar {
      position: fixed; left: -100%; top: 57px; height: calc(100vh - 57px);
      width: 100%; border-right: none; transition: left 0.3s;
    }
    .sidebar.open { left: 0; }
    .mobile-header { display: flex; }
    .main-content { padding: 24px 20px 80px; }
    .doc-title { font-size: 32px; }
    .fourq-grid { grid-template-columns: 1fr; }
    .video-list { grid-template-columns: 1fr; }
  }

/* ═══════════════════════════════════════════
   VIDEO PLAYER COMPONENT
   ═══════════════════════════════════════════ */

.video-block {
  margin: 32px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-dim);
  background: #000;
  position: relative;
}

.video-block video {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
}

.video-block-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-dim);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-sans);
}

.video-block-label svg {
  flex-shrink: 0;
  color: var(--brand-primary);
}

.video-block-label .video-duration {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Video list grid (for template demos) */
.video-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.video-list .video-block {
  margin: 0;
}

.video-list .video-block-label {
  font-size: 12px;
  padding: 8px 12px;
}

/* ═══════════════════════════════════════════
   HERO IMAGE COMPONENT
   ═══════════════════════════════════════════ */

.hero-image {
  margin: 32px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-dim);
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
