/* =====================================================
   SKELETON SCREEN STYLES
   ===================================================== */

/* Base Skeleton Animation */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Base Skeleton Element */
.skeleton {
  background: linear-gradient(90deg, #f6f6f6 25%, #e0e0e0 50%, #f6f6f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  position: relative;
}

/* =====================================================
   CARD SKELETONS
   ===================================================== */

/* Base Card Skeleton */
.skeleton-card {
  background-color: #fff;
  padding: 0;
  border: 0;
  margin-bottom: 40px;
  text-align: center;
}

/* Image Skeleton */
.skeleton-image {
  width: 100%;
  height: 300px;
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .skeleton-image {
    height: 400px;
  }
}

@media (min-width: 992px) {
  .skeleton-image {
    height: 450px;
  }
}

/* Content Skeleton */
.skeleton-content {
  padding: 20px 0;
  text-align: center;
}

/* Title Skeleton */
.skeleton-title {
  width: 70%;
  height: 24px;
  margin: 0 auto 15px;
}

/* Text Skeleton */
.skeleton-text {
  width: 100%;
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 80%;
  margin-bottom: 0;
}

/* Buttons Skeleton */
.skeleton-buttons {
  width: 100%;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 20px 0;
}

.skeleton-button {
  width: 220px;
  height: 40px;
  border-radius: 0;
}

/* =====================================================
   SPECIFIC SECTION SKELETONS
   ===================================================== */

/* Principal Module Skeleton */
.skeleton-modulo-principal {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.skeleton-modulo-principal .skeleton-image {
  height: 350px;
}

@media (min-width: 980px) {
  .skeleton-modulo-principal .skeleton-image {
    height: 700px;
  }
}

/* Aceites Skeleton */
.skeleton-aceite-card {
  min-height: 500px;
}

.skeleton-aceite-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 20px 20px;
}

.skeleton-aceite-button {
  width: 120px;
  height: 28px;
  border-radius: 0;
}

/* Product Skeleton */
.skeleton-product-card {
  min-height: 400px;
}

.skeleton-product-card .skeleton-image {
  height: 250px;
}

.skeleton-price {
  width: 100px;
  height: 36px;
  margin: 20px auto;
}

/* Chef Skeleton */
.skeleton-chef-card {
  min-height: 350px;
}

.skeleton-chef-card .skeleton-avatar {
  width: 100%;
  height: 255px;
  margin-bottom: 15px;
}

.skeleton-chef-name {
  width: 60%;
  height: 20px;
  margin: 0 auto 10px;
}

.skeleton-chef-restaurant {
  width: 50%;
  height: 16px;
  margin: 0 auto;
}

/* Recipe Skeleton */
.skeleton-recipe-card .skeleton-image {
  height: 280px;
}

/* =====================================================
   GRID SKELETONS
   ===================================================== */

/* Grid Container */
.skeleton-grid {
  display: grid;
  gap: 40px;
  padding: 0;
}

@media (min-width: 768px) {
  .skeleton-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 992px) {
  .skeleton-grid.modulos-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =====================================================
   LOADING STATES
   ===================================================== */

/* Hide actual content when skeleton is active */
.skeleton-active .actual-content {
  display: none;
}

/* Show skeleton when active */
.skeleton-active .skeleton-content-wrapper {
  display: block;
}

/* Fade transition */
.skeleton-fade-out {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.skeleton-fade-in {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */

/* Screen reader text for skeletons */
.skeleton-screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
.skeleton:focus {
  outline: 2px solid #a0ac31;
  outline-offset: 2px;
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */

/* Mobile adjustments */
@media (max-width: 767px) {
  .skeleton-card {
    margin-bottom: 20px;
  }
  
  .skeleton-image {
    height: 200px;
  }
  
  .skeleton-title {
    width: 80%;
    height: 20px;
  }
  
  .skeleton-text {
    height: 14px;
  }
  
  .skeleton-button {
    width: 100%;
    max-width: 280px;
  }
  
  .skeleton-buttons {
    flex-direction: column;
    align-items: center;
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
  .skeleton-grid {
    gap: 20px;
  }
}

/* Large desktop adjustments */
@media (min-width: 1200px) {
  .skeleton-grid {
    gap: 40px;
  }
  
  .skeleton-card {
    margin-bottom: 60px;
  }
}

/* =====================================================
   SECTION-SPECIFIC STYLES
   ===================================================== */

/* Modulos Section Skeleton */
.skeleton-modulos-section {
  margin-bottom: 60px;
}

/* Aceites Section Skeleton */
.skeleton-aceites-section {
  margin-bottom: 60px;
}

/* Productos Destacados Section Skeleton */
.skeleton-destacados-section {
  margin-bottom: 60px;
}

/* Chefs Section Skeleton */
.skeleton-chefs-section {
  margin-bottom: 60px;
}

/* Recetas Section Skeleton */
.skeleton-recetas-section {
  margin-bottom: 60px;
}

/* =====================================================
   PERFORMANCE OPTIMIZATIONS
   ===================================================== */

/* Reduce animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: #f6f6f6;
  }
}

/* Hardware acceleration for smooth animation */
.skeleton {
  will-change: background-position;
  transform: translateZ(0);
}
