/* ════════════════════════════════════════════════
   LOGIC SCRIPT — REFERENCE PAGE
   public/css/logic-script-reference.css
   ════════════════════════════════════════════════ */

/* ══════════════════════════════════════
   HERO
   ══════════════════════════════════════ */

.lsr-hero {
  padding: 120px 1.5rem 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lsr-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(124,143,255,.09) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(169,214,255,.07) 0%, transparent 50%);
  pointer-events: none;
}

/* ══════════════════════════════════════
   BARRA DE BUSCA
   ══════════════════════════════════════ */

.lsr-search-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  backdrop-filter: blur(10px);
}

.lsr-search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  max-width: 600px;
  margin: 0 auto;
  transition: border-color .15s, box-shadow .15s;
}

.lsr-search-wrap:focus-within {
  border-color: rgba(124,143,255,.4);
  box-shadow: 0 0 0 3px rgba(124,143,255,.08);
}

.lsr-search-icon {
  font-size: 16px;
  flex-shrink: 0;
  opacity: .6;
}

.lsr-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  padding: 12px 0;
  caret-color: var(--eye-main);
}

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

.lsr-search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color .12s;
}
.lsr-search-clear:hover { color: var(--text-primary); }

/* ══════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════ */

.lsr-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

.lsr-toc {
  top: 80px; /* abaixo da search bar */
}

.lsr-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

/* ══════════════════════════════════════
   SEÇÕES
   ══════════════════════════════════════ */

.lsr-section {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.lsr-section:last-child { border-bottom: none; }

.lsr-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.lsr-section-icon { font-size: 1.2rem; flex-shrink: 0; }

.lsr-section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.lsr-section-title code {
  font-family: 'Cascadia Code','Fira Code',monospace;
  font-size: .95rem;
  color: var(--hair-main);
  background: rgba(169,214,255,.08);
  padding: 1px 8px;
  border-radius: 5px;
}

.lsr-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(124,143,255,.1);
  border: 1px solid rgba(124,143,255,.2);
  color: var(--eye-main);
  white-space: nowrap;
}

.lsr-kw {
  font-family: 'Cascadia Code','Fira Code',monospace;
  color: #cba6f7;
  background: rgba(203,166,247,.1);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .9em;
}

/* ══════════════════════════════════════
   TABELAS
   ══════════════════════════════════════ */

.lsr-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: .5rem;
}

.lsr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 360px;
}

.lsr-table thead tr {
  background: rgba(169,214,255,.03);
}

.lsr-table th {
  padding: 9px 13px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lsr-table td {
  padding: 8px 13px;
  border-bottom: 1px solid rgba(169,214,255,.04);
  color: var(--text-secondary);
  line-height: 1.55;
  vertical-align: top;
}

.lsr-table tr:last-child td { border-bottom: none; }
.lsr-table tr:hover td { background: rgba(124,143,255,.03); }

/* coluna de nome (primeira) */
.lsr-table td:first-child {
  font-family: 'Cascadia Code','Fira Code',monospace;
  font-size: 12.5px;
  color: var(--hair-main);
  white-space: nowrap;
  font-weight: 500;
}

.lsr-table td code {
  font-family: 'Cascadia Code','Fira Code',monospace;
  font-size: 11.5px;
  background: rgba(124,143,255,.09);
  color: var(--eye-main);
  padding: 1px 5px;
  border-radius: 4px;
}

.lsr-type {
  font-family: 'Cascadia Code','Fira Code',monospace;
  font-size: 11.5px;
  color: #fab387 !important;
  white-space: nowrap;
}

/* ══════════════════════════════════════
   GRID DE OPERADORES (2 colunas)
   ══════════════════════════════════════ */

.lsr-op-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ══════════════════════════════════════
   PALAVRAS-CHAVE
   ══════════════════════════════════════ */

.lsr-kw-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lsr-kw-chip {
  font-family: 'Cascadia Code','Fira Code',monospace;
  font-size: 12.5px;
  color: #cba6f7;
  background: rgba(203,166,247,.09);
  border: 1px solid rgba(203,166,247,.2);
  padding: 4px 12px;
  border-radius: 6px;
  transition: background .12s, border-color .12s;
  cursor: default;
}

.lsr-kw-chip:hover {
  background: rgba(203,166,247,.16);
  border-color: rgba(203,166,247,.35);
}

/* ══════════════════════════════════════
   CORES DO EMBED (setColor)
   ══════════════════════════════════════ */

.lsr-colors-grid { margin-top: 1rem; }

.lsr-color-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.lsr-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lsr-color-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-family: 'Cascadia Code','Fira Code',monospace;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 10px 4px 6px;
  border-radius: 6px;
  cursor: default;
  transition: border-color .12s;
}

.lsr-color-chip:hover { border-color: rgba(169,214,255,.25); }

.lsr-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.15);
}

.lsr-color-name { font-size: 11px; }

/* ══════════════════════════════════════
   ESTILOS DE BOTÃO (chips visuais)
   ══════════════════════════════════════ */

.lsr-style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: .75rem;
}

.lsr-style-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: default;
  border: none;
}

.lsr-style-chip.primary   { background: #5865F2; color: #fff; }
.lsr-style-chip.secondary { background: #4f545c; color: #fff; }
.lsr-style-chip.success   { background: #57F287; color: #071a0f; }
.lsr-style-chip.danger    { background: #ED4245; color: #fff; }
.lsr-style-chip.link      { background: transparent; color: var(--eye-main); border: 1px solid var(--border); text-decoration: underline; }

/* ══════════════════════════════════════
   HIGHLIGHT DE BUSCA (linhas filtradas)
   ══════════════════════════════════════ */

.lsr-table tbody tr[data-match] td:first-child {
  color: var(--eye-main);
}

/* ══════════════════════════════════════
   RESPONSIVO
   ══════════════════════════════════════ */

@media (max-width: 1024px) {
  .lsr-layout { grid-template-columns: 190px 1fr; gap: 1.5rem; }
  .lsr-op-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .lsr-hero { padding: 100px 1.25rem 40px; }
  .lsr-layout { grid-template-columns: 1fr; }

  .lsr-toc {
    display: none; /* esconde TOC no mobile, busca resolve */
  }

  .lsr-table { font-size: 12px; min-width: 280px; }
  .lsr-table th, .lsr-table td { padding: 7px 10px; }

  .lsr-search-bar { padding: 8px 0; }
  .lsr-search-input { font-size: 13px; }

  .lsr-colors { gap: 5px; }
  .lsr-color-chip { font-size: 10.5px; padding: 3px 8px 3px 5px; }

  .lsr-kw-chip { font-size: 11.5px; padding: 3px 10px; }
}

@media (max-width: 480px) {
  .lsr-hero { padding: 90px 1rem 32px; }
  .lsr-section { padding: 1.5rem 0; }
  .lsr-section-title { font-size: 1rem; }
}

/* ══════════════════════════════════════
   NOTA DE SEÇÃO + EXEMPLO DE CÓDIGO
   (usado em Tempo, e reaproveitável por outras seções)
   ══════════════════════════════════════ */

.lsr-section-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim, #9aa0b4);
  margin: -4px 0 14px;
}

.lsr-section-note code {
  font-family: 'Cascadia Code','Fira Code',monospace;
  background: rgba(124,143,255,.1);
  border: 1px solid rgba(124,143,255,.18);
  color: var(--eye-main);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
}

.lsr-example {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  background: rgba(0,0,0,.18);
}

.lsr-example pre {
  margin: 0;
  padding: 14px 16px;
}

.lsr-example code {
  font-family: 'Cascadia Code','Fira Code',monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: #d9dcea;
  white-space: pre;
}
