/**
 * Skeleton Screen Styles
 * Modern loading placeholders with smooth animations
 */

/* Base Skeleton Styles */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: skeleton-shimmer 2s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .skeleton {
    background: linear-gradient(
      90deg,
      #2a2a2a 0%,
      #3a3a3a 20%,
      #2a2a2a 40%,
      #2a2a2a 100%
    );
  }
}

/* Skeleton Container */
.skeleton-container {
  width: 100%;
  padding: 20px 0;
}

.skeleton-container.hidden {
  display: none;
}

/* Product Grid Skeleton */
.skeleton-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.skeleton-product-card {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-product-image {
  width: 100%;
  height: 250px;
  margin-bottom: 15px;
  border-radius: 8px;
}

.skeleton-product-title {
  width: 80%;
  height: 20px;
  margin-bottom: 10px;
}

.skeleton-product-price {
  width: 40%;
  height: 24px;
  margin-bottom: 10px;
}

.skeleton-product-rating {
  width: 60%;
  height: 16px;
  margin-bottom: 15px;
}

.skeleton-product-button {
  width: 100%;
  height: 40px;
  border-radius: 4px;
}

/* Single Product Skeleton */
.skeleton-single-product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.skeleton-product-gallery {
  width: 100%;
}

.skeleton-main-image {
  width: 100%;
  height: 500px;
  margin-bottom: 15px;
  border-radius: 8px;
}

.skeleton-thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.skeleton-thumbnail {
  width: 100%;
  height: 100px;
  border-radius: 4px;
}

.skeleton-product-details {
  width: 100%;
}

.skeleton-product-category {
  width: 30%;
  height: 16px;
  margin-bottom: 10px;
}

.skeleton-product-name {
  width: 90%;
  height: 32px;
  margin-bottom: 15px;
}

.skeleton-product-meta {
  width: 70%;
  height: 20px;
  margin-bottom: 20px;
}

.skeleton-product-description {
  width: 100%;
  margin-bottom: 10px;
}

.skeleton-product-description .skeleton {
  width: 100%;
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-product-description .skeleton:last-child {
  width: 60%;
}

.skeleton-add-to-cart {
  width: 100%;
  height: 50px;
  margin-top: 20px;
  border-radius: 4px;
}

/* Blog/Post Skeleton */
.skeleton-post-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.skeleton-post-item {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-post-featured-image {
  width: 100%;
  height: 300px;
  margin-bottom: 20px;
  border-radius: 8px;
}

.skeleton-post-title {
  width: 85%;
  height: 28px;
  margin-bottom: 15px;
}

.skeleton-post-meta {
  width: 50%;
  height: 16px;
  margin-bottom: 15px;
}

.skeleton-post-excerpt {
  margin-bottom: 10px;
}

.skeleton-post-excerpt .skeleton {
  width: 100%;
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-post-excerpt .skeleton:last-child {
  width: 70%;
}

/* Cart Skeleton */
.skeleton-cart {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.skeleton-cart-item {
  display: grid;
  grid-template-columns: 100px 1fr 150px 100px;
  gap: 20px;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 4px;
}

.skeleton-cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-cart-item-name {
  width: 70%;
  height: 20px;
}

.skeleton-cart-item-meta {
  width: 50%;
  height: 16px;
}

.skeleton-cart-item-price {
  width: 100%;
  height: 24px;
}

.skeleton-cart-item-remove {
  width: 80px;
  height: 36px;
  border-radius: 4px;
}

/* Category Grid Skeleton */
.skeleton-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
}

.skeleton-category-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-category-image {
  width: 100%;
  height: 150px;
  margin-bottom: 15px;
  border-radius: 8px;
}

.skeleton-category-name {
  width: 70%;
  height: 20px;
  margin: 0 auto 10px;
}

.skeleton-category-count {
  width: 40%;
  height: 16px;
  margin: 0 auto;
}

/* Slider Skeleton */
.skeleton-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.skeleton-slider-track {
  display: flex;
  gap: 20px;
  padding: 20px;
}

.skeleton-slider-item {
  flex: 0 0 300px;
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-slider-image {
  width: 100%;
  height: 200px;
  margin-bottom: 15px;
  border-radius: 8px;
}

.skeleton-slider-title {
  width: 80%;
  height: 20px;
  margin-bottom: 10px;
}

.skeleton-slider-subtitle {
  width: 60%;
  height: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .skeleton-single-product {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 15px;
  }

  .skeleton-main-image {
    height: 300px;
  }

  .skeleton-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
  }

  .skeleton-product-image {
    height: 180px;
  }

  .skeleton-cart-item {
    grid-template-columns: 80px 1fr;
    gap: 15px;
  }

  .skeleton-cart-item-image {
    width: 80px;
    height: 80px;
  }

  .skeleton-cart-item-price,
  .skeleton-cart-item-remove {
    grid-column: 2;
  }

  .skeleton-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }
}

/* Fade in animation when content loads */
.skeleton-fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse animation variant */
.skeleton-pulse {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Text skeleton variants */
.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text-sm {
  height: 14px;
}

.skeleton-text-lg {
  height: 20px;
}

.skeleton-text-xl {
  height: 24px;
}

/* Circle skeleton for avatars */
.skeleton-circle {
  border-radius: 50%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

/* Widget Skeleton */
.skeleton-widget {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-widget-title {
  width: 60%;
  height: 24px;
  margin-bottom: 20px;
}

.skeleton-widget-item {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.skeleton-widget-item-image {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  flex-shrink: 0;
}

.skeleton-widget-item-content {
  flex: 1;
}

.skeleton-widget-item-title {
  width: 80%;
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-widget-item-meta {
  width: 50%;
  height: 14px;
}
/* Hero Slider Skeleton */
.skeleton-hero-slider {
  position: relative;
  height: 100vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    #1a1a1a 0%,
    #2a2a2a 20%,
    #1a1a1a 40%,
    #1a1a1a 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  width: 100%;
}

.skeleton-hero-slider::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.3) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: skeleton-shimmer 2s infinite;
  z-index: 2;
}

.skeleton-hero-slider-content {
  position: relative;
  z-index: 1;
  display: flex;
  height: 90%;
  width: 100%;
  padding: 5%;
  gap: 5%;
  justify-content: space-between;
}

.skeleton-hero-left {
  width: 45%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.5);
  padding: 40px;
  border-radius: 10px;
}

.skeleton-hero-nav-dots {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 25px;
  align-items: center;
}

.skeleton-dot {
  width: 40px;
  height: 40px;
  background: linear-gradient(
    90deg,
    #3a3a3a 0%,
    #4a4a4a 20%,
    #3a3a3a 40%,
    #3a3a3a 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 50%;
}

.skeleton-hero-title {
  width: 70%;
  height: 60px;
  margin-bottom: 20px;
  background: linear-gradient(
    90deg,
    #3a3a3a 0%,
    #4a4a4a 20%,
    #3a3a3a 40%,
    #3a3a3a 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-hero-description {
  width: 85%;
  height: 80px;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-hero-description > div {
  background: linear-gradient(
    90deg,
    #3a3a3a 0%,
    #4a4a4a 20%,
    #3a3a3a 40%,
    #3a3a3a 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-hero-description > div:first-child {
  height: 20px;
  width: 100%;
}

.skeleton-hero-description > div:nth-child(2),
.skeleton-hero-description > div:nth-child(3) {
  height: 20px;
  width: 90%;
}

.skeleton-hero-description > div:nth-child(4) {
  height: 20px;
  width: 70%;
}

.skeleton-hero-button {
  width: 150px;
  height: 48px;
  background: linear-gradient(
    90deg,
    #c0392b 0%,
    #d0493b 20%,
    #c0392b 40%,
    #c0392b 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-hero-right {
  width: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skeleton-hero-carousel {
  width: 100%;
  height: 400px;
  background: linear-gradient(
    90deg,
    #3a3a3a 0%,
    #4a4a4a 20%,
    #3a3a3a 40%,
    #3a3a3a 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}
