/* =========================================
   MYARM AI チャットボット ウィジェット
   ========================================= */

/* トグルボタン */
.myarm-chat-toggle {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
	border: none;
	cursor: pointer;
	z-index: 9998;
	box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
	transition: transform 0.3s, box-shadow 0.3s;
	display: flex;
	align-items: center;
	justify-content: center;
}
.myarm-chat-toggle:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 30px rgba(59, 130, 246, 0.6);
}
.myarm-chat-toggle svg {
	width: 28px;
	height: 28px;
	fill: #fff;
	transition: transform 0.3s;
}
.myarm-chat-toggle.active svg {
	transform: rotate(90deg);
}

/* チャットウィンドウ */
.myarm-chat-window {
	position: fixed;
	bottom: 100px;
	right: 24px;
	width: 380px;
	height: 520px;
	background: #0f172a;
	border: 1px solid rgba(59, 130, 246, 0.2);
	border-radius: 20px;
	z-index: 9999;
	display: none;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(59, 130, 246, 0.1);
	font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
	animation: chatSlideUp 0.3s ease;
}
.myarm-chat-window.open {
	display: flex;
}

@keyframes chatSlideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ヘッダー */
.myarm-chat-header {
	padding: 18px 20px;
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	display: flex;
	align-items: center;
	gap: 12px;
}
.myarm-chat-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	flex-shrink: 0;
}
.myarm-chat-header-text {
	flex: 1;
}
.myarm-chat-header-title {
	color: #fff;
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1.3;
}
.myarm-chat-header-sub {
	color: #64748b;
	font-size: 0.75rem;
}
.myarm-chat-close {
	background: none;
	border: none;
	color: #64748b;
	cursor: pointer;
	font-size: 1.3rem;
	padding: 4px;
	line-height: 1;
	transition: color 0.2s;
}
.myarm-chat-close:hover {
	color: #fff;
}

/* メッセージエリア */
.myarm-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 20px 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.myarm-chat-messages::-webkit-scrollbar {
	width: 4px;
}
.myarm-chat-messages::-webkit-scrollbar-track {
	background: transparent;
}
.myarm-chat-messages::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 2px;
}

/* メッセージバブル */
.myarm-chat-msg {
	max-width: 85%;
	padding: 12px 16px;
	border-radius: 16px;
	font-size: 0.9rem;
	line-height: 1.6;
	word-break: break-word;
}
.myarm-chat-msg.bot {
	align-self: flex-start;
	background: rgba(30, 41, 59, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.06);
	color: #e2e8f0;
}
.myarm-chat-msg.user {
	align-self: flex-end;
	background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
	color: #fff;
}
.myarm-chat-msg.bot a {
	color: #60a5fa;
	text-decoration: underline;
}

/* タイピングインジケーター */
.myarm-chat-typing {
	align-self: flex-start;
	padding: 12px 20px;
	background: rgba(30, 41, 59, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 16px;
	display: none;
}
.myarm-chat-typing.show {
	display: flex;
	gap: 5px;
	align-items: center;
}
.myarm-chat-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #64748b;
	animation: typingDot 1.4s infinite;
}
.myarm-chat-typing span:nth-child(2) {
	animation-delay: 0.2s;
}
.myarm-chat-typing span:nth-child(3) {
	animation-delay: 0.4s;
}
@keyframes typingDot {
	0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
	30% { opacity: 1; transform: scale(1); }
}

/* 入力エリア */
.myarm-chat-input-area {
	padding: 14px 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	display: flex;
	gap: 10px;
	align-items: flex-end;
	background: rgba(15, 23, 42, 0.5);
}
.myarm-chat-input {
	flex: 1;
	padding: 12px 16px;
	background: rgba(30, 41, 59, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	color: #f1f5f9;
	font-size: 0.9rem;
	font-family: inherit;
	resize: none;
	max-height: 80px;
	line-height: 1.4;
	transition: border-color 0.3s;
}
.myarm-chat-input:focus {
	outline: none;
	border-color: #3B82F6;
}
.myarm-chat-input::placeholder {
	color: #4b5563;
}
.myarm-chat-send {
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: #3B82F6;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	flex-shrink: 0;
}
.myarm-chat-send:hover {
	background: #2563EB;
}
.myarm-chat-send:disabled {
	background: #1e293b;
	cursor: not-allowed;
}
.myarm-chat-send svg {
	width: 18px;
	height: 18px;
	fill: #fff;
}

/* レスポンシブ */
@media (max-width: 480px) {
	.myarm-chat-window {
		width: calc(100vw - 20px);
		height: calc(100vh - 140px);
		bottom: 90px;
		right: 10px;
		left: 10px;
		border-radius: 16px;
	}
	.myarm-chat-toggle {
		bottom: 16px;
		right: 16px;
		width: 54px;
		height: 54px;
	}
}
