/**
 * UX Enhancements CSS
 * Loading states, focus trap styles, and accessibility improvements
 */

/* Loading State for Buttons */
.btn.loading,
button.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  cursor: wait;
}

.btn.loading::after,
button.loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error Message Styles */
.error-message {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #F87171; /* red-400 */
}

.error-message:empty,
.error-message.hidden {
  display: none;
}

/* Input Error State */
input.error,
textarea.error,
select.error {
  border-color: #EF4444 !important; /* red-500 */
  background-color: rgba(239, 68, 68, 0.05);
}

/* Focus Trap Indicator (for accessibility) */
.focus-trap-active {
  outline: 2px solid #00E5FF;
  outline-offset: 2px;
}

/* Danger Button Utility */
.btn-danger {
  background-color: rgba(239, 68, 68, 0.2); /* red-500/20 */
  color: #F87171; /* red-400 */
  border: 1px solid rgba(239, 68, 68, 0.4); /* red-500/40 */
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.3);
  color: #FCA5A5; /* red-300 */
}

/* Breadcrumb Styles */
.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.6);
  transition: color 200ms;
}

.breadcrumb a:hover {
  color: rgba(255, 255, 255, 1);
}

.breadcrumb [aria-current="page"] {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* Screen Reader Only (sr-only) - Tailwind equivalent */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
