/* =============================================================================
   ANIMATIONS & TRANSITIONS
   Extracted from base.html for caching and reuse.
   ============================================================================= */
html,
body {
  /* overflow explicitly removed to ensure position:sticky works! */
  overscroll-behavior-x: none !important; /* Prevent sideways bounce on Safari */
}

/* Animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.4s ease-out forwards;
}

/* Toast Notifications */
.toast-notification {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(-120%);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease;
  width: calc(100% - 2rem);
  max-width: 22rem;
  margin: 0 auto;
  pointer-events: auto;
}

.toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-exit {
  transform: translateY(-120%);
  opacity: 0;
}

.toast-success {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.toast-error {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.toast-msg {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.125rem;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  color: inherit;
  line-height: 1;
  padding: 0 0.125rem;
}

.toast-close:hover {
  opacity: 1;
}

/* Button Spinner */
.btn-spinner {
  display: inline-block;
  vertical-align: middle;
  animation: spin 0.8s linear infinite;
}

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

/* Modal States */
body.modal-open {
  overflow: hidden !important;
}
/* Util: Scrollbar Hide */
.scrollbar-hide {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}
.scrollbar-hide::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* HTMX Transitions */
.hx-fade-in {
  opacity: 1; /* Keep placeholders visible while loading */
  transition: opacity 0.5s ease-in-out;
}

.hx-fade-in.htmx-added {
  opacity: 0;
}

.hx-fade-in.htmx-settling {
  opacity: 1;
}

/* Base fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}
