/* ============================================================================
   Skip Navigation Links
   ============================================================================ */

.ffmpeg-dashboard__skip-nav {
  position: relative;
  z-index: 100;
}

.ffmpeg-dashboard__skip-link.visually-hidden.focusable:focus {
  position: fixed;
  top: 0.5rem;
  inset-inline-start: 0.5rem;
  z-index: 1000;
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background: var(--ffmpeg-accent, #2563eb);
  color: var(--ffmpeg-on-accent, #ffffff);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--ffmpeg-radius-s, 6px);
  box-shadow: var(--ffmpeg-shadow, 0 12px 24px rgba(15, 23, 42, 0.08));
  outline: 3px solid var(--ffmpeg-focus, #2684ff);
  outline-offset: 2px;
  clip: auto;
  width: auto;
  height: auto;
  overflow: visible;
  white-space: nowrap;
}

/* Ensure skip targets scroll with offset for sticky headers */
[id^="ffmpeg-section-"] {
  scroll-margin-top: calc(var(--drupal-displace-offset-top, 0px) + 1rem);
}

/* ============================================================================
   Focus Indicators
   ============================================================================ */

.ffmpeg-dashboard a:focus-visible,
.ffmpeg-dashboard button:focus-visible,
.ffmpeg-dashboard input:focus-visible,
.ffmpeg-dashboard select:focus-visible,
.ffmpeg-dashboard textarea:focus-visible,
.ffmpeg-dashboard [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--ffmpeg-focus-ring);
}

.ffmpeg-dashboard a:focus-visible,
.ffmpeg-dashboard [tabindex]:focus-visible {
  border-radius: var(--ffmpeg-radius-s);
}

.ffmpeg-dashboard .ffmpeg-filter-link:focus-visible {
  border-radius: 9999px;
}

.ffmpeg-dashboard .status-badge:focus-visible,
.ffmpeg-dashboard .ffmpeg-status-badge:focus-visible,
.ffmpeg-dashboard .ffmpeg-count-badge:focus-visible,
.ffmpeg-dashboard .ffmpeg-encoder-badge:focus-visible {
  border-radius: 9999px;
}

.ffmpeg-dashboard .ffmpeg-stats-card:focus-visible {
  border-radius: var(--ffmpeg-radius-m);
}

/* ============================================================================
   Windows High Contrast Mode (forced-colors)
   ============================================================================ */

@media (forced-colors: active) {
  /* Badges: use system colors for visibility */
  .status-badge,
  .ffmpeg-status-badge,
  .ffmpeg-count-badge,
  .ffmpeg-encoder-badge,
  .ffmpeg-row-badge {
    forced-color-adjust: none;
    background: Mark;
    color: MarkText;
    border-color: MarkText;
  }

  .ffmpeg-count-badge--error,
  .status-badge--failed,
  .ffmpeg-status-badge--failed {
    background: Mark;
    color: MarkText;
    border-color: MarkText;
  }

  /* Focus rings: use Highlight system color */
  .ffmpeg-dashboard a:focus-visible,
  .ffmpeg-dashboard button:focus-visible,
  .ffmpeg-dashboard input:focus-visible,
  .ffmpeg-dashboard select:focus-visible,
  .ffmpeg-dashboard textarea:focus-visible,
  .ffmpeg-dashboard [tabindex]:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
    box-shadow: none;
  }

  /* Skip links */
  .ffmpeg-dashboard__skip-link.visually-hidden.focusable:focus {
    background: Highlight;
    color: HighlightText;
    outline: 3px solid Highlight;
    box-shadow: none;
  }

  /* Status indicators */
  .ffmpeg-status-indicator {
    border-color: ButtonText;
  }

  .ffmpeg-status-indicator__icon {
    background: Highlight;
    color: HighlightText;
  }

  /* Progress bars */
  .progress-bar__fill {
    background: Highlight;
  }

  /* Section accent bars */
  .ffmpeg-media-dashboard__section::after {
    background: Highlight;
  }

  /* 24h chart segments */
  .ffmpeg-24h-chart__segment {
    border: 1px solid ButtonText;
  }

  /* Format-specific output borders */
  .ffmpeg-output-item[class*="ffmpeg-output-item--"] {
    border-inline-start-color: Highlight;
  }
}
