/* ============================================================
   v6 Phase D — Scale as a foundation
   ============================================================
   - .v6-scale-snap toggle button (next to the scale picker)
   - .v6-snap-hint floating arrow that briefly appears when a
     click is redirected to an in-scale row
*/

@layer v6-components {

  /* ============================================================
     Snap-to-Scale toggle (Snap / Chrom button)
     ============================================================ */
  .v6-scale-snap {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px !important;
    width: auto !important;
    margin-left: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--v6-border, rgba(255, 255, 255, 0.10));
    border-radius: 999px;
    color: var(--text-secondary, #a1a1aa);
    font-family: var(--font-sans, system-ui);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition:
      background var(--duration-fast, 120ms),
      border-color var(--duration-fast, 120ms),
      color var(--duration-fast, 120ms);
  }
  .v6-scale-snap .v6-icon {
    width: 11px;
    height: 11px;
  }
  .v6-scale-snap__label {
    line-height: 1;
  }
  .v6-scale-snap:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-primary, #8b5cf6);
  }
  .v6-scale-snap--on {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--accent-primary, #8b5cf6);
    color: #fff;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.30);
  }
  .v6-scale-snap--off {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.50);
    color: var(--accent-warning, #f59e0b);
  }
  .v6-scale-snap--off:hover {
    background: rgba(245, 158, 11, 0.20);
    color: #fff;
  }

  /* ============================================================
     Snap-hint arrow — flashes briefly when a click is redirected
     ============================================================ */
  .v6-snap-hint {
    position: absolute;
    pointer-events: none;
    z-index: 50;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono, monospace);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary, #8b5cf6);
    text-shadow: 0 0 6px rgba(139, 92, 246, 0.80),
                 0 0 12px rgba(139, 92, 246, 0.40);
    animation: v6-snap-hint-flash 380ms ease-out forwards;
  }
  .v6-snap-hint--up { animation-name: v6-snap-hint-up; }
  .v6-snap-hint--down { animation-name: v6-snap-hint-down; }
  @keyframes v6-snap-hint-up {
    0%   { opacity: 0; transform: translate(-50%, -10%); }
    30%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -120%); }
  }
  @keyframes v6-snap-hint-down {
    0%   { opacity: 0; transform: translate(-50%, -90%); }
    30%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, 20%); }
  }
  @media (prefers-reduced-motion: reduce) {
    .v6-snap-hint { animation: none; opacity: 0.85; }
  }
}
