/**
 * Skeleton Loading Styles
 * CSS-only skeleton loading animations for async content loading
 */

/* ===== Base Skeleton Styles ===== */
.skeleton-card {
  overflow: hidden;
}

.skeleton-animate {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== Skeleton Elements ===== */
.skeleton-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-badge {
  width: 60px;
  height: 20px;
  border-radius: 4px;
}

.skeleton-text {
  height: 16px;
  border-radius: 4px;
}

.skeleton-text.skeleton-title {
  height: 20px;
  width: 80%;
}

.skeleton-text.skeleton-subtitle {
  height: 14px;
  width: 60%;
}

.skeleton-price {
  width: 100px;
  height: 24px;
  border-radius: 4px;
}

.skeleton-specs {
  width: 100%;
  height: 20px;
  border-radius: 4px;
}

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

/* ===== Category Skeleton ===== */
.skeleton-category {
  height: 120px;
  border-radius: 8px;
}

.skeleton-category-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 12px;
}

.skeleton-category-text {
  width: 70%;
  height: 14px;
  margin: 0 auto 8px;
  border-radius: 4px;
}

/* ===== Product Card Skeleton - Grid View ===== */
.skeleton-product-grid .skeleton-image {
  height: 180px;
}

@media (max-width: 767px) {
  .skeleton-product-grid .skeleton-image {
    height: 140px;
  }
}

/* ===== Product Card Skeleton - List View ===== */
.skeleton-product-list {
  display: flex;
}

.skeleton-product-list .skeleton-image {
  width: 150px;
  min-height: 150px;
}

.skeleton-product-list .skeleton-content {
  flex: 1;
  padding: 16px;
}

/* ===== Testimonial Skeleton ===== */
.skeleton-testimonial {
  padding: 24px;
  border-radius: 8px;
  background: #fff;
}

.skeleton-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.skeleton-stars {
  display: flex;
  gap: 4px;
}

.skeleton-star {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}

/* ===== Fade In Animation ===== */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Smooth Container Transitions ===== */
.products-container {
  transition: opacity 0.15s ease-in-out;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #0d6efd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Pulse Animation (Alternative) ===== */
.skeleton-pulse {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ===== Dark Theme Support ===== */
@media (prefers-color-scheme: dark) {
  .skeleton-animate {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
  }
  
  .skeleton-image {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
  }
}

/* ===== Skeleton Grid Layout ===== */
.skeleton-grid {
  display: grid;
  gap: 24px;
}

.skeleton-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.skeleton-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.skeleton-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 991px) {
  .skeleton-grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .skeleton-grid-4,
  .skeleton-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 575px) {
  .skeleton-grid-4,
  .skeleton-grid-3,
  .skeleton-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ===== Inline Skeleton ===== */
.skeleton-inline {
  display: inline-block;
  vertical-align: middle;
}

/* ===== Section Header Skeleton ===== */
.skeleton-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.skeleton-section-title {
  width: 200px;
  height: 32px;
  border-radius: 4px;
}

.skeleton-section-subtitle {
  width: 250px;
  height: 16px;
  margin-top: 8px;
  border-radius: 4px;
}

.skeleton-section-btn {
  width: 120px;
  height: 40px;
  border-radius: 6px;
}
