/**
 * Lumo Eclipse - Switch Button Styles
 *
 * Beautiful toggle switch designs
 *
 * @package LumoEclipse
 * @since 1.0.0
 */

/* ========================================
   BASE SWITCH STYLES
   ======================================== */
.ne-switch-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: #fff;
	cursor: pointer;
	border-radius: 50px;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
	z-index: 9999;
	-webkit-tap-highlight-color: transparent;
}

.ne-switch-btn:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.ne-switch-btn:active {
	transform: scale(0.95);
}

.ne-switch-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ========================================
   FLOATING POSITION STYLES
   ======================================== */
.ne-switch-floating {
	position: fixed;
	z-index: 99999;
}

/* ========================================
   SIZE VARIANTS
   ======================================== */
.ne-switch-size-small {
	width: 40px;
	height: 40px;
	padding: 8px;
}

.ne-switch-size-small .ne-icon svg,
.ne-switch-size-small .ne-minimal-icon svg {
	width: 18px;
	height: 18px;
}

.ne-switch-size-medium {
	width: 50px;
	height: 50px;
	padding: 10px;
}

.ne-switch-size-medium .ne-icon svg,
.ne-switch-size-medium .ne-minimal-icon svg {
	width: 24px;
	height: 24px;
}

.ne-switch-size-large {
	width: 60px;
	height: 60px;
	padding: 12px;
}

.ne-switch-size-large .ne-icon svg,
.ne-switch-size-large .ne-minimal-icon svg {
	width: 30px;
	height: 30px;
}

/* ========================================
   ANIMATION VARIANTS
   ======================================== */
.ne-switch-anim-fade {
	animation: ne-fade-in 0.5s ease forwards;
}

.ne-switch-anim-slide {
	animation: ne-slide-in 0.5s ease forwards;
}

.ne-switch-anim-scale {
	animation: ne-scale-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes ne-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes ne-slide-in {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes ne-scale-in {
	from {
		opacity: 0;
		transform: scale(0.5);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* ========================================
   MOON & SUN STYLE
   ======================================== */
.ne-switch-moon-sun {
	background: linear-gradient(145deg, #fef3c7, #fcd34d);
}

.ne-switch-moon-sun .ne-icon {
	position: absolute;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ne-switch-moon-sun .ne-icon svg {
	display: block;
}

.ne-switch-moon-sun .ne-icon-sun {
	color: #eab308;
	opacity: 1;
	transform: rotate(0deg) scale(1);
}

.ne-switch-moon-sun .ne-icon-moon {
	color: #eab308;
	opacity: 0;
	transform: rotate(-90deg) scale(0.5);
}

/* Dark mode state */
html.ne-dark .ne-switch-moon-sun {
	background: linear-gradient(145deg, #312e81, #4338ca);
	filter: invert(1) hue-rotate(180deg);
}

html.ne-dark .ne-switch-moon-sun .ne-icon-sun {
	opacity: 0;
	transform: rotate(90deg) scale(0.5);
}

html.ne-dark .ne-switch-moon-sun .ne-icon-moon {
	color: #fcd34d;
	opacity: 1;
	transform: rotate(0deg) scale(1);
}

/* ========================================
   iOS TOGGLE STYLE
   ======================================== */
.ne-switch-toggle-ios {
	width: auto !important;
	height: auto !important;
	padding: 4px !important;
	border-radius: 30px;
	background: #e2e8f0;
}

.ne-switch-toggle-ios.ne-switch-size-small {
	width: 44px !important;
}

.ne-switch-toggle-ios.ne-switch-size-medium {
	width: 52px !important;
}

.ne-switch-toggle-ios.ne-switch-size-large {
	width: 64px !important;
}

.ne-toggle-track {
	display: block;
	width: 44px;
	height: 26px;
	background: #cbd5e1;
	border-radius: 26px;
	position: relative;
	transition: background 0.3s ease;
}

.ne-switch-size-small .ne-toggle-track {
	width: 36px;
	height: 20px;
}

.ne-switch-size-large .ne-toggle-track {
	width: 56px;
	height: 32px;
}

.ne-toggle-thumb {
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	background: white;
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ne-switch-size-small .ne-toggle-thumb {
	width: 14px;
	height: 14px;
}

.ne-switch-size-large .ne-toggle-thumb {
	width: 26px;
	height: 26px;
}

html.ne-dark .ne-switch-toggle-ios {
	filter: invert(1) hue-rotate(180deg);
}

html.ne-dark .ne-switch-toggle-ios .ne-toggle-track {
	background: linear-gradient(135deg, #fde047, #eab308);
}

html.ne-dark .ne-switch-toggle-ios .ne-toggle-thumb {
	transform: translateX(18px);
}

html.ne-dark .ne-switch-size-small .ne-toggle-thumb {
	transform: translateX(16px);
}

html.ne-dark .ne-switch-size-large .ne-toggle-thumb {
	transform: translateX(24px);
}

/* ========================================
   MINIMAL TOGGLE STYLE
   ======================================== */
.ne-switch-toggle-minimal {
	background: #f1f5f9;
	border: 2px solid #e2e8f0;
}

.ne-switch-toggle-minimal .ne-minimal-icon {
	color: #64748b;
	transition: all 0.3s ease;
}

.ne-switch-toggle-minimal .ne-minimal-icon svg {
	display: block;
}

html.ne-dark .ne-switch-toggle-minimal {
	background: #1e293b;
	border-color: #334155;
	filter: invert(1) hue-rotate(180deg);
}

html.ne-dark .ne-switch-toggle-minimal .ne-minimal-icon {
	color: #e2e8f0;
	transform: rotate(180deg);
}

/* ========================================
   ICON ONLY STYLE
   ======================================== */
.ne-switch-icon-only {
	background: linear-gradient(145deg, #f8fafc, #e2e8f0);
	border: 2px solid #e2e8f0;
}

.ne-switch-icon-only .ne-icon {
	position: absolute;
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ne-switch-icon-only .ne-icon svg {
	display: block;
}

.ne-switch-icon-only .ne-icon-light {
	color: #eab308;
	opacity: 1;
	transform: scale(1);
}

.ne-switch-icon-only .ne-icon-dark {
	color: #eab308;
	opacity: 0;
	transform: scale(0.5);
}

html.ne-dark .ne-switch-icon-only {
	background: linear-gradient(145deg, #1e293b, #334155);
	border-color: #475569;
	filter: invert(1) hue-rotate(180deg);
}

html.ne-dark .ne-switch-icon-only .ne-icon-light {
	opacity: 0;
	transform: scale(0.5);
}

html.ne-dark .ne-switch-icon-only .ne-icon-dark {
	color: #fcd34d;
	opacity: 1;
	transform: scale(1);
}

/* ========================================
   TEXT ONLY STYLE
   ======================================== */
.ne-switch-text-only {
	width: auto !important;
	padding: 10px 20px !important;
	background: linear-gradient(145deg, #f8fafc, #e2e8f0);
	border: 2px solid #e2e8f0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	font-weight: 600;
}

.ne-switch-text-only .ne-text {
	transition: all 0.3s ease;
}

.ne-switch-text-only .ne-text-light {
	color: #475569;
}

.ne-switch-text-only .ne-text-dark {
	display: none;
	color: #e2e8f0;
}

html.ne-dark .ne-switch-text-only {
	background: linear-gradient(145deg, #1e293b, #334155);
	border-color: #475569;
	filter: invert(1) hue-rotate(180deg);
}

html.ne-dark .ne-switch-text-only .ne-text-light {
	display: none;
}

html.ne-dark .ne-switch-text-only .ne-text-dark {
	display: inline;
}

/* ========================================
   CUSTOM STYLE
   ======================================== */
.ne-switch-custom {
	background: linear-gradient(145deg, #f8fafc, #e2e8f0);
	border: 2px solid #e2e8f0;
	width: auto !important;
	min-width: 50px;
	height: auto !important;
	min-height: 50px;
	padding: 8px 12px !important;
	gap: 6px;
}

.ne-switch-custom .ne-custom-light,
.ne-switch-custom .ne-custom-dark {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: all 0.3s ease;
}

.ne-switch-custom .ne-custom-dark {
	display: none;
}

.ne-switch-custom .ne-custom-icon {
	width: 24px;
	height: 24px;
	object-fit: contain;
}

.ne-switch-custom .ne-custom-icon-svg {
	filter: none;
}

.ne-switch-custom svg {
	width: 24px;
	height: 24px;
	color: #64748b;
}

.ne-switch-custom .ne-custom-text {
	font-size: 14px;
	font-weight: 600;
	color: #475569;
	white-space: nowrap;
}

/* Custom style size variants */
.ne-switch-custom.ne-switch-size-small .ne-custom-icon,
.ne-switch-custom.ne-switch-size-small svg {
	width: 18px;
	height: 18px;
}

.ne-switch-custom.ne-switch-size-small .ne-custom-text {
	font-size: 12px;
}

.ne-switch-custom.ne-switch-size-large .ne-custom-icon,
.ne-switch-custom.ne-switch-size-large svg {
	width: 30px;
	height: 30px;
}

.ne-switch-custom.ne-switch-size-large .ne-custom-text {
	font-size: 16px;
}

/* Dark mode state for custom */
html.ne-dark .ne-switch-custom {
	background: linear-gradient(145deg, #1e293b, #334155);
	border-color: #475569;
	filter: invert(1) hue-rotate(180deg);
}

html.ne-dark .ne-switch-custom .ne-custom-light {
	display: none;
}

html.ne-dark .ne-switch-custom .ne-custom-dark {
	display: flex;
}

html.ne-dark .ne-switch-custom .ne-custom-text {
	color: #e2e8f0;
}

html.ne-dark .ne-switch-custom svg {
	color: #e2e8f0;
}

/* Ensure custom icons don't get inverted */
html.ne-dark .ne-switch-custom .ne-custom-icon {
	filter: invert(1) hue-rotate(180deg);
}

/* ========================================
   INLINE STYLE (For menus/shortcodes)
   ======================================== */
.ne-switch-inline {
	position: static;
	box-shadow: none;
}

.ne-switch-inline:hover {
	transform: none;
	box-shadow: none;
}

.ne-menu-switch-item {
	display: flex;
	align-items: center;
}

.ne-menu-switch-item .ne-switch-btn {
	margin: 0 10px;
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
	.ne-switch-btn,
	.ne-switch-btn .ne-icon,
	.ne-toggle-thumb,
	.ne-minimal-icon,
	.ne-text {
		transition: none;
	}
	
	.ne-switch-anim-fade,
	.ne-switch-anim-slide,
	.ne-switch-anim-scale {
		animation: none;
	}
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
	.ne-switch-btn {
		border: 2px solid currentColor;
	}
}
