/**
 * Cookie Consent Banner Styles
 * Theme: Monster Ball Colors
 * - Red: #FF0000 / #CC0000
 * - White: #FFFFFF
 * - Black: #222222
 *
 * @package CookieConsentBanner
 */

:root {
	--cookie-red: #ff0000;
	--cookie-red-dark: #cc0000;
	--cookie-white: #ffffff;
	--cookie-black: #222222;
	--cookie-shadow: rgba(0, 0, 0, 0.15);
}

/* バナー本体 - 画面上部固定 */
.cookie-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 999999;
	background: var(--cookie-white);
	border-bottom: 3px solid var(--cookie-black);
	box-shadow: 0 2px 8px var(--cookie-shadow);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
}

.cookie-banner *,
.cookie-banner *::before,
.cookie-banner *::after {
	box-sizing: border-box;
}

/* コンテナ - 最低限の余白 */
.cookie-banner__container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 10px 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

/* テキストエリア */
.cookie-banner__content {
	flex: 1 1 auto;
	min-width: 280px;
}

.cookie-banner__text {
	margin: 0;
	color: var(--cookie-black);
	font-size: 13px;
}

/* 詳細リンクボタン（バナー内） */
.cookie-banner__link-btn {
	background: none;
	border: none;
	color: var(--cookie-red);
	text-decoration: underline;
	cursor: pointer;
	font-size: inherit;
	font-family: inherit;
	padding: 0;
	margin-left: 4px;
	transition: color 0.2s ease;
}

.cookie-banner__link-btn:hover,
.cookie-banner__link-btn:focus {
	color: var(--cookie-red-dark);
}

/* ボタンエリア */
.cookie-banner__actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* ボタン共通スタイル - GDPR要件: 同じサイズ・スタイル */
.cookie-banner__btn {
	padding: 8px 20px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
	min-width: 90px;
	text-align: center;
	border: 2px solid var(--cookie-black);
	font-family: inherit;
	line-height: 1.4;
}

/* 拒否ボタン - 白背景 */
.cookie-banner__btn--reject {
	background: var(--cookie-white);
	color: var(--cookie-black);
}

.cookie-banner__btn--reject:hover,
.cookie-banner__btn--reject:focus {
	background: #f5f5f5;
}

/* 承諾ボタン - 赤背景 */
.cookie-banner__btn--accept {
	background: var(--cookie-red);
	color: var(--cookie-white);
	border-color: var(--cookie-red);
}

.cookie-banner__btn--accept:hover,
.cookie-banner__btn--accept:focus {
	background: var(--cookie-red-dark);
	border-color: var(--cookie-red-dark);
}

/* フォーカス時のアウトライン（アクセシビリティ） */
.cookie-banner__btn:focus {
	outline: 3px solid var(--cookie-black);
	outline-offset: 2px;
}

.cookie-banner__btn:focus:not(:focus-visible) {
	outline: none;
}

.cookie-banner__btn:focus-visible {
	outline: 3px solid var(--cookie-black);
	outline-offset: 2px;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
	.cookie-banner__container {
		flex-direction: column;
		text-align: center;
		padding: 12px 16px;
	}

	.cookie-banner__content {
		min-width: 100%;
	}

	.cookie-banner__actions {
		width: 100%;
		justify-content: center;
	}

	.cookie-banner__btn {
		flex: 1;
		max-width: 140px;
	}
}

/* アニメーション */
.cookie-banner[data-state="entering"] {
	animation: cookieBannerSlideDown 0.3s ease-out forwards;
}

.cookie-banner[data-state="leaving"] {
	animation: cookieBannerSlideUp 0.3s ease-in forwards;
}

@keyframes cookieBannerSlideDown {
	from {
		transform: translateY(-100%);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes cookieBannerSlideUp {
	from {
		transform: translateY(0);
		opacity: 1;
	}
	to {
		transform: translateY(-100%);
		opacity: 0;
	}
}

/* 非表示状態 */
.cookie-banner[hidden] {
	display: none !important;
}

/* ===================================
   モーダル
   =================================== */

.cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cookie-modal[hidden] {
	display: none !important;
}

.cookie-modal *,
.cookie-modal *::before,
.cookie-modal *::after {
	box-sizing: border-box;
}

/* オーバーレイ */
.cookie-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

/* モーダルコンテンツ */
.cookie-modal__content {
	position: relative;
	background: var(--cookie-white);
	border-radius: 8px;
	box-shadow: 0 4px 20px var(--cookie-shadow);
	max-width: 600px;
	width: 90%;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	border: 3px solid var(--cookie-black);
}

/* モーダルヘッダー（モンスターボール赤） */
.cookie-modal__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	background: var(--cookie-red);
	border-radius: 5px 5px 0 0;
	border-bottom: 3px solid var(--cookie-black);
}

.cookie-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--cookie-white);
}

.cookie-modal__close-btn {
	background: var(--cookie-white);
	border: 2px solid var(--cookie-black);
	border-radius: 50%;
	width: 32px;
	height: 32px;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: var(--cookie-black);
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.cookie-modal__close-btn:hover,
.cookie-modal__close-btn:focus {
	background: #f5f5f5;
}

/* モーダル本文（白背景） */
.cookie-modal__body {
	padding: 20px;
	overflow-y: auto;
	flex: 1;
	font-size: 14px;
	line-height: 1.7;
	color: var(--cookie-black);
	background: var(--cookie-white);
}

.cookie-modal__body h2,
.cookie-modal__body h3,
.cookie-modal__body h4 {
	margin-top: 1.5em;
	margin-bottom: 0.5em;
	color: var(--cookie-black);
}

.cookie-modal__body h2:first-child,
.cookie-modal__body h3:first-child,
.cookie-modal__body h4:first-child {
	margin-top: 0;
}

.cookie-modal__body p {
	margin: 0 0 1em;
}

.cookie-modal__body ul,
.cookie-modal__body ol {
	margin: 0 0 1em;
	padding-left: 1.5em;
}

/* モーダルフッター（ボタンエリア） */
.cookie-modal__footer {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 20px;
	background: #f5f5f5;
	border-top: 1px solid #ddd;
	border-radius: 0 0 5px 5px;
}

/* モーダルアニメーション */
.cookie-modal[data-state="entering"] {
	animation: cookieModalFadeIn 0.3s ease-out forwards;
}

.cookie-modal[data-state="entering"] .cookie-modal__content {
	animation: cookieModalSlideIn 0.3s ease-out forwards;
}

.cookie-modal[data-state="leaving"] {
	animation: cookieModalFadeOut 0.2s ease-in forwards;
}

.cookie-modal[data-state="leaving"] .cookie-modal__content {
	animation: cookieModalSlideOut 0.2s ease-in forwards;
}

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

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

@keyframes cookieModalSlideIn {
	from {
		transform: scale(0.9) translateY(-20px);
		opacity: 0;
	}
	to {
		transform: scale(1) translateY(0);
		opacity: 1;
	}
}

@keyframes cookieModalSlideOut {
	from {
		transform: scale(1) translateY(0);
		opacity: 1;
	}
	to {
		transform: scale(0.9) translateY(-20px);
		opacity: 0;
	}
}

/* モーダル レスポンシブ対応 */
@media (max-width: 600px) {
	.cookie-modal__content {
		width: 95%;
		max-height: 90vh;
		margin: 10px;
	}

	.cookie-modal__header {
		padding: 12px 16px;
	}

	.cookie-modal__title {
		font-size: 16px;
	}

	.cookie-modal__body {
		padding: 16px;
		font-size: 13px;
	}

	.cookie-modal__footer {
		padding: 12px 16px;
		flex-direction: column;
	}

	.cookie-modal__footer .cookie-banner__btn {
		width: 100%;
		max-width: none;
	}
}
