/* ========================================
   テキストコンテナ基本スタイル
======================================== */

.text-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  width: 85%;
  max-width: 90vw;
  pointer-events: none;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
  max-height: 50vh;
  overflow: hidden;
}

/* ========================================
   個別テキストアイテム
======================================== */

.text-item {
  color: white;
  opacity: 0;
  transform: translateY(30px);
  margin: 0.6rem auto;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.5;
  word-break: break-word;
  
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* アクティブスライドのテキスト表示 */
.video-swiper-slide.active .text-item {
  opacity: 1;
  transform: translateY(0);
}

/* テキストアイテムの段階的表示 */
.text-item:nth-child(1) {
  transition-delay: 0.25s;
}

.text-item:nth-child(2) {
  transition-delay: 0.3s;
}

.text-item:nth-child(3) {
  transition-delay: 0.35s;
}

.text-item:nth-child(4) {
  transition-delay: 0.4s;
}

.text-item:nth-child(5) {
  transition-delay: 0.45s;
}

/* ========================================
   ページ1用テキストスタイル
======================================== */

/* モバイル版ロゴ画像 */
.mobile-logo {
  width: auto;
  height: 80px;
  max-width: 280px;
  object-fit: contain;
  margin: 0 auto 1rem;
  /* 黒文字ロゴを白く表示 */
  filter: brightness(0) invert(1);
}

.video-swiper-slide:first-of-type .text-item:nth-child(1) {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.video-swiper-slide:first-of-type .text-item:nth-child(2) {
  font-size: 1.8rem;
  font-weight: 600;
  margin-top: 1rem;
}

.video-swiper-slide:first-of-type .text-item:nth-child(3) {
  font-size: 1.2rem;
  font-weight: 400;
  margin-top: 0.8rem;
  opacity: 0.85;
}

/* ========================================
   ページ2用テキストスタイル
======================================== */

.video-swiper-slide:nth-child(2) .text-item {
  font-size: 1.3rem;
  margin: 1rem auto;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  display: inline-block;
  min-width: 250px;
}

/* 強みアイテム（アイコン付き） */
.strength-item {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.strength-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.strength-item span {
  font-size: 1.3rem;
  font-weight: 500;
}

/* ========================================
   ケース用テキストスタイル
======================================== */

/* ケースタイトル */
.case-title {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #8a3ab9, #e95950, #fccc63);
  color: #ffffff;
  border-radius: 20px;
  margin-bottom: 0.8rem;
  letter-spacing: 1px;
  display: inline-block;
  text-transform: none;
}

/* ケースサブタイトル */
.case-subtitle {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

/* ケース統計 */
.case-stats {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1.2rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

/* 統計数字 */
.case-stat {
  font-size: 1.8rem;
  font-weight: 700;
  color: #E74C3C;
  text-align: center;
  margin: 0;
  line-height: 1.2;
}

/* 小さい説明テキスト */
.case-stat.small {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.7;
  margin-top: -0.3rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ハイライト（ケース2用） */
.case-stat.highlight {
  color: #FFD54F;
}

/* ========================================
   ケース1背景
======================================== */

.case-slider-item:nth-child(1) {
  background: linear-gradient(135deg, rgba(43, 122, 139, 0.3) 0%, rgba(27, 94, 111, 0.3) 100%);
}

/* ========================================
   ケース2背景
======================================== */

.case-slider-item:nth-child(2) {
  background: linear-gradient(135deg, rgba(27, 94, 111, 0.3) 0%, rgba(13, 58, 71, 0.3) 100%);
}

/* ========================================
   ページ4用テキストスタイル
======================================== */

.video-swiper-slide:nth-child(4) .text-item:nth-child(1) {
  font-size: 2rem;
  font-weight: 700;
}

.video-swiper-slide:nth-child(4) .text-item:nth-child(2),
.video-swiper-slide:nth-child(4) .text-item:nth-child(3) {
  font-size: 1.2rem;
  font-weight: 500;
}

/* ========================================
   1ページ目下部Swipeテキスト
======================================== */

.swipe-text {
  position: fixed;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.85rem;
  letter-spacing: 0;
  font-weight: 400;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

/* 1ページ目のみ表示 */
.video-swiper-slide:first-of-type.active .swipe-text {
  opacity: 0.5;
  animation: fadeInOutFast 2.5s ease-in-out infinite;
}

/* 下矢印 */
.swipe-text::after {
  content: "↓";
  font-size: 1.2rem;
  display: block;
}

/* ========================================
   横スワイプヒント（ケースページ用）
======================================== */

.swipe-hint-horizontal {
  position: fixed;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-size: 0.8rem;
  letter-spacing: 1px;
  font-weight: 500;
  pointer-events: none;
  color: rgba(255, 255, 255, 0.7);
}

/* ケースページのみ表示 */
.video-swiper-slide.case-slide.active .swipe-hint-horizontal {
  animation: fadeInOutFast 2.5s ease-in-out;
}

/* ========================================
   アニメーション定義
======================================== */

@keyframes fadeInOutFast {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
}

/* ========================================
   テキスト安全ゾーン
======================================== */

/* 画面端からの安全距離を確保 */
@media (max-width: 600px) {
  .text-container {
    width: 90%;
    padding: 1.5rem 1rem;
  }

  .text-item {
    font-size: 1.3rem;
  }

  .mobile-logo {
    height: 70px;
    max-width: 240px;
  }

  .case-title {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }

  .case-subtitle {
    font-size: 1.6rem;
  }

  .case-stat {
    font-size: 1.4rem;
  }

  .swipe-text {
    font-size: 0.8rem;
  }
}

@media (max-width: 375px) {
  .text-container {
    width: 85%;
    padding: 1rem 0.8rem;
  }

  .text-item {
    font-size: 1.1rem;
    margin: 0.4rem auto;
  }

  .mobile-logo {
    height: 60px;
    max-width: 200px;
  }

  .video-swiper-slide:first-of-type .text-item:nth-child(1) {
    font-size: 2rem;
  }

  .video-swiper-slide:first-of-type .text-item:nth-child(2) {
    font-size: 1.4rem;
  }

  .case-subtitle {
    font-size: 1.4rem;
  }

  .case-stat {
    font-size: 1.2rem;
  }

  .swipe-text,
  .swipe-hint-horizontal {
    font-size: 0.75rem;
  }
}

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

@media (orientation: landscape) and (max-height: 600px) {
  .text-container {
    max-height: 60vh;
  }

  .text-item {
    font-size: 1.1rem;
    margin: 0.3rem auto;
  }

  .mobile-logo {
    height: 50px;
    max-width: 180px;
  }

  .swipe-text,
  .swipe-hint-horizontal {
    bottom: 1.5rem;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .text-item,
  .swipe-text,
  .swipe-hint-horizontal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}