/* 
  Loading Animations and States for Athena-sama Website
*/

/* === MAIN LOADING SCREEN === */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #FFB6C1, #87CEEB);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.8s ease;
  opacity: 1;
  visibility: visible;
}

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

.loading-content {
  text-align: center;
  animation: loadingPulse 2s ease-in-out infinite;
}

.loading-content h2 {
  font-size: 3rem;
  margin-bottom: 2rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  background: linear-gradient(45deg, #fff, #FFE0EC, #fff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
  position: relative;
  z-index: 3001;
}

.loading-content p {
  font-size: 1.2rem;
  opacity: 0.9;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
  animation: textFloat 3s ease-in-out infinite;
}

/* === LOADING SPINNER === */
.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  margin: 0 auto 2rem;
  position: relative;
}

.loading-spinner::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top: 4px solid rgba(255, 255, 255, 0.6);
  animation: spin 2s linear infinite reverse;
}

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

@keyframes loadingPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

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

/* === COMPONENT LOADING STATES === */
.blog-item.loading {
  position: relative;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  color: transparent;
}

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes shimmerOverlay {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

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

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

.skeleton-text.subtitle {
  height: 1.2em;
  width: 60%;
}

.skeleton-text.content {
  height: 1em;
  width: 100%;
}

.skeleton-text.content:last-child {
  width: 70%;
}

.skeleton-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 8px;
}

/* === LOADING DOTS === */
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.loading-dots::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: loadingDots 1.4s infinite ease-in-out;
}

.loading-dots::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 4px;
  animation: loadingDots 1.4s infinite ease-in-out;
  animation-delay: -0.32s;
}

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

/* === PROGRESS BAR === */
.progress-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #FFE0EC, #87CEEB, #FFB6C1);
  background-size: 200% 100%;
  border-radius: 2px;
  animation: progressPulse 2s ease-in-out infinite;
  width: 0%;
  transition: width 0.3s ease;
}

@keyframes progressPulse {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* === VRM LOADING STATES === */
.vrm-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 150;
  background: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 15px;
  backdrop-filter: blur(10px);
}

.vrm-loading h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.vrm-loading p {
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.vrm-progress {
  width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
  margin: 0 auto;
}

.vrm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FF69B4, #87CEEB);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 105, 180, 0.5); }
  50% { box-shadow: 0 0 20px rgba(255, 105, 180, 0.8); }
}

/* === LOADING ANIMATIONS FOR DIFFERENT STATES === */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.fade-in-up.delay-1 { animation-delay: 0.1s; }
.fade-in-up.delay-2 { animation-delay: 0.2s; }
.fade-in-up.delay-3 { animation-delay: 0.3s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scale-in {
  animation: scaleIn 0.5s ease-out forwards;
  opacity: 0;
  transform: scale(0.8);
}

@keyframes scaleIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
  opacity: 0;
  transform: translateX(-30px);
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
  opacity: 0;
  transform: translateX(30px);
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === ERROR STATES === */
.loading-error {
  color: #ff6b6b;
  text-align: center;
  padding: 2rem;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.loading-error h3 {
  color: #ff6b6b;
  margin-bottom: 1rem;
}

.retry-button {
  padding: 0.8rem 1.5rem;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.retry-button:hover {
  background: #ff5252;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

/* === MOBILE LOADING OPTIMIZATIONS === */
@media (max-width: 768px) {
  .loading-content h2 {
    font-size: 2rem;
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
  
  .vrm-loading {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .vrm-progress {
    width: 150px;
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  .loading-spinner,
  .progress-bar,
  .vrm-progress-fill {
    animation: none;
  }
  
  .loading-content {
    animation: none;
  }
  
  .skeleton {
    animation: none;
    background: #f0f0f0;
  }
  
  .loading-dots::before,
  .loading-dots::after {
    animation: none;
  }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
  .loading-screen {
    background: #000;
    color: #fff;
  }
  
  .loading-spinner {
    border-color: #fff;
    border-top-color: #000;
  }
  
  .skeleton {
    background: #333;
  }
  
  .progress-bar {
    background: #fff;
  }
}