* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #e8e8e8;
  padding: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  text-align: center;
  padding: 3rem 1rem;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  background: linear-gradient(90deg, #00d9ff, #a855f7, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.7;
  font-style: italic;
}

.loaders-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.loader-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.loader-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.loader-demo {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
}

.loader-info {
  padding: 1.5rem;
}

.loader-info h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #00d9ff;
}

.loader-info p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.8;
}

/* ========== ORBITAL LOADER ========== */
.orbital-loader {
  position: relative;
  width: 120px;
  height: 120px;
}

.orbit {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.orbit-1 {
  inset: 0;
  animation: orbit 3s linear infinite;
}

.orbit-2 {
  inset: 15px;
  animation: orbit 2s linear infinite reverse;
}

.orbit-3 {
  inset: 30px;
  animation: orbit 1.5s linear infinite;
}

.planet {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.orbit-1 .planet { background: #ff6b6b; box-shadow: 0 0 10px #ff6b6b; }
.orbit-2 .planet { background: #4ecdc4; box-shadow: 0 0 10px #4ecdc4; }
.orbit-3 .planet { background: #ffe66d; box-shadow: 0 0 10px #ffe66d; }

.core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #fff, #a855f7);
  border-radius: 50%;
  box-shadow: 0 0 20px #a855f7;
}

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

/* ========== DNA HELIX LOADER ========== */
.dna-loader {
  display: flex;
  gap: 8px;
  height: 80px;
  align-items: center;
}

.strand {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: dna-wave 1.5s ease-in-out infinite;
}

.strand:nth-child(odd) { background: #00d9ff; }
.strand:nth-child(even) { background: #ec4899; }

.strand:nth-child(1) { animation-delay: 0s; }
.strand:nth-child(2) { animation-delay: 0.1s; }
.strand:nth-child(3) { animation-delay: 0.2s; }
.strand:nth-child(4) { animation-delay: 0.3s; }
.strand:nth-child(5) { animation-delay: 0.4s; }
.strand:nth-child(6) { animation-delay: 0.5s; }
.strand:nth-child(7) { animation-delay: 0.6s; }
.strand:nth-child(8) { animation-delay: 0.7s; }

@keyframes dna-wave {
  0%, 100% { transform: translateY(-30px) scale(0.8); opacity: 0.5; }
  50% { transform: translateY(30px) scale(1.2); opacity: 1; }
}

/* ========== MORPH LOADER ========== */
.morph-loader {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  animation: morph 3s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% {
    border-radius: 50% 50% 50% 50%;
    transform: rotate(0deg);
  }
  25% {
    border-radius: 50% 20% 50% 20%;
    transform: rotate(90deg);
  }
  50% {
    border-radius: 20% 50% 20% 50%;
    transform: rotate(180deg);
  }
  75% {
    border-radius: 50% 20% 50% 20%;
    transform: rotate(270deg);
  }
}

/* ========== PULSE WAVE LOADER ========== */
.pulse-loader {
  position: relative;
  width: 100px;
  height: 100px;
}

.pulse-wave {
  position: absolute;
  inset: 0;
  border: 3px solid #00d9ff;
  border-radius: 50%;
  animation: pulse-expand 2s ease-out infinite;
}

.pulse-wave:nth-child(2) { animation-delay: 0.5s; }
.pulse-wave:nth-child(3) { animation-delay: 1s; }

.pulse-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: #00d9ff;
  border-radius: 50%;
  animation: pulse-core 2s ease-in-out infinite;
}

@keyframes pulse-expand {
  0% { transform: scale(0.3); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

@keyframes pulse-core {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* ========== BLOCKS LOADER ========== */
.blocks-loader {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 5px;
}

.block {
  width: 30px;
  height: 30px;
  background: #4ecdc4;
  animation: block-pop 1.2s ease-in-out infinite;
}

.block-1 { animation-delay: 0s; }
.block-2 { animation-delay: 0.2s; }
.block-3 { animation-delay: 0.4s; }
.block-4 { animation-delay: 0.6s; }

@keyframes block-pop {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.5); opacity: 0.5; }
}

/* ========== HOURGLASS LOADER ========== */
.hourglass-loader {
  position: relative;
  width: 60px;
  height: 100px;
  animation: hourglass-flip 4s ease-in-out infinite;
}

.glass-top, .glass-bottom {
  position: absolute;
  width: 100%;
  height: 45%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.glass-top {
  top: 0;
  clip-path: polygon(10% 0%, 90% 0%, 60% 100%, 40% 100%);
}

.glass-bottom {
  bottom: 0;
  clip-path: polygon(40% 0%, 60% 0%, 90% 100%, 10% 100%);
}

.sand-top {
  position: absolute;
  top: 8px;
  left: 15%;
  width: 70%;
  height: 35%;
  background: #ffe66d;
  clip-path: polygon(5% 0%, 95% 0%, 70% 100%, 30% 100%);
  animation: sand-drain 4s ease-in-out infinite;
}

.sand-stream {
  position: absolute;
  top: 45%;
  left: 48%;
  width: 4px;
  height: 10%;
  background: #ffe66d;
  animation: stream-flow 4s ease-in-out infinite;
}

.sand-bottom {
  position: absolute;
  bottom: 5px;
  left: 15%;
  width: 70%;
  height: 5px;
  background: #ffe66d;
  border-radius: 0 0 5px 5px;
  animation: sand-fill 4s ease-in-out infinite;
}

@keyframes hourglass-flip {
  0%, 45% { transform: rotate(0deg); }
  50%, 95% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

@keyframes sand-drain {
  0% { height: 35%; }
  45% { height: 5%; }
  50% { height: 35%; }
  95% { height: 5%; }
  100% { height: 35%; }
}

@keyframes stream-flow {
  0%, 45%, 50%, 95%, 100% { opacity: 1; }
  47%, 52%, 97% { opacity: 0; }
}

@keyframes sand-fill {
  0% { height: 5px; }
  45% { height: 35%; }
  50% { height: 5px; }
  95% { height: 35%; }
  100% { height: 5px; }
}

/* ========== INFINITY LOADER ========== */
.infinity-loader {
  width: 100px;
  height: 50px;
  position: relative;
}

.infinity-path {
  position: absolute;
  inset: 0;
  border: 4px solid transparent;
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: infinity-spin 2s linear infinite;
}

.infinity-path::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 100%;
  height: calc(100% + 8px);
  border: 4px solid transparent;
  border-top-color: #ec4899;
  border-radius: 50%;
  transform: translateX(-100%) rotate(60deg);
}

.infinity-dot {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px #fff;
}

@keyframes infinity-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== BREATH LOADER ========== */
.breath-loader {
  position: relative;
  width: 100px;
  height: 100px;
}

.breath-ring {
  position: absolute;
  inset: 0;
  border: 2px solid;
  border-radius: 50%;
  animation: breathe 4s ease-in-out infinite;
}

.breath-ring-1 {
  border-color: rgba(0, 217, 255, 0.8);
  animation-delay: 0s;
}

.breath-ring-2 {
  inset: 15px;
  border-color: rgba(168, 85, 247, 0.8);
  animation-delay: 0.3s;
}

.breath-ring-3 {
  inset: 30px;
  border-color: rgba(236, 72, 153, 0.8);
  animation-delay: 0.6s;
}

.breath-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #fff, #00d9ff);
  border-radius: 50%;
  animation: breathe-core 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes breathe-core {
  0%, 100% { transform: translate(-50%, -50%) scale(0.8); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 1rem;
  opacity: 0.6;
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  header {
    padding: 2rem 1rem;
  }

  .loaders-gallery {
    gap: 1.5rem;
  }

  .loader-demo {
    height: 160px;
  }

  .loader-info {
    padding: 1rem;
  }

  .loader-info h2 {
    font-size: 1.1rem;
  }

  .loader-info p {
    font-size: 0.9rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .orbit, .strand, .morph-loader, .pulse-wave, .pulse-core,
  .block, .hourglass-loader, .sand-top, .sand-stream, .sand-bottom,
  .infinity-path, .breath-ring, .breath-center {
    animation: none;
  }
}
