/* ============================================
   GLOBAL LOADING OVERLAY
   ============================================ */

#global-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(25, 25, 28, 0.85);
  backdrop-filter: blur(5px);
  z-index: 10000; /* Higher than modal z-index */
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#global-loading-overlay.active {
  opacity: 1;
}

.global-loading-content {
  text-align: center;
  color: #ffffff;
}

.global-loading-spinner {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  width: auto;
  height: 20px;
}

.global-loading-spinner .cube {
  width: 18px;
  height: 18px;
  background: #f9c441;
  border-radius: 4px;
}

.global-loading-spinner .cube:nth-child(1) {
  animation: cubeLoading1 1.4s infinite ease-in-out;
}

.global-loading-spinner .cube:nth-child(2) {
  animation: cubeLoading2 1.4s infinite ease-in-out 0.16s;
}

.global-loading-spinner .cube:nth-child(3) {
  animation: cubeLoading3 1.4s infinite ease-in-out 0.32s;
}

.global-loading-text {
  font-size: 18px;
  opacity: 0.9;
  animation: globalPulse 2s ease-in-out infinite;
  margin: 0;
  font-weight: 300;
}

@keyframes cubeLoading1 {
  0%, 80%, 100% { 
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% { 
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cubeLoading2 {
  0%, 80%, 100% { 
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% { 
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cubeLoading3 {
  0%, 80%, 100% { 
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% { 
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes globalPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.5; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .global-loading-spinner {
    gap: 6px;
    height: 16px;
  }
  
  .global-loading-spinner .cube {
    width: 15px;
    height: 15px;
  }
  
  .global-loading-text {
    font-size: 16px;
  }
}