/* === ALBUKARAOQUE WEBSITE - ANIMATIONS & LOADING === */
/* Animations, loading states, and interactive elements */

/* === ANIMATIONS === */

/* Prevent flash during page load */
html {
  visibility: visible;
  opacity: 1;
}

body {
  visibility: visible;
  opacity: 1;
}

@keyframes shine {
  0% {
    left: -150px;
  }
  50% {
    left: 150%;
  }
  100% {
    left: 200%;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* === LOADING STATES === */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Loading Spinner */
.loading-spinner {
  border: 3px solid #f3f3f3;
  border-radius: 50%;
  border-top: 3px solid var(--primary-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

.loading-spinner.small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* Loading Text */
.loading-text {
  animation: pulse 1.5s ease-in-out infinite;
  color: #666;
  text-align: center;
  margin: 1rem 0;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Change from white to semi-transparent dark background */
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Make text white for better visibility */
.loading-overlay .loading-content p {
  color: white;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text.title {
  height: 1.5em;
  width: 60%;
}

.skeleton-text.line {
  width: 100%;
}

.skeleton-text.short {
  width: 75%;
}

.skeleton-card {
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Table Loading State */
.table-loading {
  position: relative;
}

.table-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
}

.table-loading::after {
  content: 'Loading songs...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  font-weight: bold;
  color: var(--primary-color);
}

/* Image Loading States */
.image-loading {
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.image-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

/* Content Loading States - DISABLED to prevent white flash */
/*
.content-loading .tagline,
.content-loading h1,
.content-loading h2,
.content-loading h3,
.content-loading p {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  color: transparent;
  border-radius: 4px;
  min-height: 1.2em;
}
*/

/* Loading Button States */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}

/* Fade-in animation for loaded content - DISABLED to prevent flash */
/*
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
*/

/* Progressive loading for images */
.progressive-image {
  position: relative;
  overflow: hidden;
}

.progressive-image img {
  transition: opacity 0.3s ease;
}

.progressive-image img.loading {
  opacity: 0;
}

.progressive-image img.loaded {
  opacity: 1;
}

/* Loading states for specific components */
.social-media-loading .social-icon {
  background: #f0f0f0;
  animation: pulse 1.5s infinite;
}

.nav-loading .nav a {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  color: transparent;
}

/* Responsive Animation Controls */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .loading-spinner {
    animation: none;
    border-top-color: #40B5A3;
  }
  
  .skeleton {
    animation: none;
    background: #f0f0f0;
  }
}

/* Add this at the end of the file */

.navigation-transition {
  position: fixed; /* Not absolute */
  z-index: 9999; /* Higher than other overlays */
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.85); /* Darker background */
  transition: none; /* No transition during navigation */
}

/* Make sure body doesn't scroll during transition */
body.navigating {
  overflow: hidden;
}
