/* =========================================================
   アニメーション（全ページ共通）
   ========================================================= */

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

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

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

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

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

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

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

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

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

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

/* アニメーションクラス */
.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out forwards;
}

/* 遅延付きアニメーション */
.animate-delay-100 {
  animation-delay: 0.1s;
  opacity: 0;
}

.animate-delay-200 {
  animation-delay: 0.2s;
  opacity: 0;
}

.animate-delay-300 {
  animation-delay: 0.3s;
  opacity: 0;
}

.animate-delay-400 {
  animation-delay: 0.4s;
  opacity: 0;
}

.animate-delay-500 {
  animation-delay: 0.5s;
  opacity: 0;
}

/* ホバーアニメーション */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

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

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(5, 150, 105, 0.4);
}

/* カードアニメーション */
.card-animate {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.card-animate:nth-child(1) { animation-delay: 0.1s; }
.card-animate:nth-child(2) { animation-delay: 0.2s; }
.card-animate:nth-child(3) { animation-delay: 0.3s; }
.card-animate:nth-child(4) { animation-delay: 0.4s; }
.card-animate:nth-child(5) { animation-delay: 0.5s; }
.card-animate:nth-child(6) { animation-delay: 0.6s; }

/* リストアイテムアニメーション */
.list-item-animate {
  animation: fadeInLeft 0.5s ease-out forwards;
  opacity: 0;
}

.list-item-animate:nth-child(1) { animation-delay: 0.05s; }
.list-item-animate:nth-child(2) { animation-delay: 0.1s; }
.list-item-animate:nth-child(3) { animation-delay: 0.15s; }
.list-item-animate:nth-child(4) { animation-delay: 0.2s; }
.list-item-animate:nth-child(5) { animation-delay: 0.25s; }
.list-item-animate:nth-child(6) { animation-delay: 0.3s; }
.list-item-animate:nth-child(7) { animation-delay: 0.35s; }
.list-item-animate:nth-child(8) { animation-delay: 0.4s; }

/* テーブル行アニメーション */
.table-row-animate {
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 0;
}

.table-row-animate:nth-child(1) { animation-delay: 0.05s; }
.table-row-animate:nth-child(2) { animation-delay: 0.1s; }
.table-row-animate:nth-child(3) { animation-delay: 0.15s; }
.table-row-animate:nth-child(4) { animation-delay: 0.2s; }
.table-row-animate:nth-child(5) { animation-delay: 0.25s; }
.table-row-animate:nth-child(6) { animation-delay: 0.3s; }
.table-row-animate:nth-child(7) { animation-delay: 0.35s; }
.table-row-animate:nth-child(8) { animation-delay: 0.4s; }

/* ボタンアニメーション */
.btn-animate {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.btn-animate:hover::before {
  width: 300px;
  height: 300px;
}

.btn-animate:active {
  transform: scale(0.95);
}

/* ローディングアニメーション */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* スケルトンローディング */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* バッジアニメーション */
.badge-pulse {
  animation: pulse 2s infinite;
}

/* プログレスバーアニメーション */
.progress-bar-animated {
  animation: progressBar 1.5s ease-out forwards;
}

@keyframes progressBar {
  from {
    width: 0%;
  }
}

/* ページロードアニメーション */
.page-load {
  animation: fadeIn 0.5s ease-out forwards;
}

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

/* スクロールアニメーション（Intersection Observer用） */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* バウンスアニメーション */
.bounce-in {
  animation: bounce 0.6s ease-out;
}

/* 回転アニメーション */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.rotate {
  animation: rotate 2s linear infinite;
}

/* フリッカーアニメーション */
@keyframes flicker {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.flicker {
  animation: flicker 1.5s infinite;
}

/* ズームインアニメーション */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.zoom-in {
  animation: zoomIn 0.5s ease-out forwards;
}

/* スライドアップアニメーション */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.6s ease-out forwards;
}

/* トランジション */
.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* リップルエフェクト */
.btn-animate {
  position: relative;
  overflow: hidden;
}

.btn-animate .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* サイドバーアニメーション */
.sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay {
  transition: opacity 0.3s ease;
}

/* フォーム要素のアニメーション */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* バッジのアニメーション */
.badge {
  animation: badgeIn 0.4s ease-out;
}

@keyframes badgeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* アラートのアニメーション */
.alert {
  animation: alertIn 0.5s ease-out;
}

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

/* テーブルの行ホバーアニメーション */
.table-modern tbody tr {
  transition: all 0.2s ease;
}

.table-modern tbody tr:hover {
  transform: translateX(4px);
  box-shadow: 2px 0 8px rgba(5, 150, 105, 0.2);
}

/* カードのホバーアニメーション強化 */
.card-modern {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-modern:hover {
  transform: translateY(-4px) scale(1.01);
}

/* ローディングアニメーション */
@keyframes loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(5, 150, 105, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: loading 0.8s linear infinite;
}

