/**
 * 🔄 LOADING INDICATOR - Globaler Ladebalken am unteren Bildschirmrand
 * Zeigt Fortschritt bei längeren Lade-Operationen (Datenbank-Initialisierung, Artikel-Import, etc.)
 * 
 * Version: v0.01.008
 * Erstellt: 16.11.2025, 18:30:00 Uhr durch Steffen
 */

/* Container für den Loading Indicator (Fixed am unteren Rand) */
.loading-indicator {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.85));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 2px solid #FFD700;
  z-index: 9999;
  display: none; /* Standardmäßig versteckt */
  flex-direction: column;
  justify-content: center;
  padding: 0 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  animation: slideInFromBottom 0.3s ease-out;
}

.loading-indicator.visible {
  display: flex;
}

/* Dark Mode Anpassungen */
body.dark-mode .loading-indicator {
  background: linear-gradient(to top, rgba(30, 30, 30, 0.98), rgba(20, 20, 20, 0.95));
  border-top: 2px solid #FFD700;
}

/* Slide-in Animation */
@keyframes slideInFromBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide-out Animation */
@keyframes slideOutToBottom {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

.loading-indicator.hiding {
  animation: slideOutToBottom 0.3s ease-in forwards;
}

/* Haupt-Content-Bereich */
.loading-indicator-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 20px;
}

/* Linker Bereich: Icon + Beschreibung */
.loading-indicator-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
}

.loading-indicator-icon {
  font-size: 24px;
  animation: rotateIcon 2s linear infinite;
}

@keyframes rotateIcon {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loading-indicator-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loading-indicator-title {
  color: #FFD700;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.loading-indicator-subtitle {
  color: #999;
  font-size: 12px;
  line-height: 1.2;
}

/* Mittlerer Bereich: Fortschrittsbalken */
.loading-indicator-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loading-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.loading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
  border-radius: 4px;
  transition: width 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

/* Animierter Glanz-Effekt auf dem Fortschrittsbalken */
.loading-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

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

.loading-progress-text {
  font-size: 11px;
  color: #ccc;
  text-align: center;
}

/* Rechter Bereich: Statistiken */
.loading-indicator-right {
  display: flex;
  gap: 20px;
  min-width: 200px;
  justify-content: flex-end;
}

.loading-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.loading-stat-label {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loading-stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #FFD700;
  line-height: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .loading-indicator-right {
    min-width: 150px;
    gap: 15px;
  }
  
  .loading-stat-value {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .loading-indicator {
    height: auto;
    min-height: 60px;
    padding: 10px 15px;
  }
  
  .loading-indicator-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .loading-indicator-left,
  .loading-indicator-right {
    min-width: unset;
    width: 100%;
  }
  
  .loading-indicator-right {
    justify-content: space-around;
  }
  
  .loading-indicator-center {
    width: 100%;
  }
}

/* Indeterminate Progress (für unbestimmte Ladezeiten) */
.loading-progress-fill.indeterminate {
  width: 100% !important;
  background: linear-gradient(90deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
  background-size: 200% 100%;
  animation: indeterminateProgress 1.5s ease-in-out infinite;
}

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

/* Pulsierendes Icon für indeterminate Zustand */
.loading-indicator-icon.pulse {
  animation: pulseIcon 1.5s ease-in-out infinite;
}

@keyframes pulseIcon {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
}

