/* Skeleton Loader CSS
 * Provides smooth loading animations for content while data is being fetched
 */

/* Base skeleton loading styles */
.skeleton-loader {
  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;
  min-height: 1rem;
}

/* Animated gradient effect */
@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Text line skeletons with different widths */
.skeleton-text {
  margin-bottom: 0.5rem;
  height: 1rem;
}

.skeleton-text.small {
  width: 30%;
}

.skeleton-text.medium {
  width: 60%;
}

.skeleton-text.large {
  width: 90%;
}

/* Card skeleton */
.skeleton-card {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #fff;
  margin-bottom: 1.5rem;
}

.skeleton-card-image {
  width: 100%;
  height: 120px;
}

.skeleton-card-body {
  padding: 1rem;
}

.skeleton-card-title {
  height: 1.5rem;
  margin-bottom: 1rem;
  width: 80%;
}

/* Table skeleton */
.skeleton-table {
  width: 100%;
  border-spacing: 0;
  margin-bottom: 1.5rem;
}

.skeleton-table-row {
  height: 3rem;
}

.skeleton-table-cell {
  padding: 0.75rem;
}

/* Profile/avatar skeleton */
.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 1rem;
}

.skeleton-avatar.large {
  width: 64px;
  height: 64px;
}

.skeleton-avatar.small {
  width: 36px;
  height: 36px;
}

/* Content layout for dashboard or cards */
.skeleton-dashboard {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Button skeleton */
.skeleton-button {
  height: 2.5rem;
  width: 100px;
  border-radius: 4px;
}

/* Chart skeleton */
.skeleton-chart {
  height: 200px;
  margin-bottom: 1.5rem;
}

/* Utility classes for flex layout */
.skeleton-flex {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.skeleton-flex-column {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Custom colors for different portal themes */
.skeleton-loader.admin-theme {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
}

.skeleton-loader.customer-theme {
  background: linear-gradient(90deg, #e6f7ff 25%, #d6eeff 50%, #e6f7ff 75%);
}

.skeleton-loader.technician-theme {
  background: linear-gradient(90deg, #e6ffe6 25%, #d6ffd6 50%, #e6ffe6 75%);
}

.skeleton-loader.healthcare-theme {
  background: linear-gradient(90deg, #f3e6ff 25%, #e8d6ff 50%, #f3e6ff 75%);
}

/* Hide skeleton loaders when content is loaded */
.content-loaded .skeleton-loader {
  display: none;
}

/* Fade-in animation for actual content */
.real-content {
  opacity: 0;
  animation: fade-in 0.3s ease-in forwards;
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .skeleton-dashboard {
    grid-template-columns: 1fr;
  }
  
  .skeleton-card-image {
    height: 100px;
  }
}