
/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* Global styles */
html {
  height: 100%;
  width: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

/* Main loading page */
.loading-page {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f0f23, #1a1a2e, #16213e, #0f0f23);
  background-size: 400% 400%;
  animation: dynamicGradient 10s ease infinite;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@keyframes dynamicGradient {
  0% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 100% 50%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Main container */
.loading-container {
  background: rgba(15, 15, 35, 0.9);
  backdrop-filter: blur(25px);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  max-width: 520px;
  width: 100%;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.loading-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: containerShine 3s linear infinite;
}

@keyframes containerShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Header section */
.header-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
}

.file-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24, #ff9ff3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  animation: iconFloat 3s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(255, 107, 107, 0.3);
}

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(5deg);
  }
}

.header-info h1 {
  color: #fff;
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #fff, #a8edea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.file-size {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 400;
  margin: 0;
}

/* Progress section */
.progress-section {
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  font-weight: 500;
}

.progress-percentage {
  color: #ff6b6b;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #ee5a24, #ff9ff3, #a8edea);
  background-size: 200% 100%;
  border-radius: 6px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  animation: progressGlow 2s linear infinite;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
}

@keyframes progressGlow {
  0% {
    background-position: 0% 50%;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 30px rgba(255, 159, 243, 0.8);
  }
  100% {
    background-position: 0% 50%;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.6);
  }
}

/* Current step */
.current-step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: stepIconPulse 2s ease-in-out infinite;
}

@keyframes stepIconPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(255, 107, 107, 0.5));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(255, 107, 107, 0.8));
  }
}

.step-text {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  font-weight: 500;
}

.data-progress {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: 'Courier New', monospace;
}

/* Stats section */
.stats-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 36px;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.stat-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 400;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  color: #a8edea;
  font-size: 1.4rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(168, 237, 234, 0.4);
}

/* Details section */
.details-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
}

.details-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  font-weight: 600;
}

.details-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.detail-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  font-weight: 400;
}

.detail-value {
  color: #ff9ff3;
  font-size: 0.9rem;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 159, 243, 0.3);
}

/* Error state */
.error-state {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.4);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}

.error-icon {
  font-size: 1.4rem;
  animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.error-message {
  color: #ffcccb;
  font-size: 0.95rem;
  font-weight: 500;
  flex: 1;
}

/* Responsive design */
@media (max-width: 768px) {
  .loading-container {
    padding: 28px;
    margin: 16px;
    max-width: none;
    border-radius: 16px;
  }

  .header-section {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }

  .file-icon {
    width: 60px;
    height: 60px;
  }

  .header-info h1 {
    font-size: 1.6rem;
  }

  .stats-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .current-step {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .data-progress {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .loading-container {
    padding: 24px;
    margin: 12px;
  }

  .file-icon {
    width: 52px;
    height: 52px;
  }

  .header-info h1 {
    font-size: 1.4rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }
}
