/**
 * Toggle de modo claro/escuro (localStorage: site-color-mode).
 * Botão no header + overrides de paleta por template.
 */

.color-mode-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	padding: 0;
	border: 1px solid var(--theme-header-border-color, rgba(255, 255, 255, 0.12));
	border-radius: 12px;
	background: var(--theme-input-background, rgba(255, 255, 255, 0.04));
	color: var(--theme-header-text-color, #e8eaf2);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	position: relative;
	z-index: 2;
}

.color-mode-toggle:hover {
	filter: brightness(1.08);
	border-color: color-mix(in srgb, var(--theme-primary-color, #7aa8ff) 45%, var(--theme-header-border-color, #fff));
}

.color-mode-toggle:active {
	transform: scale(0.98);
}

.color-mode-toggle:focus-visible {
	outline: 2px solid var(--theme-primary-color, #7aa8ff);
	outline-offset: 2px;
}

.color-mode-toggle__icon {
	font-size: 1rem;
	line-height: 1;
}

.color-mode-toggle__icon--light,
.color-mode-toggle__icon--dark {
	display: none;
}

html[data-color-mode="dark"] .color-mode-toggle__icon--light,
html:not([data-color-mode]) .color-mode-toggle__icon--light {
	display: inline-block;
}

html[data-color-mode="light"] .color-mode-toggle__icon--dark {
	display: inline-block;
}

/* Cyan / PokeReal — modo claro */
html[data-color-mode="light"] body.theme-body:not(.theme-body--vocation-potter) {
	--theme-primary-color: #007f9a;
	--theme-secondary-color: #00a8c8;
	--theme-accent-color: #22b8d8;
	--theme-background-color: #ecf0f1;
	--theme-surface-color: rgba(255, 255, 255, 0.97);
	--theme-text-color: #1a2a3a;
	--theme-muted-text-color: #5c6b7a;
	--theme-heading-color: #0a2540;
	--theme-border-color: rgba(10, 37, 64, 0.14);
	--theme-input-background: #f8fafb;
	--theme-input-text-color: #1a2a3a;
	--theme-input-border-color: #b8c8d8;
	--theme-input-placeholder-color: #7a8a9a;
	--theme-button-primary-background: #00b8d4;
	--theme-button-primary-text: #0a2540;
	--theme-button-secondary-background: #e8f4ff;
	--theme-button-secondary-text: #0a2540;
	--theme-ranking-header-background: #0a2540;
	--theme-ranking-header-text: #ffffff;
	--theme-table-row-background: rgba(255, 255, 255, 0.9);
	--theme-table-row-alt-background: rgba(0, 184, 212, 0.08);
	--theme-link-color: #007f9a;
	--theme-link-hover-color: #00a8c8;
	--theme-page-background: linear-gradient(180deg, #f0f6fb 0%, #e2edf7 48%, #d5e4f0 100%);
	--theme-content-shell-background: rgba(255, 255, 255, 0.97);
	--theme-header-background: linear-gradient(90deg, #ffffff 0%, #eef6fc 100%);
	--theme-header-text-color: #0a2540;
	--theme-header-border-color: rgba(10, 37, 64, 0.12);
	--theme-footer-background: #0a2540;
	--theme-footer-text-color: #cbd5e1;
	--theme-footer-heading-color: #67e8f9;
	--theme-footer-muted-color: #94a3b8;
	color-scheme: light;
}

/* Potter / Bruxo RPG — modo claro */
html[data-color-mode="light"] body.theme-body--vocation-potter {
	--theme-primary-color: #740001;
	--theme-secondary-color: #8b6914;
	--theme-accent-color: #b8860b;
	--theme-background-color: #f5f0e6;
	--theme-surface-color: rgba(255, 252, 245, 0.96);
	--theme-text-color: #2c2416;
	--theme-muted-text-color: #5c5346;
	--theme-heading-color: #5a0000;
	--theme-border-color: rgba(139, 105, 20, 0.35);
	--theme-input-background: #fffdf8;
	--theme-input-text-color: #2c2416;
	--theme-input-border-color: rgba(139, 105, 20, 0.4);
	--theme-input-placeholder-color: #8a8070;
	--theme-button-primary-background: #740001;
	--theme-button-primary-text: #ffffff;
	--theme-button-secondary-background: rgba(245, 240, 230, 0.95);
	--theme-button-secondary-text: #5a0000;
	--theme-ranking-header-background: linear-gradient(to bottom, #f8f2e4, #e8dfd0);
	--theme-ranking-header-text: #5a0000;
	--theme-table-row-background: rgba(255, 255, 255, 0.85);
	--theme-table-row-alt-background: rgba(139, 105, 20, 0.08);
	--theme-link-color: #5a0000;
	--theme-link-hover-color: #8b6914;
	--theme-page-background: linear-gradient(180deg, #faf6ed 0%, #efe6d4 100%);
	--theme-content-shell-background: rgba(255, 252, 245, 0.94);
	--theme-header-background: linear-gradient(90deg, #f8f2e4 0%, #efe6d4 100%);
	--theme-header-text-color: #5a0000;
	--theme-header-border-color: rgba(139, 105, 20, 0.4);
	--theme-footer-background: #e8dfd0;
	--theme-footer-text-color: #4a4238;
	--theme-footer-heading-color: #5a0000;
	--theme-footer-muted-color: #6b6258;
	color-scheme: light;
	background: linear-gradient(180deg, #faf6ed 0%, #e8dfd0 55%, #dfd4c0 100%) !important;
	background-image: none !important;
}

html[data-color-mode="light"] body.theme-body--vocation-potter .theme-content-shell {
	backdrop-filter: none;
	box-shadow: 0 8px 28px rgba(90, 0, 0, 0.08);
}

html[data-color-mode="light"] body.theme-body--vocation-potter .theme-header-bar {
	box-shadow: 0 2px 16px rgba(90, 0, 0, 0.08);
}

html[data-color-mode="light"] body.theme-body--vocation-potter select {
	color-scheme: light;
}

html[data-color-mode="light"] body.theme-body--vocation-potter select option {
	background-color: #fffdf8 !important;
	color: #2c2416 !important;
	-webkit-text-fill-color: #2c2416;
}

html[data-color-mode="light"] body.theme-body--vocation-potter select optgroup {
	background-color: #f5f0e6 !important;
	color: #2c2416 !important;
	-webkit-text-fill-color: #2c2416;
}
