/*
 * 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.
 */

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* Category Browser Styles */
.category-browser {
  transition: all 0.3s ease;
}

.category-item {
  transition: all 0.2s ease;
  cursor: pointer;
}

.category-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .category-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.product-item {
  transition: all 0.2s ease;
  cursor: pointer;
}

.product-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dark .product-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Text truncation utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Scrollbar styles */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.7);
}

/* Focus styles for accessibility */
.focus-visible:focus,
*:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

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

/* Radio button and checkbox styles for light/dark mode */
input[type="radio"],
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid #d1d5db; /* gray-300 */
  background-color: white;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"] {
  border-radius: 0.25rem;
}

/* Dark mode unchecked state */
.dark input[type="radio"],
.dark input[type="checkbox"] {
  border-color: #6b7280; /* gray-500 */
  background-color: #374151; /* gray-700 */
}

/* Hover states */
input[type="radio"]:hover,
input[type="checkbox"]:hover {
  border-color: #2563eb; /* blue-600 */
}

/* Checked state */
input[type="radio"]:checked,
input[type="checkbox"]:checked {
  background-color: #2563eb; /* blue-600 */
  border-color: #2563eb; /* blue-600 */
}

/* Radio button checked indicator */
input[type="radio"]:checked::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background-color: white;
}

/* Checkbox checked indicator */
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.0625rem;
  width: 0.3125rem;
  height: 0.5625rem;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Focus states */
input[type="radio"]:focus,
input[type="checkbox"]:focus {
  outline: 2px solid #3b82f6; /* blue-500 */
  outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .transition-colors,
  .transition-all,
  .category-item,
  .product-item,
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
