/* assets/css/components/taxonomy-chips.css
 * 4つのタクソノミー（行為・見た目・シチュ・特集）共通チップ用CSS
 * ボトムシートモーダル付き
 */

/* ====== コンテナ ====== */
.kc-taxonomy-chips {
	width: 100%;
}

.kc-taxonomy-chips__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.kc-taxonomy-chips__header-title {
	font-size: 18px;
	font-weight: 600;
	color: #111;
	margin: 0;
}

.kc-taxonomy-chips__see-all {
	font-size: 14px;
	color: #db2777;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.2s ease;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
}

.kc-taxonomy-chips__see-all:hover {
	color: #be185d;
}

/* ====== ボトムシートモーダル専用トリガーボタン ====== */
.kc-taxonomy-chips-modal-trigger {
	margin-bottom: 16px;
}

.kc-taxonomy-chips-modal-trigger .kc-taxonomy-chips__see-all {
	font-size: 14px;
	color: #db2777;
	font-weight: 500;
	text-decoration: none;
	transition: color 0.2s ease;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
}

.kc-taxonomy-chips-modal-trigger .kc-taxonomy-chips__see-all:hover {
	color: #be185d;
}

.kc-taxonomy-chips__section {
	margin-bottom: 32px;
}

.kc-taxonomy-chips__section:last-child {
	margin-bottom: 0;
}

/* ====== セクションタイトル ====== */
.kc-taxonomy-chips__section-title {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 16px;
	color: #111;
	line-height: 1.4;
}

.kc-taxonomy-chips__count {
	font-size: 14px;
	font-weight: 400;
	color: #666;
	margin-left: 8px;
}

/* ====== チップリスト ====== */
.kc-taxonomy-chips__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.kc-taxonomy-chips__empty {
	color: #999;
	font-size: 14px;
	margin: 0;
}

/* ====== チップ（Pill）スタイル ====== */
.kc-tax-chip {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 16px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 150px;
	transition: all 0.2s ease;
	cursor: pointer;
	border: 1px solid;
	text-decoration: none;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	color: var(--kc-tax-color, #ec4899);
}

.kc-tax-chip:focus {
	outline: 2px solid rgba(236, 72, 153, 0.6);
	outline-offset: 2px;
}

@supports (outline-color: color-mix(in srgb, red 60%, transparent)) {
	.kc-tax-chip:focus {
		outline-color: color-mix(in srgb, var(--kc-tax-color) 60%, transparent);
	}
}

.kc-tax-chip:hover {
	box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

.kc-tax-chip:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* ====== タクソノミー別の色（フォールバック用） ====== */
.kc-tax-chip--kc_play {
	--kc-tax-color: #ec4899;
	background: rgba(236, 72, 153, 0.2) !important;
	color: #ec4899 !important;
	border-color: rgba(236, 72, 153, 0.4) !important;
}

.kc-tax-chip--kc_play:hover {
	background: rgba(236, 72, 153, 0.3) !important;
	border-color: rgba(236, 72, 153, 0.6) !important;
}

.kc-tax-chip--kc_look {
	--kc-tax-color: #8b5cf6;
	background: rgba(139, 92, 246, 0.2) !important;
	color: #8b5cf6 !important;
	border-color: rgba(139, 92, 246, 0.4) !important;
}

.kc-tax-chip--kc_look:hover {
	background: rgba(139, 92, 246, 0.3) !important;
	border-color: rgba(139, 92, 246, 0.6) !important;
}

.kc-tax-chip--kc_scenario {
	--kc-tax-color: #06b6d4;
	background: rgba(6, 182, 212, 0.2) !important;
	color: #06b6d4 !important;
	border-color: rgba(6, 182, 212, 0.4) !important;
}

.kc-tax-chip--kc_scenario:hover {
	background: rgba(6, 182, 212, 0.3) !important;
	border-color: rgba(6, 182, 212, 0.6) !important;
}

.kc-tax-chip--kc_feature {
	--kc-tax-color: #f59e0b;
	background: rgba(245, 158, 11, 0.2) !important;
	color: #f59e0b !important;
	border-color: rgba(245, 158, 11, 0.4) !important;
}

.kc-tax-chip--kc_feature:hover {
	background: rgba(245, 158, 11, 0.3) !important;
	border-color: rgba(245, 158, 11, 0.6) !important;
}

/* color-mix対応ブラウザでは、フォールバックを上書き */
@supports (background: color-mix(in srgb, red 20%, transparent)) {
	.kc-tax-chip--kc_play,
	.kc-tax-chip--kc_look,
	.kc-tax-chip--kc_scenario,
	.kc-tax-chip--kc_feature {
		background: color-mix(in srgb, var(--kc-tax-color) 20%, transparent) !important;
		border-color: color-mix(in srgb, var(--kc-tax-color) 40%, transparent) !important;
	}

	.kc-tax-chip--kc_play:hover,
	.kc-tax-chip--kc_look:hover,
	.kc-tax-chip--kc_scenario:hover,
	.kc-tax-chip--kc_feature:hover {
		background: color-mix(in srgb, var(--kc-tax-color) 30%, transparent) !important;
		border-color: color-mix(in srgb, var(--kc-tax-color) 60%, transparent) !important;
	}
}

/* ====== ボトムシートモーダル ====== */
.kc-chip-modal {
	position: fixed;
	inset: 0;
	z-index: 99997;
	display: none;
}

/* プレビューモーダル内のボトムシートモーダル（より高いz-index） */
#kc-chip-modal-preview {
	z-index: 100000;
}

.kc-chip-modal.is-open {
	display: block;
}

.kc-chip-modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	animation: kc-chip-modal-fade-in 0.3s ease;
}

.kc-chip-modal__content {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 75vh;
	max-height: 75vh;
	background: linear-gradient(135deg, #fff 0%, #fff5f8 50%, #ffeef2 100%);
	border-radius: 16px 16px 0 0;
	border-top: 2px solid rgba(226, 0, 79, 0.2);
	box-shadow: 0 10px 40px rgba(226, 0, 79, 0.15), 0 0 0 1px rgba(226, 0, 79, 0.1);
	display: flex;
	flex-direction: column;
	animation: kc-chip-modal-slide-up 0.5s ease;
}

.kc-chip-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px 24px 20px;
	border-bottom: 1px solid rgba(226, 0, 79, 0.15);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 245, 248, 0.8) 100%);
	flex-shrink: 0;
}

.kc-chip-modal__header-title {
	font-size: 20px;
	font-weight: 700;
	color: rgba(0, 0, 0, 0.85);
	margin: 0;
}

.kc-chip-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: rgba(0, 0, 0, 0.65);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: 0.15s ease;
	padding: 0;
}

.kc-chip-modal__close:hover {
	background: rgba(0, 0, 0, 0.05);
	color: rgba(0, 0, 0, 0.85);
}

.kc-chip-modal__close-icon {
	width: 20px;
	height: 20px;
	stroke: currentColor;
}

.kc-chip-modal__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* ====== タブ ====== */
.kc-chip-tabs {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.kc-chip-tabs__list {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 8px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
	background: rgba(255, 255, 255, 0.5);
	flex-shrink: 0;
	overflow-x: visible;
}

.kc-chip-tabs__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	min-width: 0;
	padding: 8px 4px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 12px;
	color: rgba(0, 0, 0, 0.65);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: 0.15s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kc-chip-tabs__trigger:hover {
	background: rgba(0, 0, 0, 0.04);
	color: rgba(0, 0, 0, 0.85);
}

.kc-chip-tabs__trigger.is-active {
	background: rgba(0, 0, 0, 0.08);
	color: rgba(0, 0, 0, 0.85);
	font-weight: 700;
}

.kc-chip-tabs__content {
	flex: 1 1 auto;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 24px;
	min-height: 0;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: rgba(226, 0, 79, 0.3) transparent;
}

.kc-chip-tabs__content::-webkit-scrollbar {
	width: 8px;
}

.kc-chip-tabs__content::-webkit-scrollbar-track {
	background: transparent;
}

.kc-chip-tabs__content::-webkit-scrollbar-thumb {
	background: rgba(226, 0, 79, 0.3);
	border-radius: 4px;
}

.kc-chip-tabs__content::-webkit-scrollbar-thumb:hover {
	background: rgba(226, 0, 79, 0.5);
}

.kc-chip-tabs__content.is-hidden {
	display: none;
}

/* ====== アニメーション ====== */
@keyframes kc-chip-modal-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes kc-chip-modal-slide-up {
	from {
		transform: translateY(100%);
	}
	to {
		transform: translateY(0);
	}
}

/* ====== モバイル対応 ====== */
@media (max-width: 689.98px) {
	.kc-tax-chip {
		height: 32px;
		padding: 0 12px;
		font-size: 13px;
		max-width: 120px;
	}

	.kc-taxonomy-chips__section-title {
		font-size: 16px;
	}

	.kc-taxonomy-chips__section {
		margin-bottom: 24px;
	}

	.kc-chip-modal__content {
		height: 80vh;
	}

	.kc-chip-modal__header {
		padding: 20px 20px 16px;
	}

	.kc-chip-modal__header-title {
		font-size: 18px;
	}

	.kc-chip-modal__close {
		top: 10px;
		right: 10px;
		width: 32px;
		height: 32px;
	}

	.kc-chip-tabs__list {
		padding: 10px 4px;
		gap: 2px;
	}

	.kc-chip-tabs__trigger {
		padding: 6px 2px;
		font-size: 10px;
	}

	.kc-chip-tabs__content {
		padding: 16px;
	}
}

/* さらに小さな画面 */
@media (max-width: 480px) {
	.kc-chip-tabs__trigger {
		padding: 6px 1px;
		font-size: 9px;
		letter-spacing: -0.02em;
	}
}
