
/* Page transition effects */
body {
  transition: opacity 0.3s ease;
}

.page-transition {
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

/* Enhanced loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--smoky-black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-container {
  text-align: center;
  color: var(--white-2);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--onyx);
  border-top: 3px solid var(--orange-yellow-crayola);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-text {
  font-size: var(--fs-6);
  font-weight: var(--fw-500);
  margin: 0;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Navigation hover effects */
.navbar-link {
  position: relative;
  transition: all 0.3s ease;
}

.navbar-link:hover {
  transform: translateY(-2px);
}

.navbar-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--orange-yellow-crayola);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-link:hover::after,
.navbar-link.active::after {
  width: 100%;
}

/* Preload indicators */
.navbar-link.preloaded {
  position: relative;
}

.navbar-link.preloaded::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  background: var(--vegas-gold);
  border-radius: 50%;
  opacity: 0.7;
}

/* Content fade-in animation */
.main-content {
  animation: fadeInUp 0.6s ease;
}

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

/* Sidebar animation */
.sidebar {
  animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Article content animation */
article {
  animation: fadeIn 0.4s ease 0.2s both;
}

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

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading states for dynamic content */
.blog-loading,
.project-loading,
.certificate-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--light-gray-70);
  font-style: italic;
}

.blog-loading::before,
.project-loading::before,
.certificate-loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--onyx);
  border-top: 2px solid var(--orange-yellow-crayola);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

/* Enhanced focus states for accessibility */
.navbar-link:focus {
  outline: 2px solid var(--orange-yellow-crayola);
  outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .loading-spinner {
    width: 40px;
    height: 40px;
  }
  
  .loading-text {
    font-size: var(--fs-7);
  }
  
  .main-content {
    animation-duration: 0.4s;
  }
}