/* Skeleton Loader Styles with Mobile-First Approach */
.skeleton-loader {
  width: 100%;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Allow inline sizing when needed (e.g., tabs, small icons) */
.skeleton-loader.inline {
  width: auto;
  display: inline-block;
}

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

/* Base skeleton styles with mobile-first approach */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  display: block;
}

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

/* Text skeleton */
.skeleton-text {
  height: 0.875rem;
  margin-bottom: 0.375rem;
}

/* Card skeleton - Mobile First */
.skeleton-card {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.75rem;
}

.skeleton-header {
  margin-bottom: 0.75rem;
}

.skeleton-title {
  height: 1.25rem;
  margin-bottom: 0.375rem;
}

.skeleton-subtitle {
  height: 0.875rem;
  width: 60%;
}

.skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* Table skeleton - Mobile First */
.skeleton-table {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

.skeleton-table-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid #e5e5e5;
}

.skeleton-table-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.skeleton-cell {
  height: 0.875rem;
}

/* Chart skeleton - Mobile First */
.skeleton-chart {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.skeleton-chart-title {
  height: 1.25rem;
  width: 60%;
  margin-bottom: 0.75rem;
}

.skeleton-chart-area {
  flex: 1;
  background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  min-height: 150px;
}

.skeleton-chart-area::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Stat skeleton - Mobile First */
.skeleton-stat {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.2s ease;
}

.skeleton-stat:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.skeleton-stat-value {
  height: 1.75rem;
  margin-bottom: 0.375rem;
}

.skeleton-stat-label {
  height: 0.875rem;
  width: 80%;
  margin: 0 auto;
}

/* List skeleton - Mobile First */
.skeleton-list {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
}

.skeleton-list-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-list-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.skeleton-item {
  margin-bottom: 0.75rem;
}

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

/* Tablet Breakpoint */
@media (min-width: 768px) {
  .skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
  }

  .skeleton-card {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
  }

  .skeleton-header {
    margin-bottom: 1rem;
  }

  .skeleton-title {
    height: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .skeleton-subtitle {
    height: 1rem;
  }

  .skeleton-body {
    gap: 0.5rem;
  }

  .skeleton-table {
    padding: 1rem;
    border-radius: 8px;
  }

  .skeleton-table-header {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }

  .skeleton-table-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 0.75rem;
  }

  .skeleton-cell {
    height: 1rem;
  }

  .skeleton-chart {
    padding: 1rem;
    border-radius: 8px;
    min-height: 250px;
  }

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

  .skeleton-chart-area {
    border-radius: 8px;
    min-height: 200px;
  }

  .skeleton-chart-area::before {
    width: 60px;
    height: 60px;
  }

  .skeleton-stat {
    padding: 1rem;
    border-radius: 8px;
  }

  .skeleton-stat-value {
    height: 2rem;
    margin-bottom: 0.5rem;
  }

  .skeleton-stat-label {
    height: 1rem;
    width: 70%;
  }

  .skeleton-list {
    padding: 1rem;
    border-radius: 8px;
  }

  .skeleton-list-item {
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
  }

  .skeleton-avatar {
    width: 48px;
    height: 48px;
  }

  .skeleton-list-content {
    gap: 0.5rem;
  }

  .skeleton-item {
    margin-bottom: 1rem;
  }
}

/* Desktop Breakpoint */
@media (min-width: 1024px) {
  .skeleton-chart {
    min-height: 300px;
  }

  .skeleton-chart-area {
    min-height: 250px;
  }

  .skeleton-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .skeleton-loader {
    animation: none;
  }
  
  .skeleton {
    background: #e5e5e5;
  }
  
  .skeleton-chart-area::before {
    animation: none;
  }
  
  .skeleton-stat:hover {
    transform: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .skeleton {
    background: #cccccc;
    border: 1px solid #999999;
  }
  
  .skeleton-chart-area {
    background: #dddddd;
    border: 1px solid #999999;
  }
}

/* Dark mode removed; enforce single light theme */
