/**
 * Skeleton Loading Animasyonları
 * İçerik yüklenirken gösterilen placeholder'lar
 */

/* Base Skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    #f1f5f9 0%,
    #e2e8f0 50%,
    #f1f5f9 100%
  );
  background-size: 200% 100%;
  animation: skeletonWave 1.5s ease-in-out infinite;
  border-radius: 8px;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

/* Skeleton Animation */
@keyframes skeletonWave {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Skeleton Types */
.skeleton-text {
  height: 16px;
  width: 100%;
  margin: 8px 0;
}

.skeleton-title {
  height: 28px;
  width: 60%;
  margin: 12px 0;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.skeleton-button {
  height: 40px;
  width: 120px;
  border-radius: 12px;
}

.skeleton-card {
  height: 200px;
  width: 100%;
  border-radius: 16px;
}

.skeleton-image {
  width: 100%;
  padding-bottom: 60%;
  border-radius: 12px;
}

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

.skeleton-badge {
  height: 24px;
  width: 80px;
  border-radius: 999px;
}

/* Skeleton Layouts */
.skeleton-card-layout {
  padding: 20px;
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

.skeleton-card-header {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.skeleton-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton-list-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: white;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Skeleton Table */
.skeleton-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.skeleton-table-row {
  display: table-row;
}

.skeleton-table-cell {
  padding: 16px;
  background: white;
}

.skeleton-table-cell .skeleton {
  height: 16px;
  width: 100%;
}

/* Dark Mode */
[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    #1e293b 0%,
    #334155 50%,
    #1e293b 100%
  );
  background-size: 200% 100%;
}

[data-theme="dark"] .skeleton-card-layout,
[data-theme="dark"] .skeleton-list-item {
  background: #1e293b;
  border-color: #334155;
}

/* Pulse Animation (alternative) */
.skeleton-pulse {
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

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

/* Shimmer Effect (alternative) */
.skeleton-shimmer::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.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: skeletonShimmer 2s infinite;
}

@keyframes skeletonShimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
}

/* Utility Classes */
.skeleton-full-width {
  width: 100%;
}

.skeleton-half-width {
  width: 50%;
}

.skeleton-third-width {
  width: 33.333%;
}

/* Loading Container */
.loading-container {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 300px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
}
