/* Loader Generator Styles */

.loader-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* Spinner */
.loader-spinner {
  border: 4px solid #000;
  border-top: 4px solid #00eeff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Dots */
.loader-dots {
  display: flex;
  gap: 8px;
}

.loader-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #00eeff;
  animation: bounce 1.4s ease-in-out infinite both;
}

.loader-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.loader-dots .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Bars */
.loader-bars {
  display: flex;
  gap: 4px;
  align-items: end;
}

.loader-bars .bar {
  width: 8px;
  height: 24px;
  background-color: #00eeff;
  animation: stretch 1.2s ease-in-out infinite both;
}

.loader-bars .bar:nth-child(1) { animation-delay: -1.1s; }
.loader-bars .bar:nth-child(2) { animation-delay: -1.0s; }
.loader-bars .bar:nth-child(3) { animation-delay: -0.9s; }
.loader-bars .bar:nth-child(4) { animation-delay: -0.8s; }
.loader-bars .bar:nth-child(5) { animation-delay: -0.7s; }

@keyframes stretch {
  0%, 40%, 100% {
    transform: scaleY(0.4);
  }
  20% {
    transform: scaleY(1.0);
  }
}

/* Ring */
.loader-ring {
  display: inline-block;
  position: relative;
  width: 48px;
  height: 48px;
}

.loader-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 40px;
  height: 40px;
  margin: 4px;
  border: 4px solid #00eeff;
  border-radius: 50%;
  animation: ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: #00eeff transparent transparent transparent;
}

.loader-ring div:nth-child(1) {
  animation-delay: -0.45s;
}

.loader-ring div:nth-child(2) {
  animation-delay: -0.3s;
}

.loader-ring div:nth-child(3) {
  animation-delay: -0.15s;
}

@keyframes ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Pulse */
.loader-pulse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #00eeff;
  animation: pulse 1.5s ease-in-out infinite both;
}

@keyframes pulse {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* Hourglass */
.loader-hourglass {
  position: relative;
  width: 48px;
  height: 48px;
  animation: hourglass 1s linear infinite;
}

.loader-hourglass div {
  position: absolute;
  width: 100%;
  height: 50%;
}

.loader-hourglass div:first-child {
  top: 0;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.loader-hourglass div:last-child {
  bottom: 0;
  clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
}

@keyframes hourglass {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

/* Square */
.loader-square {
  width: 48px;
  height: 48px;
  animation: square 1s linear infinite;
}

@keyframes square {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Triangle */
.loader-triangle {
  width: 0;
  height: 0;
  animation: triangle 1s linear infinite;
}

@keyframes triangle {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg); }
  100% { transform: rotate(360deg); }
}

/* Wave */
.loader-wave {
  display: flex;
  gap: 2px;
  align-items: end;
}

.loader-wave .wave-bar {
  animation: wave 1.2s ease-in-out infinite both;
}

@keyframes wave {
  0%, 100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1);
  }
}