/**
 * YPYM Observatory — Snippet Component
 * 1-line script installation box with framework tabs, copy button, and specs
 */

.snippet-section {
  padding: 80px 0 100px;
  position: relative;
}

.snippet-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 40px;
}

.snippet-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.2);
  margin-bottom: 14px;
}

.snippet-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.snippet-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Snippet Container Box */
.snippet-box {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  background: #0f172a;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

/* Snippet Top Navigation Bar */
.snippet-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #090e1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 12px;
}

.snippet-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.snippet-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}

.snippet-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.snippet-tab-btn.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

/* Copy Button */
.snippet-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}

.snippet-copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.snippet-copy-btn.is-copied {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.snippet-copy-btn svg {
  width: 14px;
  height: 14px;
}

/* Code Display Area */
.snippet-code-area {
  padding: 24px 28px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.snippet-code-area pre {
  margin: 0;
  white-space: pre;
}

/* Syntax Highlighting */
.syn-tag { color: #f43f5e; }
.syn-attr { color: #38bdf8; }
.syn-val { color: #34d399; }
.syn-comment { color: #64748b; font-style: italic; }
.syn-kw { color: #c084fc; }
.syn-fn { color: #fbbf24; }

/* Snippet Meta Strip */
.snippet-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.snippet-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.snippet-meta-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: rgba(255, 255, 255, 0.5);
}

.snippet-meta-val {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
}

.snippet-meta-val.val-accent,
.snippet-meta-val.val-success {
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 800px) {
  .snippet-meta-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .snippet-title {
    font-size: 1.75rem;
  }

  .snippet-code-area {
    padding: 18px;
    font-size: 0.78125rem;
  }
}
