/* Search Skeletons Widget CSS */
.search-skeletons {
  --skeleton-bg: #f0f0f0;
  --skeleton-highlight: #e0e0e0;
  --skeleton-radius: 4px;
  --skeleton-animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* Base skeleton styles */
.skeleton {
  background-color: var(--skeleton-bg);
  border-radius: var(--skeleton-radius);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: var(--skeleton-animation);
}

/* Skeleton animation keyframes */
@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Skeleton animation for slow connections */
@media (prefers-reduced-data: reduce) {
  .skeleton::after {
    animation: none;
  }
}

/* Hero skeleton */
.skeleton-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px;
}

.skeleton-hero-title {
  height: 32px;
  width: 60%;
  margin-bottom: 8px;
}

.skeleton-hero-subtitle {
  height: 20px;
  width: 80%;
}

/* Filters skeleton */
.skeleton-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: #fafafa;
  border-radius: 8px;
  margin: 16px;
}

.skeleton-filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
}

.skeleton-filter-label {
  height: 16px;
  width: 80px;
}

.skeleton-filter-input {
  height: 40px;
  width: 100%;
  border-radius: 6px;
}

.skeleton-filter-button {
  height: 40px;
  width: 120px;
  border-radius: 6px;
}

/* Results skeleton */
.skeleton-results {
  padding: 16px;
}

.skeleton-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.skeleton-results-count {
  height: 20px;
  width: 150px;
}

.skeleton-results-sort {
  height: 36px;
  width: 120px;
  border-radius: 6px;
}

/* Result card skeleton */
.skeleton-result-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 16px;
}

.skeleton-result-image {
  width: 200px;
  height: 150px;
  border-radius: 8px;
  flex-shrink: 0;
}

.skeleton-result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-result-title {
  height: 24px;
  width: 80%;
}

.skeleton-result-price {
  height: 28px;
  width: 40%;
  font-weight: bold;
}

.skeleton-result-details {
  display: flex;
  gap: 16px;
}

.skeleton-result-detail {
  height: 16px;
  width: 60px;
}

.skeleton-result-description {
  height: 14px;
  width: 100%;
}

.skeleton-result-description:last-child {
  width: 70%;
}

/* Pagination skeleton */
.skeleton-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
}

.skeleton-page-button {
  height: 36px;
  width: 36px;
  border-radius: 6px;
}

.skeleton-page-button.active {
  background-color: var(--skeleton-highlight);
}

/* Loading state */
.skeleton-container {
  position: relative;
}

.skeleton-container.loading {
  min-height: 200px;
}

/* Responsive skeleton adjustments */
@media (max-width: 768px) {
  .skeleton-result-card {
    flex-direction: column;
  }
  
  .skeleton-result-image {
    width: 100%;
    height: 200px;
  }
  
  .skeleton-filters {
    flex-direction: column;
  }
  
  .skeleton-filter-group {
    width: 100%;
  }
}

/* Dark mode skeleton support */
@media (prefers-color-scheme: dark) {
  .search-skeletons {
    --skeleton-bg: #2a2a2a;
    --skeleton-highlight: #3a3a3a;
  }
  
  .skeleton-filters {
    background: #1a1a1a;
    border: 1px solid #333;
  }
  
  .skeleton-result-card {
    border: 1px solid #333;
  }
}

/* Reduced motion skeleton */
@media (prefers-reduced-motion: reduce) {
  .skeleton::after {
    animation: none;
  }
  
  .skeleton {
    background: linear-gradient(
      180deg,
      var(--skeleton-bg) 0%,
      var(--skeleton-highlight) 50%,
      var(--skeleton-bg) 100%
    );
  }
}

/* No-JS fallback skeleton */
.no-js .skeleton {
  display: none;
}

.no-js .no-js-fallback {
  display: block;
  padding: 16px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  color: #856404;
}