/* ==========================================================================
   Gallery Page Specific Styles
   ========================================================================== */

/* Loading Ring */
.demo-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-ring {
  position: relative;
  width: 60px;
  height: 60px;
}

.loading-ring div {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loading-ring div:nth-child(1) { animation-delay: -0.45s; }
.loading-ring div:nth-child(2) { animation-delay: -0.3s; }
.loading-ring div:nth-child(3) { animation-delay: -0.15s; }
.loading-ring div:nth-child(4) { animation-delay: 0; }

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pulse Button */
.demo-pulse-btn {
  position: relative;
  padding: 12px 28px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  overflow: visible;
  transition: transform 0.2s ease;
}

.demo-pulse-btn:hover {
  transform: scale(1.05);
}

.demo-pulse-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid #6366f1;
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
}

.demo-pulse-btn:hover::before {
  opacity: 1;
  visibility: visible;
  animation: pulse-ring 2s ease-out infinite;
}

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

/* Flip Card */
.demo-flip {
  perspective: 1000px;
}

.flip-card {
  width: 120px;
  height: 150px;
  cursor: pointer;
}

.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.flip-front {
  background: #1a1a25;
  border: 2px solid #2a2a3a;
  color: #e8e8f0;
}

.flip-back {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  transform: rotateY(180deg);
}

/* Glow Text */
.demo-glow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.glow-text {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  color: #6366f1;
  animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    text-shadow: 0 0 10px #6366f1, 0 0 20px #6366f1;
  }
  50% {
    text-shadow: 0 0 20px #6366f1, 0 0 40px #6366f1, 0 0 60px #8b5cf6;
  }
}

/* Morphing Blob */
.demo-blob {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  animation: morph 6s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
}

/* Bounce */
.demo-bounce {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 12px;
  animation: bounce-demo 0.6s ease infinite;
}

@keyframes bounce-demo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
}

/* Wave Loader */
.demo-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.demo-wave span {
  width: 10px;
  height: 10px;
  background: #6366f1;
  border-radius: 50%;
  animation: wave 1s ease-in-out infinite;
}

.demo-wave span:nth-child(1) { animation-delay: 0s; }
.demo-wave span:nth-child(2) { animation-delay: 0.1s; }
.demo-wave span:nth-child(3) { animation-delay: 0.2s; }
.demo-wave span:nth-child(4) { animation-delay: 0.3s; }
.demo-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Heart - Using SVG for better rendering */
.demo-heart {
  width: 48px;
  height: 48px;
  animation: heartbeat 1s ease-in-out infinite;
}

.heart-svg {
  width: 100%;
  height: 100%;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
  background: #2a2a3a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6366f1;
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .page-header {
    padding: 40px 16px 30px;
  }
}
