/* Sayfa Geçiş Animasyonları */
/* Türkçe yorum: Sayfalar arası smooth geçişler için CSS animasyonları */

/* Sayfa geçiş container'ı */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

.page-transition.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Loading spinner */
.page-transition__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Loading text */
.page-transition__text {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

/* Background overlay */
.page-transition__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
  opacity: 0.95;
  backdrop-filter: blur(10px);
}

/* Spinner animasyonu */
@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fade in/out animasyonları */
.fade-in {
  animation: fadeIn 0.8s ease-in-out;
}

.fade-out {
  animation: fadeOut 0.6s ease-in-out;
}

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

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

/* Sayfa içeriği için geçiş */
.page-content {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

.page-content.loading {
  opacity: 0.7;
  transform: translateY(10px);
}

/* Link hover efektleri */
.smooth-link {
  position: relative;
  transition: all 0.3s ease;
}

.smooth-link::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.smooth-link:hover::before {
  width: 100%;
}

.smooth-link:hover {
  color: var(--color-primary);
  transform: translateY(-1px);
}

/* Buton geçiş efektleri */
.btn-transition {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-transition::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.btn-transition:hover::before {
  left: 100%;
}

.btn-transition:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 0, 0, 0.3);
}

/* Kart geçiş efektleri */
.card-transition {
  transition: all 0.3s ease;
}

.card-transition:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Mobil için optimize edilmiş geçişler */
@media (max-width: 768px) {
  .page-transition__spinner {
    width: 40px;
    height: 40px;
  }
  
  .page-transition__text {
    font-size: 12px;
  }
  
  .fade-in {
    animation-duration: 0.3s;
  }
  
  .fade-out {
    animation-duration: 0.2s;
  }
}

/* Reduced motion için */
@media (prefers-reduced-motion: reduce) {
  .page-transition,
  .fade-in,
  .fade-out,
  .smooth-link,
  .btn-transition,
  .card-transition {
    transition: none;
    animation: none;
  }
  
  .page-transition__spinner {
    animation: none;
    border: 3px solid var(--color-primary);
  }
}
