/* ------------------------------------------------
 AIに質問 AIアドバイザー ask_ai.html
------------------------------------------------ */
/* ----------------------------
	デフォルトCSS
------------------------------- */
/* CSS Variables for better maintainability */

:root {
/* CSSカスタムプロパティ（CSS変数）を使用 
 後述のvar()で呼び出す 
 動的に呼び出されている可能性もあるので、削除しない
*/
  --primary-color: #0066cc;
  --primary-hover: #004499;
  --secondary-color: #deeafd;
  --border-color: #ddd;
  --text-color: #242424;
  --error-color: #ff0000;
  --background-light: #f5f5f5;
  --border-radius: 10px;
  --transition-speed: 0.3s;
}

/* Base styles
.msai-container * {
  box-sizing: border-box;
}
 */

/* Layout components */
.msai-container {
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin-inline: auto;
  padding: 20px;
}
@media (max-width: 767px) {
  .msai-container {
    padding-inline: 10px;
  }
}

.msai-ask {
  flex-shrink: 0;
}

.msai-answer {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
/*  transition: max-height var(--transition-speed) ease; */
  transition: max-height 0.3s ease;
}

.msai-answer.active {
  max-height: 600px;
}

/* Chat container */
#chat-container {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
  height: 100%;
}

/* Input components */
.input-container {
  position: relative;
  width: 100%;
}

#user_input {
  width: 100%;
/*
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
*/
  border-radius: 10px;
  border: 1px solid #ddd;
  padding: 10px 30px 10px 10px;
  margin-bottom: 10px;
  resize: none;
  overflow-y: auto;
  height: 100px;
  display: none;
}

#send-button {
  position: absolute;
  right: 10px;
  bottom: 15px;
  padding: 7px 10px;
  border: 0;
  background: none;
  cursor: pointer;
  display: none;
}

#send-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Icons */
#loading-icon,
#send-icon {
/*  stroke: var(--primary-color); */
  stroke: #0066cc;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Title */
.msai-title {
/*  color: var(--text-color); */
  color: #242424;
  font-weight: bold;
  font-size: 24px;
  width: fit-content;
  text-align: center;
  line-height: 1.3;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (max-width: 767px) {
  .msai-title {
    font-size: 18px;
  }
}

/* Question examples */
.msai-checkboxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-inline: auto;
  margin-block: 10px;
}

.msai-checkbox,
.msai-checkbox__input {
  cursor: pointer;
}

@media screen and (max-width: 767px) {
  .msai-checkboxes__item:first-child {
    text-align: center;
    width: 100%;
  }
}

/* Chat messages */
.chat-message {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.user-message {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
}

.user-message:nth-child(n + 2) {
  margin-top: 16px;
}

.user-bubble {
  max-width: 80%;
  padding: 10px 15px;
/*  border-radius: var(--border-radius);*/
  border-radius: 10px;
  word-wrap: break-word;
/*  background-color: var(--secondary-color);*/
  background-color: #deeafd;
}

/* Question links */
.msai-question-link {
  display: inline-block;
/*  background-color: var(--background-light);*/
  background-color: #f5f5f5;
  border: 1px solid #e0e0e0;
/*  border-radius: var(--border-radius);*/
  border-radius: 10px;
  padding: 8px 16px;
  color: #333333;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  margin: 4px 0;
/*  transition: all var(--transition-speed);*/
  transition: all 0.3s;
}

.msai-question-link:hover {
  background-color: #e8e8e8;
/*  border-color: var(--primary-hover); */
  border-color: #004499;
}

/* External links */
#chat-container a[target='_blank'] {
  position: relative;
}

#chat-container a[target='_blank']::after {
  content: '↗';
  font-size: 0.8em;
  margin-left: 2px;
  opacity: 0.7;
}

#chat-container a[target='_blank']::after{
	font-family: 'FontAwesome';
	content: '\f08e';
	font-size: 16px;
  font-size: 0.8em;
	margin-left: 0;
	padding-left: 8px;
	opacity: 1;
}

/* Chat content styling */
#chat-container a {
  color: #0066cc;
/*  color: var(--primary-color); */
  text-decoration: none;
  border-bottom: 1px solid transparent;
/*  transition: border-color var(--transition-speed),
    color var(--transition-speed);*/

  transition: border-color 0.3s,
    color 0.3s;
}

#chat-container a:hover {
/*
  color: var(--primary-hover);
  border-bottom-color: var(--primary-hover);*/

  color: #004499;
  border-bottom-color: #004499;
}

#chat-container a:visited {
  color: #551a8b;
}

#chat-container p {
  margin-top: 15px;
  line-height: 1.6;
}

#chat-container p + p {
  margin-top: 10px;
}

#chat-container ul,
#chat-container ol {
  margin-top: 15px;
  margin-bottom: 15px;
  padding-left: 20px;
}

#chat-container ul {
  list-style-type: disc;
}

#chat-container ol {
  list-style-type: decimal;
}

#chat-container li {
  margin-top: 8px;
  line-height: 1.6;
}

/* Disabled states */
.msai-ask.disabled .msai-checkbox,
.msai-ask.disabled .msai-checkbox__input {
  cursor: not-allowed;
  opacity: 0.5;
}

.msai-answer.disabled .msai-question-link {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

/* 外部リンクは常にクリック可能にする */
.msai-answer.disabled a[target='_blank']:not(.msai-question-link) {
  pointer-events: auto;
  opacity: 1;
  cursor: pointer;
}

/* Loading indicator */
.user-message::after {
  content: '';
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230066cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v4'%3E%3C/path%3E%3Cpath d='m16.2 7.8 2.9-2.9'%3E%3C/path%3E%3Cpath d='M18 12h4'%3E%3C/path%3E%3Cpath d='m16.2 16.2 2.9 2.9'%3E%3C/path%3E%3Cpath d='M12 18v4'%3E%3C/path%3E%3Cpath d='m4.9 19.1 2.9-2.9'%3E%3C/path%3E%3Cpath d='M2 12h4'%3E%3C/path%3E%3Cpath d='m4.9 4.9 2.9 2.9'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: none;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.msai-answer.disabled .user-message:last-of-type::after {
  display: block;
}

/* Utility classes */
.error {
/*  color: var(--error-color);*/
  color: #ff0000;
}

/* Remove list markers for question links */
ul:has(.msai-question-link) {
  padding-left: 20px;
}

li:has(.msai-question-link)::marker {
  content: '';
  display: none;
}

li:has(.msai-question-link)::before {
  content: unset !important;
}

/* ----------------------------
	本店ページ用CSS
------------------------------- */
.aiAskSection{
	min-height:880px;/* 質問エリア＋回答エリアの高さ*/
}
.aiAskSection .msai-checkboxes label{
 font-weight:normal;
}
.aiAskSection textarea#user_input:focus {
  border: 2px solid #0066cc; /* フォーカス時のボーダーの色を青に変更 */
}
#main .aiAskSection h1,
.yomimono .aiAskSection h2,
.yomimono .aiAskSection h3{
	font-weight: bold;
	text-align: left;
	line-height: 1.3;
	margin-top: 1.5rem;
	margin-bottom: 1rem;
	padding: 0;
}
#main .aiAskSection h1{
	font-size: 1.375rem;
}
.yomimono .aiAskSection h2 {
	font-size: 1.25rem;
	border-bottom:none;
}
.yomimono .aiAskSection h3 {
	font-size: 1.125rem;
	background-color: transparent;
}
.user-bubble{ /* ユーザーの質問（青吹き出し） */
	max-width:100%;
}
.msai-container{
	padding-top:0;
}
#chat-container{
	padding: 20px 10px;
}
#chat-container p{
	margin-bottom:1.5rem;
}
#chat-container ul,
#chat-container ol{
	padding-left: 1.7rem;
}
#chat-container ul li{
	list-style-type: disc;
}
#chat-container ol li{
	list-style-type: decimal;
}
/* 本店トップ用（タブメニュー）
#btn_online{
	top: 0;
} */
/*////////////////////////////////////////////*/
/* PC, Tablet(min-width:768px) */
@media (min-width: 768px) {
	#primary{
		min-height:500px;
	}
	#main .aiAskSection h1{
		font-size: 1.5rem;
	}
	.yomimono .aiAskSection h2 {
		font-size: 1.375rem;
	}
	.yomimono .aiAskSection h3 {
		font-size: 1.25rem;
		background-color: transparent;
	}
	#chat-container{
		padding: 20px 30px;
	}
	#chat-container ul,
	#chat-container ol{
		margin-left: 1rem;
	}
}/*END media query*/
/*////////////////////////////////////////////*/





