/* CC-Personal Frontend Styles */

/* 表示切り替え用のアニメーション */
.cc-personal-conditional-element {
	transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	opacity: 1;
	transform: translateY(0);
}

.cc-personal-conditional-element.cc-personal-hidden {
	opacity: 0 !important;
	transform: translateY(15px) !important;
	pointer-events: none !important;
	display: none !important;
}

/* シミュレーター (管理者用デバッグUI) */
.cc-personal-simulator-trigger {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
	color: #ffffff;
	box-shadow: 0 10px 15px -3px rgba(124, 58, 237, 0.3), 0 4px 6px -4px rgba(124, 58, 237, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 999999;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	border: 2px solid rgba(255, 255, 255, 0.2);
}

.cc-personal-simulator-trigger:hover {
	transform: scale(1.08) rotate(15deg);
	box-shadow: 0 20px 25px -5px rgba(124, 58, 237, 0.4), 0 8px 10px -6px rgba(124, 58, 237, 0.4);
}

.cc-personal-simulator-trigger .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.cc-personal-simulator-panel {
	position: fixed;
	bottom: 92px;
	right: 24px;
	width: 320px;
	max-height: 80vh;
	background: #ffffff !important; /* 背面の透けを防ぐ純白のソリッド背景 */
	border: 1px solid #e2e8f0 !important;
	border-radius: 16px;
	box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
	z-index: 999998;
	color: #0f172a !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	overflow: hidden;
	display: none;
	flex-direction: column;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.cc-personal-simulator-panel.open {
	display: flex;
	opacity: 1;
	transform: translateY(0);
}

.cc-personal-sim-header {
	padding: 16px 20px;
	background: #f8fafc !important;
	border-bottom: 1px solid #e2e8f0 !important;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.cc-personal-sim-header h4 {
	margin: 0 !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	color: #0f172a !important;
	display: flex !important;
	align-items: center !important;
}

.cc-personal-sim-header h4 .dashicons {
	margin-right: 8px;
	color: #a78bfa;
}

.cc-personal-sim-close {
	cursor: pointer;
	color: #94a3b8;
	transition: color 0.2s ease;
}

.cc-personal-sim-close:hover {
	color: #ffffff;
}

.cc-personal-sim-content {
	padding: 20px;
	overflow-y: auto;
}

.cc-personal-sim-section {
	margin-bottom: 20px;
}

.cc-personal-sim-section h5 {
	margin: 0 0 10px 0 !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.05em !important;
	color: #475569 !important;
	border-left: 3px solid #7c3aed !important;
	padding-left: 8px !important;
}

/* スコアバー */
.cc-personal-score-item {
	margin-bottom: 12px;
}

.cc-personal-score-label {
	display: flex !important;
	justify-content: space-between !important;
	font-size: 13px !important;
	margin-bottom: 4px !important;
	color: #1e293b !important;
	font-weight: 600 !important;
}

.cc-personal-score-bar-bg {
	height: 6px;
	background: #e2e8f0 !important;
	border-radius: 3px !important;
	overflow: hidden !important;
}

.cc-personal-score-bar-fill {
	height: 100% !important;
	width: 0%;
	background: linear-gradient(90deg, #6366f1, #8b5cf6) !important;
	border-radius: 3px !important;
	transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.cc-personal-score-item.active .cc-personal-score-bar-fill {
	background: linear-gradient(90deg, #10b981, #34d399) !important; /* アクティブ時はグリーン */
}

/* クイック切替ボタン */
.cc-personal-quick-btns {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.cc-personal-sim-btn {
	background: #f1f5f9 !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	color: #334155 !important;
	padding: 8px 12px !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	text-align: center !important;
	transition: all 0.2s ease !important;
}

.cc-personal-sim-btn:hover {
	background: #e2e8f0 !important;
	border-color: #94a3b8 !important;
	color: #0f172a !important;
}

.cc-personal-sim-btn.active {
	background: #4f46e5 !important;
	border-color: #4f46e5 !important;
	color: #ffffff !important;
	font-weight: 700 !important;
}

/* ログ表示 */
.cc-personal-sim-logs {
	background: #f8fafc !important;
	border-radius: 8px !important;
	padding: 12px !important;
	font-family: monospace !important;
	font-size: 11px !important;
	color: #0f172a !important;
	max-height: 120px !important;
	overflow-y: auto !important;
	border: 1px solid #e2e8f0 !important;
}

.cc-personal-sim-log-entry {
	margin-bottom: 4px;
	line-height: 1.4;
}

.cc-personal-sim-log-time {
	color: #64748b;
	margin-right: 6px;
}

/* ==========================================
   センサー枠可視化 & デバッグ用ハイライト
========================================== */
.cc-personal-sensor-visualizer {
	position: fixed;
	left: 0;
	right: 0;
	border-top: 3px dashed #B8422E; /* Boston Clayに変更し、太さを3pxにして強調 */
	border-bottom: 3px dashed #B8422E;
	background: rgba(184, 66, 46, 0.05); /* 極薄のBoston Clay背景 */
	pointer-events: none;
	z-index: 999990;
	display: none;
	align-items: center;
	justify-content: center;
	box-shadow: inset 0 0 40px rgba(184, 66, 46, 0.04);
}

/* スマホ判定領域 (中央15%) */
@media (max-width: 767px) {
	.cc-personal-sensor-visualizer {
		top: 42.5%;
		bottom: 42.5%;
		height: 15%;
	}
}

/* PC判定領域 (中央40%) */
@media (min-width: 768px) {
	.cc-personal-sensor-visualizer {
		top: 30%;
		bottom: 30%;
		height: 40%;
	}
}

.cc-personal-sensor-visualizer.visible {
	display: flex;
	animation: ccPersonalFadeIn 0.3s ease;
}

.cc-personal-sensor-label {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	background: #B8422E; /* Boston Clay に統一 */
	color: #ffffff;
	padding: 5px 12px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	box-shadow: 0 2px 8px rgba(184, 66, 46, 0.3);
}

/* センサー検知時のデバッグ用ハイライトスタイル */
.cc-personal-focused {
	outline: 2px solid rgba(16, 185, 129, 0.6) !important;
	outline-offset: 4px;
	transition: outline 0.2s ease;
}

.cc-personal-stayed {
	outline: 2px solid rgba(59, 130, 246, 0.4) !important;
	outline-offset: 4px;
}

@keyframes ccPersonalFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ==========================================
   自己選択セルフプロファイリングUI (ショートコード等)
========================================== */
.personalizer-self-selector-wrap {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	max-width: 480px;
}

.personalizer-self-selector-wrap .selector-title {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 16px 0;
	line-height: 1.4;
}

select.personalizer-selector {
	width: 100%;
	height: 46px;
	padding: 10px 16px;
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	color: #334155;
	background-color: #ffffff;
	cursor: pointer;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select.personalizer-selector:focus {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.selector-checkboxes {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.selector-checkbox-label {
	display: flex;
	align-items: center;
	font-size: 14.5px;
	color: #334155;
	cursor: pointer;
	user-select: none;
	gap: 8px;
}

.selector-checkbox-label input[type="checkbox"] {
	width: 18px;
	height: 18px;
	border: 1.5px solid #cbd5e1;
	border-radius: 4px;
	cursor: pointer;
	outline: none;
}

/* ==========================================
   自己診断マルチステップアンケート ([personalizer_quiz])
========================================== */
.personalizer-quiz-container {
	background: #ffffff !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 12px !important; /* より引き締まった角丸 */
	padding: 32px 40px !important; /* ゆったりとしたインナー余白 */
	margin: 24px auto !important;
	box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.06) !important; /* 非常に淡く高級感のある影 */
	max-width: 480px !important; /* 少し幅を狭めてスマートに */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif !important;
}

.personalizer-quiz-main-title {
	font-size: 16px !important; /* 小さめで品のある文字サイズ */
	font-weight: 500 !important; /* 太すぎないウェイト */
	color: #0f172a !important;
	margin: 0 0 24px 0 !important;
	text-align: center !important;
	line-height: 1.6 !important;
	letter-spacing: 0.08em !important; /* 文字間を広げて上品に */
}

.personalizer-quiz-progress-bar {
	height: 2px !important; /* 極細にして主張を抑える */
	background: #f1f5f9 !important;
	border-radius: 1px !important;
	overflow: hidden !important;
	margin-bottom: 28px !important;
}

.personalizer-quiz-progress-fill {
	height: 100% !important;
	background: #6366f1 !important; /* ソリッドで上品なバイオレット */
	border-radius: 1px !important;
	transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.personalizer-quiz-steps-wrapper {
	position: relative !important;
	min-height: auto !important;
}

.personalizer-quiz-step-slide {
	display: none;
	animation: ccPersonalFadeIn 0.3s ease;
}

.personalizer-quiz-step-slide.active {
	display: block;
}

.quiz-question-title {
	font-size: 15px !important;
	font-weight: 600 !important;
	color: #334155 !important;
	margin: 0 0 16px 0 !important;
	line-height: 1.5 !important;
	letter-spacing: 0.02em !important;
}

.quiz-input-wrapper {
	margin-bottom: 28px !important;
}

select.personalizer-quiz-input {
	width: 100% !important;
	height: 44px !important; /* 高さを抑えてスッキリ */
	padding: 0 16px !important;
	border: 1px solid #cbd5e1 !important; /* 細いグレーの線 */
	border-radius: 6px !important;
	font-size: 14px !important;
	color: #475569 !important;
	background-color: #ffffff !important;
	cursor: pointer !important;
	outline: none !important;
	transition: all 0.2s ease !important;
	box-shadow: none !important;
	-webkit-appearance: none; /* デフォルトの矢印をリセットしてシンプルにする */
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") !important; /* 上品なカスタム下矢印 */
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	background-size: 18px !important;
}

select.personalizer-quiz-input:focus {
	border-color: #94a3b8 !important; /* 青紫に光らせず、大人のアッシュグレーに */
	background-color: #f8fafc !important;
}

select.personalizer-quiz-input[multiple] {
	padding: 8px 12px !important;
	font-size: 13.5px !important;
	background-image: none !important; /* 複数選択時は下矢印不要 */
}

.quiz-multiselect-tip {
	font-size: 11px !important;
	color: #94a3b8 !important;
	margin: 6px 0 0 0 !important;
	letter-spacing: 0.02em !important;
}

.quiz-checkbox-group {
	display: flex !important;
	flex-direction: column !important;
	gap: 8px !important;
}

.quiz-checkbox-label {
	display: flex !important;
	align-items: center !important;
	background: #ffffff !important; /* カード背景ではなく、枠線だけのシンプルな白背景 */
	border: 1px solid #e2e8f0 !important;
	border-radius: 6px !important;
	padding: 10px 16px !important;
	font-size: 13.5px !important;
	color: #475569 !important;
	cursor: pointer !important;
	user-select: none !important;
	transition: all 0.2s ease !important;
	gap: 10px !important;
}

.quiz-checkbox-label:hover {
	background: #f8fafc !important;
	border-color: #cbd5e1 !important;
	color: #0f172a !important;
}

.quiz-checkbox-label input[type="checkbox"] {
	width: 16px !important;
	height: 16px !important;
	margin: 0 !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 3px !important;
	cursor: pointer !important;
}

.quiz-nav-buttons {
	display: flex !important;
	justify-content: space-between !important;
	gap: 12px !important;
	margin-top: 24px !important;
	border-top: 1px solid #f1f5f9 !important; /* より淡い境界線 */
	padding-top: 20px !important;
}

.quiz-prev-btn, .quiz-next-btn, .quiz-submit-btn {
	height: 38px !important; /* コンパクトな高さ */
	padding: 0 18px !important;
	border-radius: 6px !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	cursor: pointer !important;
	transition: all 0.25s ease !important;
	outline: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	letter-spacing: 0.05em !important;
}

.quiz-prev-btn {
	background: #ffffff !important;
	border: 1px solid #cbd5e1 !important;
	color: #64748b !important;
}

.quiz-prev-btn:hover {
	background: #f8fafc !important;
	border-color: #94a3b8 !important;
	color: #334155 !important;
}

/* 活性化時の「次へ」「送信」はシンプルで落ち着いたインディゴブルー */
.quiz-next-btn, .quiz-submit-btn {
	background: #4f46e5 !important;
	border: 1px solid #4f46e5 !important;
	color: #ffffff !important;
	flex: 1 !important;
}

.quiz-next-btn:hover, .quiz-submit-btn:hover {
	background: #4338ca !important;
	border-color: #4338ca !important;
}

/* 非活性時は上品なアウトライン形式で、ベタ塗りさせない */
.quiz-next-btn:disabled, .quiz-submit-btn:disabled {
	background: transparent !important;
	border: 1px solid #e2e8f0 !important;
	color: #cbd5e1 !important;
	cursor: not-allowed !important;
}

/* 診断中ローディングオーバーレイ */
.personalizer-quiz-loading-overlay {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 10px;
	animation: ccPersonalFadeIn 0.3s ease;
}

.personalizer-quiz-spinner {
	width: 32px;
	height: 32px;
	border: 2px solid #f1f5f9;
	border-top-color: #6366f1;
	border-radius: 50%;
	animation: ccPersonalSpinner 0.8s linear infinite;
	margin-bottom: 16px;
}

.personalizer-quiz-loading-text {
	font-size: 13.5px;
	color: #64748b;
	margin: 0;
	letter-spacing: 0.05em;
}

/* 画面全体の光の波紋（ゴールド） */
.cc-personal-ripple-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none; /* クリック等を妨げない */
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cc-personal-ripple-ring {
	width: 10px;
	height: 10px;
	border: 3px solid rgba(245, 158, 11, 0.4); /* ゴールドの枠線 */
	border-radius: 50%;
	animation: ccPersonalRipple 1.0s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
	box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

/* 新しく出現するコンテンツへのゴールド光彩ズームイン効果 */
.cc-personal-reveal-effect {
	animation: ccPersonalReveal 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

/* 各種キーフレームアニメーション */
@keyframes ccPersonalSpinner {
	to { transform: rotate(360deg); }
}

@keyframes ccPersonalRipple {
	0% {
		width: 0px;
		height: 0px;
		opacity: 1;
		border-width: 8px;
	}
	100% {
		width: 150vmax;
		height: 150vmax;
		opacity: 0;
		border-width: 1px;
	}
}

@keyframes ccPersonalReveal {
	0% {
		opacity: 0;
		transform: scale(0.97) translateY(5px);
		box-shadow: 0 0 0px rgba(245, 158, 11, 0);
	}
	20% {
		box-shadow: 0 0 35px rgba(245, 158, 11, 0.3);
	}
	100% {
		opacity: 1;
		transform: scale(1) translateY(0);
		box-shadow: 0 0 0px rgba(245, 158, 11, 0);
	}
}

/* Apple Vision Pro風の3D空間スキャンエフェクト (v2.6.0) */
.cc-personal-scan-overlay {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	z-index: 9999999 !important;
	background: rgba(15, 23, 42, 0.2) !important; /* スレート背景を極薄で重ねる */
	backdrop-filter: blur(4px) saturate(120%) !important; /* ほどよいブラーと色彩補正 */
	pointer-events: none !important;
	overflow: hidden !important;
}

.cc-personal-scan-line {
	position: fixed !important;
	top: 0 !important; /* top移動を排し、transform: translateYのみで動かす */
	left: -10% !important;
	width: 120% !important;
	height: 8px !important;
	z-index: 99999999 !important;
	/* 上品な象牙ゴールド＆ホワイトのシンプルなグラデーション */
	background: linear-gradient(90deg, 
		rgba(255, 255, 255, 0) 0%, 
		rgba(255, 255, 255, 0.95) 20%, 
		rgba(255, 235, 150, 1) 50%, 
		rgba(255, 255, 255, 0.95) 80%, 
		rgba(255, 255, 255, 0) 100%
	) !important;
	box-shadow: 
		0 0 25px 8px rgba(212, 175, 55, 0.95), 
		0 0 50px 18px rgba(212, 175, 55, 0.65), 
		0 0 90px 30px rgba(255, 255, 255, 0.45) !important;
	opacity: 0;
	transform: translateY(-15vh) !important;
	pointer-events: none !important;
}

/* 降下(translateY)と揺れ(skew)を単一のアニメーションに完全統合して競合を防ぐ (v3.4.0) */
.cc-personal-scan-line.active {
	animation: ccPersonalScanner 2.2s cubic-bezier(0.25, 1, 0.3, 1) forwards !important;
}

.cc-personal-scan-grid {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 99999998 !important;
	/* マス目を目立たなくし、ラインを引き立たせるため不透明度をさらに低く (0.04) */
	background-image: 
		linear-gradient(rgba(212, 175, 55, 0.04) 1.5px, transparent 1.5px),
		linear-gradient(90deg, rgba(212, 175, 55, 0.04) 1.5px, transparent 1.5px) !important;
	background-size: 60px 60px !important;
	background-position: center !important;
	opacity: 0;
	pointer-events: none !important;
}

.cc-personal-scan-grid.active {
	animation: ccPersonalGridFade 2.2s cubic-bezier(0.25, 1, 0.3, 1) forwards !important;
}

/* 診断完了直前の、画面全体が「ふわっと明るくなる」発光エフェクト (v3.1.0) */
.cc-personal-flash-overlay {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	z-index: 999999999 !important;
	background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,248,220,1) 100%) !important;
	opacity: 0 !important;
	pointer-events: none !important;
	animation: ccPersonalFlash 1.0s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

/* 1つの transform に統合することで、降下と波打ちの競合による静止バグを100%解決 */
@keyframes ccPersonalScanner {
	0% {
		transform: translateY(-15vh) scaleY(1);
		opacity: 0;
	}
	10% {
		opacity: 1;
	}
	25% {
		transform: translateY(20vh) scaleY(1.2) skewX(2deg);
	}
	50% {
		transform: translateY(50vh) scaleY(0.85) skewX(-2deg);
		opacity: 1;
	}
	75% {
		transform: translateY(80vh) scaleY(1.1) skewX(1deg);
	}
	90% {
		opacity: 1;
	}
	100% {
		transform: translateY(115vh) scaleY(1);
		opacity: 0;
	}
}

@keyframes ccPersonalGridFade {
	0% { opacity: 0; transform: scale(1.03); }
	15% { opacity: 1; transform: scale(1); }
	80% { opacity: 1; transform: scale(1); }
	100% { opacity: 0; transform: scale(0.99); }
}

@keyframes ccPersonalFlash {
	0% { opacity: 0; }
	35% { opacity: 0.95; }
	100% { opacity: 0; }
}
