/* 基本スタイル設定 */
:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --primary-light: #eaf7ff;
  --secondary-color: #f39c12;
  --secondary-dark: #e67e22;
  --success-color: #2ecc71;
  --success-light: #d4edda;
  --danger-color: #e74c3c;
  --danger-light: #f8d7da;
  --warning-color: #f1c40f;
  --warning-light: #fff3cd;
  --dark-color: #34495e;
  --light-color: #f8f9fa;
  --grey-color: #95a5a6;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

.main-content{
  width: 100%;
}

.word-box {
  display: inline-block;
  padding: 0.1em 0.4em;
  border: 2px solid #333;
  /* border-radius: 0.3em; */
  font-weight: bold;
  /* background-color: #f9f9f9; */
}


.passing-formula-title {
  font-size: 1.4rem;
  color: #2c3e50;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  /* border-left: 4px solid #3498db; */
  font-weight: 600;
  letter-spacing: 0.05em;
  background: linear-gradient(to right, rgba(52, 152, 219, 0.1), transparent);
  padding: 0.5rem 1rem;
  border-radius: 3px;
  display: inline-block;
}
.scroll-hint {
  position: sticky;
  left: 10px;
  bottom: 10px;
  z-index: 100;
  margin: 0;
  padding: 4px 15px;
  max-width: 250px;
  background-color: rgba(0, 123, 255, 0.8);
  color: white;
  border-radius: 20px;
  font-size: 10px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  display: inline-block;
  animation: hint-pulse 2s infinite;
}

@keyframes hint-pulse {
  0% { transform: translateX(0); opacity: 0.8; }
  50% { transform: translateX(10px); opacity: 1; }
  100% { transform: translateX(0); opacity: 0.8; }
}

.regulation-text li{
  text-align: center;
  margin: 10px auto;
  padding-right: 50px;
}

/* 問題コンテナの改良 */
.question-container {
  width: 90%;
  /* max-width: 1000px; */
  margin: 0 auto 30px;
  padding: 25px;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  line-height: 1.8;
  font-size: 16px;
  color: #333;
  /* border-left: 5px solid var(--primary-color); */
}

/* 空欄のスタイル改良 */
.blank-with-answer {
  position: relative;
  display: inline-block;
  min-width: 80px;
  padding: 2px 8px;
  margin: 0 5px;
  border-bottom: 2px dashed var(--primary-color);
  text-align: center;
  font-weight: bold;
  color: var(--primary-color);
  background-color: rgba(52, 152, 219, 0.05);
  border-radius: 4px;
  transition: var(--transition);
}

.blank-with-answer:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

.blank-answer {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary-color);
  color: white;
  padding: 3px 10px;
  border-radius: 15px;
  font-size: 13px;
  font-weight: bold;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 10;
  white-space: nowrap;
}

.blank-answer::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--secondary-color) transparent transparent transparent;
}

.show-answer .blank-answer {
  opacity: 1;
  visibility: visible;
  top: -30px;
}

/* テーブルのスタイル改良 */
.blank-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 25px 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
}

.blank-table th, .blank-table td {
  padding: 12px 15px;
  text-align: center;
  border: 1px solid #ddd;
}

.blank-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: bold;
  border-color: #2980b9;
}

.blank-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.blank-table tr:hover {
  background-color: #f1f1f1;
}

.blank-table td:first-child {
  font-weight: bold;
  background-color: #f2f2f2;
}

/* 会話コンテナのスタイル改良 */
.conversation-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 92%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 15px 0;
  font-family: 'M PLUS Rounded 1c', 'Meiryo', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  
}

/* チャットバブルの改良 */
.chat-bubble {
  position: relative;
  padding: 18px 20px;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 17px;
  max-width: 85%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  animation: fadeIn 0.5s ease-in-out;
}

.pic2{
  width: 90px; /* 幅と高さを同じ値に */
  height: 90px;
  display: block;
  margin: 0 auto 10px;
  object-fit: contain; /* 追加 */
}

.teacher {
  align-self: flex-start;
  background-color: #ffeb99;
  color: #333;
  border-bottom-left-radius: 5px;
  margin-left: 40px;
}

/* .teacher:before {
  content: "";
  position: absolute;
  top: -35px;
  left: -40px;
  width: 50px;
  height: 50px;
  background-image: url("../img/icon/hiyoko.png");
  background-size: contain;
  background-repeat: no-repeat;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
} */

.student {
  align-self: flex-end;
  background-color: #cce5ff;
  color: #333;
  border-bottom-right-radius: 5px;
  margin-right: 40px;
}

/* .student:before {
  content: "";
  position: absolute;
  top: -35px;
  right: -40px;
  width: 50px;
  height: 50px;
  background-image: url("../img/icon/dog.png");
  background-size: contain;
  background-repeat: no-repeat;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
} */

/* 思考の道筋のデザイン改良 */
.solution-path {
  width: 92%;
  max-width: 900px;
  margin: 30px auto;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  position: relative;
  border-top: 3px solid var(--primary-color);
}

.solution-path::before {
  content: "思考の道筋";
  position: absolute;
  top: -15px;
  left: 20px;
  background-color: var(--primary-color);
  color: white;
  padding: 5px 15px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.thinking-step {
  background-color: white;
  border-left: 4px solid var(--grey-color);
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  transition: var(--transition);
}

.thinking-step:hover {
  border-left-color: var(--primary-color);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.thinking-step h4 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 17px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.thinking-step ul {
  padding-left: 20px;
}

.thinking-step li {
  margin: 8px 0;
  line-height: 1.6;
    /* list-style: none; */
}

/* ハイライトテキスト */
.highlighted-text {
  background-color: #ffffcc;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: bold;
  border-bottom: 1px dashed #f1c40f;
}

/* 記憶術ボックス */
.memory-aid {
  width: 92%;
  max-width: 900px;
  margin: 30px auto;
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  padding: 20px;
  border-radius: var(--border-radius);
  position: relative;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
}

.memory-aid h4 {
  margin-top: 0;
  color: #1890ff;
  font-size: 18px;
  text-align: center;
  border-bottom: 1px solid #91d5ff;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.phrase-mapping {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0;
  justify-content: center;
}

.phrase-item {
  background-color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: var(--transition);
}

.phrase-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.phrase-item .item-label {
  background-color: #1890ff;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-size: 12px;
  font-weight: bold;
}

/* 進行コントロール */
.progression-controls {
  width: 92%;
  max-width: 1000px;
  margin: 30px auto;
}

.progress-container {
  width: 100%;
  height: 10px;
  background-color: #e9ecef;
  border-radius: 5px;
  margin: 20px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 5px;
  width: 0%;
  transition: width 0.5s ease;
}

.hint-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 25px 0;
}

/* ボタンスタイル */
.hint-btn, .answer1-btn, .toggle-answer-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  transition: var(--transition);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  outline: none;
}

.hint-btn {
  background-color: var(--primary-color);
  color: white;
}

.hint-btn:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

.answer1-btn {
  background-color: var(--secondary-color);
  color: white;
}

.answer1-btn:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

.toggle-answer-btn {
  background-color: var(--light-color);
  color: var(--dark-color);
  border: 1px solid #ddd;
}

.toggle-answer-btn:hover {
  background-color: #eaeaea;
  transform: translateY(-2px);
}

/* 解説部分 */
.explanation {
  width: 92%;
  max-width: 1000px;
  margin: 40px auto;
  background-color: white;
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--box-shadow);
  display: none;
  animation: fadeIn 0.8s ease;
  /* border-left: 5px solid var(--success-color); */
   font-family:
    'Hiragino Mincho ProN',   /* macOS用 */
    'Yu Mincho',              /* Windows10以降 */
    'MS PMincho',             /* Windows標準 */
    'MS Mincho',              /* 古いWindows */
    'Noto Serif JP',          /* Google Fonts等Webフォント */
    serif;
}

.explanation h3 {
  color: var(--success-color);
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
  font-size: 24px;
}

.explanation p {
  line-height: 1.7;
  margin: 15px 0;
}

.explanation ul {
  padding-left: 20px;
}

.explanation li {
  margin: 12px 0;
  line-height: 1.6;
  /* list-style: none; */
}

.explanation ul,
.explanation ol {
  margin-left: 0;
  padding-left: 0;
}

.explanation li {
  margin: 12px 0;
  line-height: 1.6;
  padding-left: 0;
  list-style-position: inside; /* 箇条書きマークを内側に配置 */
}

/* 参照ボックス */
.reference-box {
  background-color: #f6f8fa;
  border-left: 4px solid #555;
  padding: 20px;
  margin: 25px 0;
  font-family: monospace;
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* まとめカード */
.summary-card {
  background-color: #fff8e1;
  border-left: 5px solid var(--warning-color);
  padding: 20px;
  margin: 25px 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.summary-card h4 {
  color: #e67e22;
  margin-top: 0;
  font-size: 20px;
  border-bottom: 1px solid #ffe0b2;
  padding-bottom: 10px;
}

.summary-card ul {
  padding-left: 20px;
}

.summary-card li {
  margin: 10px 0;
  line-height: 1.6;
}

.summary-card ul ul {
  margin: 10px 0;
}

/* アニメーション */
@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .chat-bubble {
    max-width: 90%;
    font-size: 14px;
    padding: 15px;
  }
  
  .teacher {
    margin-left: 25px;
  }
  .main-content {
    width: 100%;}
  
  .teacher:before {
    top: -25px;
    left: -25px;
    width: 25px;
    height: 25px;
  }
  
  .student {
    margin-right: 25px;
  }
  
  .student:before {
    top: -25px;
    right: -25px;
    width: 25px;
    height: 25px;
  }
  
  .blank-table {
    font-size: 14px;
  }
  
  .blank-table th, .blank-table td {
    padding: 8px 10px;
  }
  
  .hint-btn, .answer1-btn, .toggle-answer-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .solution-path, .memory-aid, .explanation {
    padding: 15px;
  }
  
  .thinking-step {
    padding: 12px;
  }
  
  .phrase-mapping {
    gap: 8px;
  }
}

/* アクセシビリティ改善 */
.hint-btn:focus, .answer1-btn:focus, .toggle-answer-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}



@media (min-width: 961px) {
  .main-content{
    margin: 0 auto;
    width:100%;
  }
  .main-content, #main-content-2 {
    margin-left: calc(230px + 100px);
    width: calc(100% - 230px - 200px);
    max-width: calc(100% - 230px - 200px);
    margin-right: 100px;
  }
  .scroll-hint{
    display: none;
  }
  .chat-bubble {
  
  font-size: 24px;
  
}
.memory-aid{
  font-size: 22px;  

}
.thinking-step {
  font-size: 22px;  
}
.explanation {
  font-size: 22px;  
}

.solution-path {
  font-size: 24px;
}
}