/* ==========================================================================
   BASE STYLES
   ========================================================================== */

body {
  font-family: 'Inter', sans-serif;
}

html,
body {
  scrollbar-gutter: stable;
}

[x-cloak] {
  display: none !important;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Modal pop-up animation */
.modal-pop {
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-pop.active {
  transform: scale(1);
  opacity: 1;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #BEB0A6;
  animation: pulse 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.loading-dot:nth-child(4) {
  animation-delay: 0.6s;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */

#filterSidebar,
#directoryFilterSidebar {
  height: 100vh;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#filterSidebar::-webkit-scrollbar,
#directoryFilterSidebar::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1024px) {

  #filterSidebar,
  #directoryFilterSidebar {
    position: sticky;
    top: 80px;
    align-self: flex-start;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}

/* Prevent body scroll when mobile sidebar is open */
body.sidebar-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ==========================================================================
   SCROLLBARS
   ========================================================================== */

/* Custom scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 3px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 10px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Hide scrollbar */
.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

/* Error messages */
.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.field-error {
  border-color: #ef4444 !important;
}

/* Custom checkbox */
input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

input[type="checkbox"]:hover {
  border-color: #A89171;
}

input[type="checkbox"]:checked {
  background-color: #A89171;
  border-color: #A89171;
}

input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%) rotate(45deg);
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(168, 145, 113, 0.2);
}

/* Custom range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #A89171 0%, #A89171 var(--value-percent, 100%), #e5e7eb var(--value-percent, 100%), #e5e7eb 100%);
  cursor: pointer;
  outline: none;
}

input[type="range"]:focus {
  outline: none;
}

/* Range slider thumb - Webkit */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #A89171;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Range slider thumb - Firefox */
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #A89171;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Range slider track - Firefox */
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: #A89171;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

/* Prevent text selection on buttons */
button {
  user-select: none;
}

/* Fade mask for scroll indicators */
.mask-fade {
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

/* Sort dropdown */
.sort-option.active {
  background-color: #EDE8E5;
  font-weight: 500;
}