/* ==========================================================================
   COLLAPSE.CSS — Noise Reduction V2: Collapsed Section Styles
   ========================================================================== */

/* ---------- Collapsed section ---------- */
[data-section].nx-collapsed {
  position: relative;
  overflow: hidden;
  max-height: 2.6rem;       /* keep toggle button visible */
  transition: max-height 0.35s ease;
}
[data-section].nx-collapsed > *:not(.nx-collapse-toggle) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ---------- Toggle button ---------- */
.nx-collapse-toggle {
  position: relative;        /* must stay visible even when section collapsed */
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border, #2d3348);
  border-radius: 6px;
  background: var(--bg-secondary, rgba(30, 30, 46, 0.85));
  color: var(--muted, #64748b);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  margin-bottom: 0.35rem;
}
.nx-collapse-toggle:hover {
  border-color: var(--accent, #6366f1);
  color: var(--text, #e2e8f0);
  background: var(--accent-dim, rgba(99, 102, 241, 0.10));
}
.nx-collapse-toggle:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
}

/* Collapsed state: left accent bar */
[data-section].nx-collapsed::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent, #6366f1);
  border-radius: 2px;
  opacity: 0.5;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-section].nx-collapsed {
    transition: none;
  }
  [data-section].nx-collapsed > *:not(.nx-collapse-toggle) {
    transition: none;
  }
  .nx-collapse-toggle {
    transition: none;
  }
}

/* ---------- Light theme ---------- */
html[data-theme="light"] .nx-collapse-toggle {
  background: rgba(245, 246, 250, 0.9);
  border-color: #dde0e8;
  color: #6b7280;
}
html[data-theme="light"] .nx-collapse-toggle:hover {
  border-color: var(--accent, #6366f1);
  color: #1a1a2e;
}
