/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Tailwind CSS is built and served from builds/tailwind.css */

/* Custom Dialog Styles */
dialog {
  border: none;
  border-radius: 0.5rem;
  margin: auto;
  max-width: 90vw;
  max-height: 90vh;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Dark mode support for dialog backdrop */
@media (prefers-color-scheme: dark) {
  dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.7);
  }
}

/* InstantSearch Component Styles */

/* Search box styling for refinement list filters */
.ais-RefinementList-searchBox {
  margin-bottom: 1rem;
}

.ais-SearchBox-form {
  position: relative;
}

.ais-SearchBox-input {
  display: block;
  width: 100%;
  padding: 0.625rem 2.25rem 0.625rem 2.25rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #111827;
  background-color: #FFFFFF;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ais-SearchBox-input:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.ais-SearchBox-input::placeholder {
  color: #9CA3AF;
}

.ais-SearchBox-submit {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  padding-left: 0.75rem;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.ais-SearchBox-reset {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  padding-right: 0.75rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.ais-SearchBox-reset:hover {
  color: #4B5563;
}

/* Custom checkbox styling */
.custom-checkbox {
  display: flex;
  height: 1.5rem;
  flex-shrink: 0;
  align-items: center;
}

.ais-ToggleRefinement-checkbox,
.ais-RefinementList-checkbox {
  position: relative;
  display: grid;
  width: 1rem;
  height: 1rem;
  grid-template-columns: 1fr;
  appearance: none;
  border-radius: 0.25rem;
  border: 1px solid #D1D5DB;
  background-color: white;
}

.ais-ToggleRefinement-checkbox:checked,
.ais-RefinementList-checkbox:checked {
  border-color: #4F46E5;
  background-color: #4F46E5;
}

.ais-ToggleRefinement-checkbox:focus-visible,
.ais-RefinementList-checkbox:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

/* Custom checkmark */
.ais-ToggleRefinement-checkbox::after,
.ais-RefinementList-checkbox::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.875rem;
  height: 0.875rem;
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3 8L6 11L11 3.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 0.1s ease-in-out;
}

.ais-ToggleRefinement-checkbox:checked::after,
.ais-RefinementList-checkbox:checked::after {
  opacity: 1;
}

/* Wrapper adjustments */
.ais-ToggleRefinement-label,
.ais-RefinementList-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.ais-RefinementList-labelText {
  flex: 1;
}

/* Domain Search Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

/* Logo Scroll Animation */
@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}
