/* ===== Enhanced Loading Animations ===== */

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.loading-content {
  text-align: center;
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

.loading-content p {
  margin-top: 20px;
  font-size: 1.2rem;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Spinner Variants */
.spinner-border-custom {
  width: 3rem;
  height: 3rem;
  border: 0.25em solid rgba(0, 255, 255, 0.3);
  border-right-color: #00ffff;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
  to { transform: rotate(360deg); }
}

/* Pulse Spinner */
.spinner-pulse {
  width: 3rem;
  height: 3rem;
  background-color: #00ffff;
  border-radius: 50%;
  animation: spinner-pulse 1s ease-in-out infinite;
}

@keyframes spinner-pulse {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Bounce Spinner */
.spinner-bounce {
  display: inline-block;
  width: 3rem;
  height: 3rem;
}

.spinner-bounce div {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  background-color: #00ffff;
  border-radius: 50%;
  animation: spinner-bounce 1.4s ease-in-out infinite both;
  margin: 0 0.25rem;
}

.spinner-bounce div:nth-child(1) { animation-delay: -0.32s; }
.spinner-bounce div:nth-child(2) { animation-delay: -0.16s; }

@keyframes spinner-bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Wave Spinner */
.spinner-wave {
  display: inline-block;
  width: 3rem;
  height: 3rem;
}

.spinner-wave div {
  display: inline-block;
  width: 0.5rem;
  height: 2rem;
  background-color: #00ffff;
  margin: 0 0.125rem;
  animation: spinner-wave 1.2s ease-in-out infinite;
}

.spinner-wave div:nth-child(1) { animation-delay: -1.1s; }
.spinner-wave div:nth-child(2) { animation-delay: -1.0s; }
.spinner-wave div:nth-child(3) { animation-delay: -0.9s; }
.spinner-wave div:nth-child(4) { animation-delay: -0.8s; }
.spinner-wave div:nth-child(5) { animation-delay: -0.7s; }

@keyframes spinner-wave {
  0%, 40%, 100% {
    transform: scaleY(0.4);
  }
  20% {
    transform: scaleY(1);
  }
}

/* Rotating Dots */
.spinner-dots {
  display: inline-block;
  width: 3rem;
  height: 3rem;
  position: relative;
}

.spinner-dots div {
  position: absolute;
  top: 33px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #00ffff;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.spinner-dots div:nth-child(1) {
  left: 8px;
  animation: spinner-dots1 0.6s infinite;
}

.spinner-dots div:nth-child(2) {
  left: 8px;
  animation: spinner-dots2 0.6s infinite;
}

.spinner-dots div:nth-child(3) {
  left: 32px;
  animation: spinner-dots2 0.6s infinite;
}

.spinner-dots div:nth-child(4) {
  left: 56px;
  animation: spinner-dots3 0.6s infinite;
}

@keyframes spinner-dots1 {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes spinner-dots3 {
  0% { transform: scale(1); }
  100% { transform: scale(0); }
}

@keyframes spinner-dots2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(24px, 0); }
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(0, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin: 20px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00ffff, #00ffc3);
  border-radius: 2px;
  animation: progressFill 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

@keyframes progressFill {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, rgba(0, 255, 255, 0.1) 25%, rgba(0, 255, 255, 0.2) 50%, rgba(0, 255, 255, 0.1) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.skeleton-card {
  height: 200px;
  border-radius: 8px;
}

/* Button Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

/* Form Loading State */
.form-loading {
  opacity: 0.6;
  pointer-events: none;
}

.form-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
  z-index: 1;
}

/* Success/Error States */
.loading-success {
  color: #00ff00;
  animation: successPulse 0.6s ease-in-out;
}

.loading-error {
  color: #ff0000;
  animation: errorShake 0.6s ease-in-out;
}

@keyframes successPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Responsive Loading */
@media (max-width: 768px) {
  .loading-content p {
    font-size: 1rem;
  }
  
  .spinner-border-custom,
  .spinner-pulse,
  .spinner-bounce,
  .spinner-wave,
  .spinner-dots {
    width: 2rem;
    height: 2rem;
  }
}
