/* 
 * Loader & Skeleton Styles
 * Provides animations and skeleton loading styles for content that's loading
 */

/* Main loader container */
.loader-container {
  width: 100%;
  text-align: center;
  padding: 2rem 0;
}

/* Spinner animation */
.spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(38, 71, 214, 0.2);
  border-radius: 50%;
  border-top-color: #2647d6;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pulse dot animations */
.loading-dots {
  display: inline-flex;
  align-items: center;
  column-gap: 8px;
  margin: 1rem 0;
}

.loading-dots .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #2647d6;
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-dots .dot:nth-child(2) {
  animation-delay: 0.3s;
}

.loading-dots .dot:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
}

/* Loading text animation */
.loading-text {
  display: inline-block;
  font-size: 0.9rem;
  color: #666;
  margin-top: 1rem;
}

.loading-text:after {
  content: '.';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60% { content: '...'; }
  80%, 100% { content: ''; }
}

/* Skeleton loading placeholders */
.skeleton {
  background-color: #eee;
  background-image: linear-gradient(90deg, #eee, #f5f5f5, #eee);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  display: inline-block;
  line-height: 1;
  width: 100%;
}

.skeleton-text {
  min-height: 1em;
  margin-bottom: 0.5rem;
}

.skeleton-text.sm {
  width: 25%;
}

.skeleton-text.md {
  width: 50%;
}

.skeleton-text.lg {
  width: 75%;
}

.skeleton-text.xl {
  width: 100%;
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-square {
  width: 40px;
  height: 40px;
}

.skeleton-card {
  width: 100%;
  height: 100px;
  margin-bottom: 10px;
}

.skeleton-button {
  width: 120px;
  height: 35px;
  border-radius: 18px;
}

.skeleton-table-row {
  display: flex;
  height: 40px;
  margin-bottom: 8px;
}

.skeleton-table-cell {
  flex: 1;
  margin-right: 8px;
  height: 100%;
}

.skeleton-table-cell:last-child {
  margin-right: 0;
}

@keyframes skeleton-loading {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

/* Match header skeleton */
.skeleton-match-header {
  height: 120px;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.skeleton-team-flag {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.skeleton-scorecard-table {
  width: 100%;
}

.skeleton-scorecard-table .header {
  height: 50px;
}

.skeleton-scorecard-table .row {
  height: 40px;
  margin-bottom: 8px;
}

/* Animation for content fade-in */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Content that should be hidden while loading */
.loading-hidden {
  display: none;
}

/* Loading overlay for specific sections */
.loading-overlay {
  position: relative;
}

.loading-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.loading-overlay::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  margin-left: -15px;
  border: 3px solid rgba(38, 71, 214, 0.2);
  border-radius: 50%;
  border-top-color: #2647d6;
  animation: spin 1s ease-in-out infinite;
  z-index: 11;
}

/* Progress bar */
.progress-container {
  width: 100%;
  height: 4px;
  background-color: #f5f5f5;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background-color: #2647d6;
  transition: width 0.4s ease;
} 