/* ========================================
   スムーズなページ遷移・アニメーション
   ======================================== */

/* ページフェードイン */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ページフェードアウト */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* スライドイン（左から） */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* スライドイン（右から） */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* スケールイン */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ローディングスピナー */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* パルス */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* スケルトンローディング */
@keyframes skeleton {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* ========================================
   適用クラス
   ======================================== */

.page-enter {
  animation: fadeIn 0.3s ease-out;
}

.page-exit {
  animation: fadeOut 0.3s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.4s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.4s ease-out;
}

.scale-in {
  animation: scaleIn 0.3s ease-out;
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

/* ローディングスピナー */
.spinner {
  border: 3px solid rgba(249, 115, 22, 0.1);
  border-top: 3px solid #f97316;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

.spinner-small {
  border: 2px solid rgba(249, 115, 22, 0.1);
  border-top: 2px solid #f97316;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 0.8s linear infinite;
}

/* スケルトンローディング */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0px, #e0e0e0 40px, #f0f0f0 80px);
  background-size: 200px 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  margin-bottom: 12px;
  width: 60%;
}

.skeleton-image {
  height: 120px;
  margin-bottom: 12px;
}

/* スムーズスクロール */
html {
  scroll-behavior: smooth;
}

/* トランジション */
.transition-all {
  transition: all 0.3s ease;
}

.transition-fast {
  transition: all 0.15s ease;
}

.transition-slow {
  transition: all 0.5s ease;
}

/* ホバーエフェクト強化 */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hover-scale {
  transition: transform 0.2s ease;
}

.hover-scale:hover {
  transform: scale(1.02);
}

/* ボタンリップル効果 */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* カード表示アニメーション */
.card-stagger {
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
}

.card-stagger:nth-child(1) { animation-delay: 0.05s; }
.card-stagger:nth-child(2) { animation-delay: 0.1s; }
.card-stagger:nth-child(3) { animation-delay: 0.15s; }
.card-stagger:nth-child(4) { animation-delay: 0.2s; }
.card-stagger:nth-child(5) { animation-delay: 0.25s; }
.card-stagger:nth-child(6) { animation-delay: 0.3s; }
.card-stagger:nth-child(7) { animation-delay: 0.35s; }

/* ページローディングオーバーレイ */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-out;
}

.page-loader.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

/* インタラクティブ要素 */
.interactive {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.interactive:active {
  transform: scale(0.98);
}

/* フォーカス表示改善 */
.focus-ring:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.3);
}

/* プログレスバー */
@keyframes progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-bar {
  position: relative;
  overflow: hidden;
  background: #e5e7eb;
  height: 4px;
  border-radius: 2px;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, #f97316, transparent);
  animation: progress 1.5s ease-in-out infinite;
}
