/* ===================================
           基本スタイル & レイアウト
           =================================== */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background-color: #f8f9fa;
  color: #212529;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===================================
           カードセクション (共通)
           =================================== */
.card-section {
  background-color: #ffffff;
  border-radius: 20px;
  margin-bottom: 50px;
  padding: 40px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid #e9ecef;
}

/* セクションタイトル (共通) */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 40px;
  color: #212529;
  letter-spacing: 1px;
}

/* ===================================
           ヒーローセクション
           =================================== */
.hero-section {
  padding: 50px;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #111;
  line-height: 1.2;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.hero-image {
  width: 100%;
  border-radius: 16px;
}

.hero-content-title {
  font-size: 1.8rem;
  color: #343a40;
}

.hero-description {
  line-height: 1.8;
  color: #495057;
  margin-bottom: 25px;
}

.hero-feature-list {
  list-style: none;
  padding: 0;
}

.hero-feature-item {
  margin-bottom: 12px;
  color: #495057;
  padding-left: 25px;
  position: relative;
}

.hero-feature-item::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #e60073;
  font-weight: bold;
}

.hero-cta-button {
  display: inline-block;
  background-color: #e60073;
  color: #fff;
  padding: 16px 32px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(230, 0, 115, 0.2);
}

.hero-cta-button:hover {
  background-color: #d6006a;
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(230, 0, 115, 0.3);
}

/* ===================================
           画像ギャラリー
           =================================== */
.image-gallery {
  margin-bottom: 50px;
}

.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.thumbnail-item {
  width: 100%;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
}

.thumbnail-item:hover,
.thumbnail-item.active-thumbnail {
  transform: scale(1.05);
  border-color: #e60073;
}

/* ===================================
           性能バーグラフ
           =================================== */
#performance-bars-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.performance-bar {
  width: 100%;
}

.performance-bar-header {
  margin-bottom: 12px;
}

.performance-bar-label {
  font-weight: 600;
  font-size: 1.2rem;
  color: #343a40;
}

.component-name {
  font-weight: 500;
  margin-left: 10px;
}

.bar-with-labels {
  position: relative;
  padding-bottom: 20px;
}

.performance-bar-track {
  height: 20px;
  background-color: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
}

.performance-bar-fill {
  height: 100%;
  width: 0;
  /* 初期値は0 */
  border-radius: 10px;
  transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1);
  background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
  background-size: 1rem 1rem;
}

.track-labels {
  position: absolute;
  width: 100%;
  bottom: 0;
  left: 0;
  font-size: 0.8rem;
  color: #6c757d;
}

.track-label-normal {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.track-label-highspec {
  position: absolute;
  right: 0;
}

/* ===================================
           スペックテーブル
           =================================== */
.spec-table-wrapper {
  padding: 30px 40px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table-row {
  border-bottom: 1px solid #e9ecef;
}

.spec-table-row:last-child {
  border-bottom: none;
}

.spec-table-item-header,
.spec-table-item-value {
  padding: 18px 15px;
  text-align: left;
}

.spec-table-item-header {
  font-weight: 600;
  width: 30%;
  color: #343a40;
}

.spec-table-item-value {
  color: #495057;
}

.spec-notes-badge {
  background-color: #e60073;
  color: white;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 0.8em;
  margin-left: 10px;
  font-weight: 500;
}

/* ===================================
           特徴タブセクション
           =================================== */
.features-tabs-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tab-button {
  padding: 12px 24px;
  border: 1px solid #ced4da;
  background: #fff;
  color: #495057;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-weight: 500;
}

.tab-button.active-tab,
.tab-button:hover {
  background-color: #e60073;
  border-color: #e60073;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.feature-content-panel {
  display: none;
  /* 初期状態では非表示 */
}

.feature-content-panel.active {
  display: block;
  /* activeクラスで表示 */
}

.feature-content-panel p {
  margin: 0;
  line-height: 1.8;
  color: #495057;
}

/* ===================================
           コンポーネント詳細セクション
           =================================== */
.component-chapter-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 50px;
  align-items: center;
}

.component-chapter-image {
  width: 100%;
  border-radius: 16px;
}

.component-chapter-subtitle {
  font-size: 2rem;
  font-weight: 600;
  color: #343a40;
  margin-top: 0;
  margin-bottom: 20px;
}

.component-chapter-text {
  line-height: 1.8;
  color: #495057;
  margin-bottom: 25px;
}

.component-chapter-features {
  list-style: none;
  padding-left: 0;
  color: #495057;
}

.component-chapter-features li {
  padding-left: 25px;
  position: relative;
  margin-bottom: 12px;
}

.component-chapter-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #e60073;
  font-weight: bold;
}

/* 画像とテキストを逆順にするためのレイアウト */
.component-chapter-grid.reverse {
  grid-template-columns: 1.5fr 1fr;
}

.component-chapter-grid.reverse .component-chapter-image {
  grid-column: 2;
  grid-row: 1;
}

.component-chapter-grid.reverse .component-chapter-content {
  grid-column: 1;
  grid-row: 1;
}

/* ===================================
           GPU比較グラフ
           =================================== */
.gpu-comparison-section {
  margin-top: 50px;
  padding-top: 40px;
  border-top: 1px solid #e9ecef;
}

.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
}

/* ===================================
           レビューセクション
           =================================== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  text-align: left;
}

.review-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.review-avatar {
  width: 50px;
  height: 50px;
  background-color: #e9ecef;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.review-avatar svg {
  width: 28px;
  height: 28px;
  fill: #495057;
}

.review-author {
  font-weight: 600;
  font-size: 1.1rem;
  color: #212529;
  margin: 0;
}

.review-rating {
  display: flex;
  gap: 4px;
}

.review-rating svg {
  width: 18px;
  height: 18px;
  fill: #f59e0b;
}

.review-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #343a40;
  margin-top: 0;
  margin-bottom: 12px;
}

.review-text {
  font-size: 0.95rem;
  color: #495057;
  line-height: 1.7;
  margin: 0;
}

/* 親コンテナの設定 */
.review-rating {
  --rating: 0;
  /* デフォルトの評価値 */
  position: relative;
  /* 子要素を絶対配置するための基準 */
  display: inline-flex;
  /* 中身のサイズに合わせる */
}

/* 前景と背景の共通設定 */
.stars-background,
.stars-foreground {
  display: flex;
  /* SVGを横並びにする */
}

/* 前景（色付きの星）のコンテナ */
.stars-foreground {
  position: absolute;
  /* 背景の上に重ねる */
  top: 0;
  left: 0;
  white-space: nowrap;
  /* 折り返しを防ぐ */
  overflow: hidden;
  /* コンテナからはみ出た部分を隠す */
  /* ★ここが重要：変数の値に基づいて表示幅を計算 */
  width: calc(var(--rating) / 5 * 100%);
}

/* SVG（星アイコン）のスタイル */
.review-rating svg {
  width: 1.5em;
  /* 星のサイズ */
  height: 1.5em;
  flex-shrink: 0;
  /* 星が縮まないようにする */
}

/* 背景の星の色 */
.stars-background svg {
  fill: #ccc;
  /* 空の星の色 */
}

/* 前景の星の色 */
.stars-foreground svg {
  fill: #ffc107;
  /* 塗りつぶされた星の色（金色） */
}

/* ===================================
           CTAセクション
           =================================== */
.cta-section {
  text-align: center;
}

.cta-description {
  max-width: 600px;
  margin: 0 auto 30px auto;
  color: #495057;
}

/* ===================================
           レスポンシブ対応 (スマートフォン向け)
           =================================== */
@media (max-width: 768px) {

  /* レイアウト調整 */
  .hero-grid,
  .component-chapter-grid,
  .component-chapter-grid.reverse {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  /* ヒーローセクションの要素順序を変更 (テキストを画像の上に) */
  .hero-grid div:first-child {
    /* 画像のコンテナ */
    grid-row: 2;
  }

  .hero-grid div:last-child {
    /* テキストのコンテナ */
    grid-row: 1;
  }

  .component-chapter-grid.reverse .component-chapter-image,
  .component-chapter-grid.reverse .component-chapter-content {
    grid-column: 1;
    grid-row: auto;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  /* スペース（余白）調整 */
  .card-section,
  .hero-section {
    padding: 25px 20px;
  }

  /* タイポグラフィ（文字サイズ）調整 */
  .section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-content-title {
    font-size: 1.5rem;
  }

  .component-chapter-subtitle {
    font-size: 1.6rem;
  }

  /* スペックテーブルを縦並びに変形 */
  .spec-table,
  .spec-table tbody {
    display: block;
    width: 100%;
  }

  .spec-table-row {
    display: block;
    padding: 15px 0;
  }

  .spec-table-item-header,
  .spec-table-item-value {
    display: block;
    width: 100%;
    padding: 5px 0;
    border: none;
  }

  .spec-table-item-header {
    font-weight: 600;
    color: #212529;
    /* ヘッダーを少し目立たせる */
  }

  /* グラフコンテナの高さ調整 */
  .chart-container {
    height: 350px;
  }

  /* 特徴タブのボタンサイズ調整 */
  .tab-button {
    padding: 10px 18px;
  }
}