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

/* 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);
}

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

.category-browser .category-item,
.category-browser .product-item {
  animation: fade-in 0.3s ease forwards;
}

.category-browser .category-item:nth-child(1) { animation-delay: 0.05s; }
.category-browser .category-item:nth-child(2) { animation-delay: 0.1s; }
.category-browser .category-item:nth-child(3) { animation-delay: 0.15s; }
.category-browser .category-item:nth-child(4) { animation-delay: 0.2s; }
.category-browser .category-item:nth-child(5) { animation-delay: 0.25s; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .category-browser .grid {
    grid-template-columns: 1fr;
  }
  
  .category-browser .hidden {
    display: block !important;
  }
}

/* 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;
}

.sr-only.focus-within:focus-within,
.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Search results focus styles */
.search-item:focus {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Form focus styles */
input:focus, textarea:focus, select:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

/* Button focus styles */
button:focus, .btn:focus, [role="button"]:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Video controls enhancement for better accessibility */
.accessible-video {
  border-radius: 0.5rem;
  overflow: hidden;
}

.accessible-video video {
  width: 100%;
  height: auto;
}

.video-transcript {
  margin-top: 1rem;
}

.video-transcript summary {
  padding: 0.75rem;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  cursor: pointer;
}

.video-transcript summary:hover {
  background-color: #e5e7eb;
}

.video-transcript summary:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.video-transcript div {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-top: none;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* 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;
  }
}