/* 로딩 스켈레톤 UI 스타일 */

/* 스켈레톤 애니메이션 */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* 기본 스켈레톤 클래스 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

/* 로딩 오버레이 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #e63946;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 스켈레톤 카드 */
.skeleton-card {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-title {
  height: 24px;
  width: 70%;
  margin-bottom: 1rem;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 40%;
}

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

.skeleton-text.long {
  width: 80%;
}

.skeleton-badge {
  height: 24px;
  width: 80px;
  border-radius: 12px;
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.skeleton-button {
  height: 36px;
  width: 120px;
  border-radius: 6px;
  margin-top: 1rem;
}

/* 스켈레톤 리스트 컨테이너 */
.skeleton-list {
  padding: 1rem;
}

/* 로딩 메시지 */
.loading-message {
  text-align: center;
  color: #666;
  margin: 2rem 0;
  font-size: 1.1rem;
}

.loading-message .loading-text {
  margin-top: 1rem;
}

/* 인라인 로딩 스피너 (작은 버전) */
.inline-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #e63946;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

/* 버튼 로딩 상태 */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 검색 로딩 상태 */
.search-loading {
  position: relative;
}

.search-loading::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top: 2px solid #e63946;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
  .skeleton-card {
    margin: 0.5rem 0;
    padding: 1rem;
  }
  
  .loading-overlay {
    backdrop-filter: none;
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
  .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
  }
  
  .loading-overlay {
    background: rgba(0, 0, 0, 0.8);
  }
  
  .loading-message {
    color: #ccc;
  }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .loading-spinner,
  .inline-spinner,
  .btn-loading::after,
  .search-loading::after {
    animation: none;
  }
  
  .skeleton {
    background: #e0e0e0;
  }
}