/**
 * Skeleton Loading Styles
 * Task 6.1: Loading Skeletons & Progressive Enhancement
 */

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

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

/* Skeleton types */
.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-rect {
  border-radius: 4px;
}

/* Calendar skeleton */
.skeleton-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 10px;
}

.skeleton-calendar-cell {
  width: 100%;
  padding-bottom: 100%; /* Square cells */
  background: #f0f0f0;
  border-radius: 4px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  position: relative;
}

/* Stagger animation for calendar cells */
.skeleton-calendar-cell:nth-child(7n+1) {
  animation-delay: 0s;
}
.skeleton-calendar-cell:nth-child(7n+2) {
  animation-delay: 0.1s;
}
.skeleton-calendar-cell:nth-child(7n+3) {
  animation-delay: 0.2s;
}
.skeleton-calendar-cell:nth-child(7n+4) {
  animation-delay: 0.3s;
}
.skeleton-calendar-cell:nth-child(7n+5) {
  animation-delay: 0.4s;
}
.skeleton-calendar-cell:nth-child(7n+6) {
  animation-delay: 0.5s;
}
.skeleton-calendar-cell:nth-child(7n+7) {
  animation-delay: 0.6s;
}

/* List skeleton */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
}

.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.skeleton-text-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Text skeleton container */
.skeleton-text-container {
  padding: 10px;
}

.skeleton-text-container .skeleton-text {
  margin-bottom: 12px;
}

.skeleton-text-container .skeleton-text:last-child {
  margin-bottom: 0;
}

/* Fade transition when content loads */
.skeleton-fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.skeleton-fade-in {
  animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .skeleton-calendar-cell {
    padding-bottom: 90%;
  }
  
  .skeleton-list-item {
    padding: 8px;
  }
}
