/* ========================================
   ページネーション上下用
======================================== */

.video-pagination {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: none;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* ケースページ（3ページ目）のみページネーション表示 */
.video-swiper-slide.case-slide.active .video-pagination {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* ========================================
   ページネーションドット
======================================== */

.video-pagination-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}

/* ホバー時 */
.video-pagination-dot:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: scale(1.2);
}

/* アクティブドット */
.video-pagination-dot.active {
  width: 24px;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ========================================
   ケース用ページネーション（左右用）
======================================== */

.case-pagination {
  position: fixed;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 0.8rem;
  pointer-events: auto;
}

/* ケースページのみ表示 */
.video-swiper-slide.case-slide .case-pagination {
  display: flex;
}

/* ========================================
   ケース用ドット
======================================== */

.case-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

/* ホバー時 */
.case-dot:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: scale(1.2);
}

/* アクティブドット */
.case-dot.active {
  width: 24px;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ========================================
   ページネーションアニメーション
======================================== */

@keyframes dotPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* ドット表示時のパルスアニメーション */
.video-pagination-dot.active,
.case-dot.active {
  animation: dotPulse 2s ease-in-out;
}

/* ========================================
   ドットのアクセシビリティ
======================================== */

.video-pagination-dot,
.case-dot {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.video-pagination-dot:focus,
.case-dot:focus {
  outline: 2px solid rgba(255, 255, 255, 0.6);
}

/* ========================================
   ページネーション表示/非表示制御
======================================== */

/* 1ページ目：ページネーション非表示 */
.video-swiper-slide:first-of-type .video-pagination {
  display: none !important;
}

/* 2ページ目：ページネーション非表示 */
.video-swiper-slide:nth-child(2) .video-pagination {
  display: none !important;
}

/* 3ページ目（ケース）：ページネーション表示 */
.video-swiper-slide:nth-child(3) .video-pagination {
  display: flex;
}

/* 4ページ目：ページネーション非表示 */
.video-swiper-slide:nth-child(4) .video-pagination {
  display: none !important;
}

/* ========================================
   レスポンシブ調整
======================================== */

@media (max-width: 600px) {
  .video-pagination {
    bottom: 1.5rem;
    padding: 0.6rem 1rem;
  }

  .video-pagination-dot {
    width: 6px;
    height: 6px;
  }

  .video-pagination-dot.active {
    width: 20px;
  }

  .case-pagination {
    bottom: 5rem;
    gap: 0.6rem;
  }

  .case-dot {
    width: 8px;
    height: 8px;
  }

  .case-dot.active {
    width: 20px;
  }
}

@media (max-width: 375px) {
  .video-pagination {
    bottom: 1rem;
    padding: 0.5rem 0.8rem;
  }

  .video-pagination-dot {
    width: 5px;
    height: 5px;
  }

  .video-pagination-dot.active {
    width: 16px;
  }

  .case-pagination {
    bottom: 4.5rem;
    gap: 0.5rem;
  }

  .case-dot {
    width: 7px;
    height: 7px;
  }

  .case-dot.active {
    width: 16px;
  }
}

/* ========================================
   ランドスケープ対応
======================================== */

@media (orientation: landscape) and (max-height: 600px) {
  .video-pagination {
    bottom: 1rem;
  }

  .case-pagination {
    bottom: 3.5rem;
  }

  .video-pagination-dot,
  .case-dot {
    width: 6px;
    height: 6px;
  }

  .video-pagination-dot.active,
  .case-dot.active {
    width: 16px;
  }
}

/* ========================================
   パフォーマンス最適化
======================================== */

.video-pagination,
.case-pagination {
  will-change: opacity, visibility;
  backface-visibility: hidden;
  perspective: 1000px;
}

.video-pagination-dot,
.case-dot {
  will-change: transform, background;
  backface-visibility: hidden;
}

/* ========================================
   アクセシビリティ
======================================== */

@media (prefers-reduced-motion: reduce) {
  .video-pagination-dot,
  .case-dot {
    transition: none !important;
    animation: none !important;
  }

  .video-pagination-dot:hover,
  .case-dot:hover {
    transform: none !important;
  }
}

/* ========================================
   ダークモード対応
======================================== */

@media (prefers-color-scheme: dark) {
  .video-pagination {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
}