/* SS Survey — チャットボットUI スタイル */

/* ── テーマ非依存リセット ── */
.ss-chatbot,
.ss-chatbot * {
	box-sizing: border-box;
}

/* ================================================================
   コンテナ
================================================================ */
.ss-chatbot {
	width: 100%;
	max-width: 560px;
	margin: 2rem auto;
	font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
	font-size: 15px;
	border-radius: 16px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #f5f7fb;
}

/* ================================================================
   ヘッダー
================================================================ */
.ss-chatbot__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	background: #0073aa;
	color: #fff;
}

.ss-chatbot__avatar {
	font-size: 1.5rem;
	line-height: 1;
	flex-shrink: 0;
}

.ss-chatbot__bot-name {
	font-weight: 700;
	font-size: 1rem;
	flex: 1;
}

.ss-chatbot__status {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.75rem;
	opacity: 0.85;
}

.ss-chatbot__status-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4ade80;
	transition: background 0.4s;
}

/* ================================================================
   メッセージエリア
================================================================ */
.ss-chatbot__messages {
	flex: 1;
	min-height: 320px;
	max-height: 480px;
	overflow-y: auto;
	padding: 20px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
}

/* スクロールバー（WebKit） */
.ss-chatbot__messages::-webkit-scrollbar { width: 4px; }
.ss-chatbot__messages::-webkit-scrollbar-track { background: transparent; }
.ss-chatbot__messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ================================================================
   メッセージ行
================================================================ */
.ss-chatbot__message {
	display: flex;
	max-width: 80%;
	animation: ss-msg-in 0.22s ease;
}

@keyframes ss-msg-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

.ss-chatbot__message--bot  { align-self: flex-start; }
.ss-chatbot__message--user { align-self: flex-end; flex-direction: row-reverse; }

/* ================================================================
   吹き出し
================================================================ */
.ss-chatbot__bubble {
	padding: 10px 14px;
	border-radius: 18px;
	line-height: 1.6;
	word-break: break-word;
}

.ss-chatbot__message--bot  .ss-chatbot__bubble {
	background: #fff;
	color: #1a1a1a;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ss-chatbot__message--user .ss-chatbot__bubble {
	background: #0073aa;
	color: #fff;
	border-bottom-right-radius: 4px;
}

/* ================================================================
   タイピングインジケーター
================================================================ */
.ss-chatbot__dots {
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 12px 16px !important;
}

.ss-chatbot__dots span {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9ca3af;
	animation: ss-dot-bounce 1.2s infinite ease-in-out;
}

.ss-chatbot__dots span:nth-child(1) { animation-delay: 0s; }
.ss-chatbot__dots span:nth-child(2) { animation-delay: 0.2s; }
.ss-chatbot__dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ss-dot-bounce {
	0%, 60%, 100% { transform: translateY(0); }
	30%           { transform: translateY(-7px); }
}

/* ================================================================
   CTAボタングループ
================================================================ */
.ss-chatbot__cta-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 0;
	align-self: flex-start;
	animation: ss-msg-in 0.22s ease;
}

.ss-chatbot__cta-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	background: #fff;
	color: #0073aa;
	border: 2px solid #0073aa;
	border-radius: 99px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s, color 0.15s, transform 0.1s;
	cursor: pointer;
}

.ss-chatbot__cta-btn:hover {
	background: #0073aa;
	color: #fff;
	transform: translateY(-1px);
}

.ss-chatbot__cta-btn::after {
	content: ' →';
	font-size: 0.8em;
}

/* ================================================================
   入力エリア
================================================================ */
.ss-chatbot__input-area {
	padding: 12px 16px 16px;
	background: #fff;
	border-top: 1px solid #e5e7eb;
}

/* ---- クイックリプライボタン ------------------------------------- */
.ss-chatbot__quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ss-chatbot__quick-reply {
	padding: 8px 16px;
	background: #fff;
	color: #0073aa;
	border: 1.5px solid #0073aa;
	border-radius: 99px;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.ss-chatbot__quick-reply:hover {
	background: #e0f0f8;
}

.ss-chatbot__quick-reply--selected {
	background: #0073aa;
	color: #fff;
}

.ss-chatbot__quick-reply:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ---- リスト形式オプション --------------------------------------- */
.ss-chatbot__option-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ss-chatbot__option-label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.9rem;
	transition: background 0.12s;
}

.ss-chatbot__option-label:hover { background: #f0f9ff; }

.ss-chatbot__option-label input[type="radio"],
.ss-chatbot__option-label input[type="checkbox"] {
	accent-color: #0073aa;
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
}

/* ---- テキスト入力 ----------------------------------------------- */
.ss-chatbot__text-input {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.ss-chatbot__text-field {
	flex: 1;
	padding: 9px 12px;
	border: 1.5px solid #d1d5db;
	border-radius: 10px;
	font-size: 0.95rem;
	font-family: inherit;
	resize: none;
	transition: border-color 0.2s;
}

.ss-chatbot__text-field:focus {
	outline: none;
	border-color: #0073aa;
}

/* ---- 星レーティング --------------------------------------------- */
.ss-chatbot__rating {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

.ss-chatbot__star {
	font-size: 1.75rem;
	color: #d1d5db;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0 2px;
	transition: color 0.12s, transform 0.1s;
	line-height: 1;
}

.ss-chatbot__star:hover,
.ss-chatbot__star--hover,
.ss-chatbot__star--active {
	color: #f59e0b;
}

.ss-chatbot__star:hover { transform: scale(1.2); }

/* ---- 送信ボタン ------------------------------------------------- */
.ss-chatbot__send-btn {
	padding: 9px 18px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, transform 0.1s;
	white-space: nowrap;
	flex-shrink: 0;
}

.ss-chatbot__send-btn:hover:not(:disabled) { background: #005d8c; }
.ss-chatbot__send-btn:active:not(:disabled) { transform: scale(0.97); }
.ss-chatbot__send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ================================================================
   同意ブロック
================================================================ */
.ss-chatbot__consent {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ss-chatbot__consent-label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	cursor: pointer;
	font-size: 0.9rem;
	line-height: 1.5;
}

.ss-chatbot__consent-check {
	accent-color: #0073aa;
	width: 1rem;
	height: 1rem;
	margin-top: 2px;
	flex-shrink: 0;
}

.ss-chatbot__consent-label a {
	color: #0073aa;
	text-decoration: underline;
}

.ss-chatbot__submit-btn {
	padding: 12px 24px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	width: 100%;
	transition: background 0.15s;
}

.ss-chatbot__submit-btn:hover:not(:disabled) { background: #005d8c; }
.ss-chatbot__submit-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ================================================================
   エラー・バリデーション
================================================================ */
.ss-chatbot__input-error {
	margin: 6px 0 0;
	font-size: 0.82rem;
	color: #ef4444;
}

.ss-chatbot__error {
	padding: 10px 14px;
	background: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: 8px;
	color: #991b1b;
	font-size: 0.875rem;
	margin-bottom: 8px;
}

/* ================================================================
   レスポンシブ
================================================================ */
@media (max-width: 600px) {
	.ss-chatbot {
		margin: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.ss-chatbot__messages {
		max-height: 55dvh;
	}

	.ss-chatbot__message {
		max-width: 88%;
	}

	.ss-chatbot__quick-reply {
		font-size: 0.82rem;
		padding: 7px 12px;
	}
}
