/**
 * Back to Top FAB styles
 * Compatible with Material theme light/dark modes
 */

.btp-fab {
  /* Position */
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1000;

  /* Size & shape */
  width: 3rem;
  height: 3rem;
  border-radius: 50%;

  /* Reset defaults */
  border: none;
  outline: none;

  /* Typography */
  font-size: 1.25rem;
  line-height: 3rem;
  text-align: center;

  /* Colors (Material theme variables) */
  background: var(--md-accent-fg-color);
  color: var(--md-primary-bg-color);

  /* Shadow for depth */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);

  /* Interaction */
  cursor: pointer;

  /* Initial hidden state */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;

  /* Prevent text selection */
  user-select: none;
  -webkit-user-select: none;
}

/* Hover state */
.btp-fab:hover {
  filter: brightness(1.05);
}

/* Active/pressed state */
.btp-fab:active {
  transform: translateY(11px) scale(0.98);
}

/* Focus state for accessibility */
.btp-fab:focus {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
}

/* Visible state */
.btp-fab.btp-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .btp-fab {
    transition: none;
  }
}

/* Adjust position on smaller screens */
@media screen and (max-width: 76.1875em) {
  .btp-fab {
    right: 1rem;
    bottom: 1rem;
  }
}

/* Mobile adjustments */
@media screen and (max-width: 44.9375em) {
  .btp-fab {
    right: 0.75rem;
    bottom: 0.75rem;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.125rem;
    line-height: 2.75rem;
  }
}

/* Dark mode adjustments (if needed) */
[data-md-color-scheme="slate"] .btp-fab {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
