@import "trix";

@font-face { 
  font-family: 'Saysettha OT';
  src: url(/assets/lao_saysettha_ot.ttf) format('truetype');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: 'Saysettha OT', 'Roboto', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to right, #f0f4f8, #d9e2ec); /* 薄いグラデーション背景 */
}

.header {
  font-family: 'Roboto';
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: fixed; 
  top: 0;
  left: 0;
  z-index: 1000;
}

.flash {
  padding: 10px;
  margin: 10px 0px;
  border-radius: 5px;
  font-weight: bold;
}

.flash-alert {
  background-color: #f8d7da;
  color: #721c24;
}

.flash-notice {
  background-color: #d4edda;
  color: #155724;
}

.languages-index .header, 
.languages-index .footer {
  background: linear-gradient(to bottom, #0e35a9, #7995b9);
}

.header_logo {
  height: 70px;
  padding: 15px 0;
  cursor: pointer;
  color: white;
  text-decoration: none;
}

.footer {
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 20px;
  position: fixed;
  bottom: 0;
  left: 0;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  margin-top: 120px;
}

.top_title {
  margin-bottom: 20px;
  font-size: 30px;
  font-family: 'Arial', sans-serif; /* スッキリしたフォント */
  color: #2c3e50; /* タイトルカラー */
}

.top_sub {
  margin-bottom: 30px;
  font-size: 20px;
  text-align: center;
  font-family: 'Georgia', serif; /* 優雅なフォント */
  color: #34495e; /* サブタイトルカラー */
}

.top_column {
  background-color: hwb(225 33% 11%);
  color: white;
  width: 80%;
  max-width: 300px; /* 横幅制限 */
  text-align: center;
  border: 2px solid rgb(66, 85, 100);
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
  font-weight: bold;
  border-radius: 8px;
  margin: 10px;
  padding: 10px 15px;
  transition: all 0.3s ease-in-out; /* ホバー時のアニメーション */
  cursor: pointer;
  text-decoration: none;
}

.top_column_1 {
  background-color: hwb(225 33% 11%);
  color: white;
  width: 80%;
  max-width: 300px; /* 横幅制限 */
  text-align: center;
  border: 2px solid rgb(66, 85, 100);
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
  font-weight: bold;
  border-radius: 8px;
  margin: 10px;
  padding: 10px 15px;
  transition: all 0.3s ease-in-out; /* ホバー時のアニメーション */
  cursor: pointer;
}

.top_column:hover {
  transform: translateY(-5px); /* 上に少し浮かせる */
  box-shadow: 5px 10px 20px rgba(0, 0, 0, 0.3); /* より強調された影 */
}

.top_column_1:hover {
  transform: translateY(-5px); /* 上に少し浮かせる */
  box-shadow: 5px 10px 20px rgba(0, 0, 0, 0.3); /* より強調された影 */
}

/* チャプター一覧画面用 */

.chapters-index .header, 
.chapters-index .footer {
  background: linear-gradient(to bottom, #0e35a9, #7995b9);
}

.chapter-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  margin-top: 120px;
}

.chapter-list-title {
  width: 100%;
  text-align: center;
  font-size: 28px;  /* フォントサイズをレッスン一覧と合わせて大きめに */
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.chapter-list {
  width: 90%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-item {
  background-color: #58a6ff;  /* レッスン一覧と同じ背景色に調整 */
  color: white;
  padding: 20px;
  margin: 10px 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
}

.chapter-item:hover {
  transform: scale(1.05);
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.15);
}

.chapter-number {
  background: white;
  color: #58a6ff;  /* レッスン番号と同じ色に調整 */
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 50%;
  margin-right: 15px;
  min-width: 35px;
  text-align: center;
}

/* レッスン一覧ページ用 */

.lessons-index .header, 
.lessons-index .footer {
  background: linear-gradient(to bottom, #0e35a9, #7995b9);
}

.lesson-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  margin-top: 120px;
}

.lesson-list-title {
  width: 100%;
  max-width: 90%;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.lesson-list-title-small {
  font-size: 18px;
  font-weight: lighter;
}

.lesson-list {
  width: 90%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson-item {
  background-color: #58a6ff;
  color: white;
  padding: 20px;
  margin: 10px 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  font-size: 18px;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.1);
}

.lesson-item:hover {
  transform: scale(1.05);
  box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.15);
}

.lesson-number {
  background: white;
  color: #58a6ff;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 50%;
  margin-right: 15px;
  min-width: 35px;
  text-align: center;
}

/* レッスン詳細ページ用 */

/* 基本のスタイル */
.lesson_contents-show .header, 
.lesson_contents-show .footer {
  background: linear-gradient(to bottom, #0e35a9, #7995b9);
}

.lesson-content-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 20px 0;
  margin: 120px 0;
  text-align: center;
  min-height: calc(100vh - 90px); /* ビューポートの高さからフッターを引く */
}

.lesson-content {
  width: 100%;
  max-width: 70%;
}

.lesson-title {
  width: 100%;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.lesson-content-title {
  font-size: 32px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 20px;
}

.lesson-content-body {
  font-size: 18px;
  color: #34495e;
  line-height: 1.6;
  max-width: 100%;
  margin: 0 auto;
  text-align: left;
}

.lesson-image img {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
  border-radius: 8px;
}

/* YouTube動画のレスポンシブ対応 */
.youtube-video {
  position: relative;
  margin: 0 auto;
  width: 400px; /* 必要に応じて調整 */
  overflow: hidden;
}

.youtube-video::before {
  content: "";
  display: block;
  padding-bottom: 56.25%; /* 16:9アスペクト比 */
}

.youtube-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.lesson-writing p {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 15px;
}

.lesson-quiz {
  margin: 20px 0;
  margin-bottom: 100px;
}

.lesson-quiz label {
  font-size: 16px;
  font-weight: bold;
}

.lesson-quiz input[type="radio"] {
  margin-right: 5px;
}

.lesson-quiz input[type="submit"] {
  margin-top: 10px;
  padding: 8px 15px;
  font-size: 16px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.lesson-quiz input[type="submit"]:hover {
  background-color: #45a049;
}

.lesson-content-navigation {
  margin-top: 20px;
  margin-bottom: 100px;
}

.lesson-content-navigation a {
  display: inline-block;
  padding: 10px 20px;
  font-size: 18px;
  text-decoration: none;
  border-radius: 5px;
}

.lesson-content-navigation a:first-child {
  background-color: #007bff;
  color: white;
}

.lesson-content-navigation a:last-child {
  background-color: #dc3545;
  color: white;
}

.lesson-content-navigation a:hover {
  opacity: 0.8;
}

.prev-link {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 12px 20px;
  background-color: #444;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.prev-link:hover {
  background-color: #222;
}

/* 結果アイコンのスタイル */
#result-icon {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#result-icon.show {
  display: block;
  opacity: 1;
}

.icon-correct {
  font-size: 100px;
}

.icon-incorrect {
  font-size: 100px;
}

/* options-listのスタイル */
.options-list {
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column; /* 縦並び */
  gap: 5x; /* 選択肢の間隔を確保 */
  align-items: stretch; /* 選択肢の幅を統一 */
  width: fit-content;
}

.option-label {
  width: 100%;
  display: block;
  align-items: center;
  border: 1px solid #ccc;
  padding: 8px 12px;
  border-radius: 5px;
  max-width: 100%;
  min-width: fit-content;
  word-break: break-word;
  cursor: pointer;
}

.option-item {
  width: 100%;
  margin: 10px 0;
  border: 2px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s, transform 0.2s ease-in-out;
  display: block;
  align-items: center;
  min-width: max-content; /* 文字の長さに応じて最小幅を設定 */
}

/* ラジオボタンを隠してテキストだけに */
.option-radio {
  display: none;
}

/* ラジオボタンが選択されたときのスタイル */
.option-radio:checked + .option-text {
  font-weight: bold;
  color: #ffffff; /* 文字色を白にして目立たせる */
  background-color: #00796b; /* 選択された背景色 */
  border-color: #004d40; /* 選択された時のボーダー色 */
  transform: scale(1.05); /* 選ばれた感を出すために少し大きくする */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); /* 選択された項目にシャドウを追加 */
}

/* ホバー時の動き */
.option-item:hover {
  background-color: #f1f1f1;
  transform: scale(1.05); /* 少し大きくなって、押した感を出す */
}

.correct-answer-message {
  font-size: 18px;
  color: #f44336;
  margin-top: 15px;
  font-weight: bold;
}

.submit-button {
  background-color: #00796b;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.submit-button:hover {
  background-color: #004d40;
}

#tracing-canvas {
  margin-top: 20px;
  background-color: rgba(255, 255, 255, 0.8); /* ほんのり白 */
  border-radius: 10px; /* 角を丸める */
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1); /* 影をつけて目立たせる */
  border: 1px solid #d9e2ec; /* 境界をうっすらつける */
}

/* レスポンシブ対応 */
@media only screen and (max-width: 600px) {
  .header {
    height: 80px;
    padding: 0 15px;
  }
  .header_logo {
    margin: 0 auto;
    font-size: 18px;
  }
  .main {
    margin-top: 100px;
    margin-bottom: 100px;
    padding: 20px 10px;
    background: linear-gradient(to right, #f0f4f8, #d9e2ec); /* スマホでも同じ背景 */
  }
  .top_title {
    font-size: 24px;
    margin-bottom: 15px;
  }
  .top_sub {
    font-size: 16px;
    margin-bottom: 20px;
    padding: 0 10px;
  }
  .top_column {
    width: 90%; /* スマホでさらに幅を広げる */
    font-size: 14px;
    padding: 12px;
    margin-top: 0px;
    margin-bottom: 0px;
  }
  .top_column_1 {
    width: 90%; /* スマホでさらに幅を広げる */
    font-size: 14px;
    padding: 12px;
    margin-top: 50px;
    margin-bottom: 0px;
  }
  /* チャプター一覧画面用 */
  .chapter-item {
    font-size: 16px;
    padding: 12px;
  }
  .lesson-list-title {
    font-size: 24px;
    margin-bottom: 15px;
    flex-direction: column; /* スマホなどでは縦に並べる */
    align-items: center;     /* 中央揃え */
  }

  .lesson-item {
    font-size: 16px;
    padding: 15px;
    font-family: 'Saysettha OT', sans-serif; /* font-familyを使ってフォントを指定 */
  }
  .lesson-number {
    padding: 5px 10px;
  }
  /* レッスン詳細ページ用 */
  .lesson-content-title {
    font-size: 24px;
  }
  .lesson-content-body {
    font-size: 14px;
  }
  .lesson-quiz input, .lesson-quiz button {
    font-size: 12px;
  }
  .lesson-quiz {
    margin-top: 20px;
  }
  .lesson-quiz div {
    margin-bottom: 10px;
  }
  
  .lesson-quiz p, .lesson-writing p {
    font-size: 18px;
  }

  .lesson-quiz input, .lesson-quiz button {
    font-size: 14px;
  }

  .lesson-content-page {
    margin-top: 100px;
    margin-bottom: 100px;
  }

  .lesson-content {
    width: 100%;
    max-width: 100%;
    margin-bottom: 100px;
  }

  .lesson-content-body {
    width: 100%;
    max-width: 90%;
  }

  .youtube-video {
    width: 100%; /* 必要に応じて調整 */
    max-width: 90%
  }
}
