/**
 * Kaleidoscope Rotor – Frontend-Stylesheet
 *
 * Gestaltet den Widget-Container, Canvas, Steuerungsleiste,
 * Symmetrie-Label, Lightbox und Lade-Animation.
 *
 * @package KaleidoscopeRotor
 * @version 1.0.0
 */

/* ── Container ──────────────────────────────────────────────────────────────── */
.kr-kaleidoscope-wrapper {
	position:   relative;
	display:    block;
	overflow:   hidden;
	width:      100%;
	background: #000;
	cursor:     grab;
	-webkit-user-select: none;
	user-select: none;
	/* Mindesthöhe als Fallback */
	min-height: 300px;
	border-radius: 4px;
}

.kr-kaleidoscope-wrapper:active {
	cursor: grabbing;
}

/* ── WebGL-Canvas ────────────────────────────────────────────────────────────── */
.kr-canvas {
	display: block;
	width:   100% !important;
	height:  100% !important;
	/* Canvas füllt den Container vollständig aus */
}

/* ── Symmetrie-Label (Hover-Einblendung) ────────────────────────────────────── */
.kr-symmetry-label {
	position:   absolute;
	top:        16px;
	left:       50%;
	transform:  translateX(-50%);
	padding:    6px 18px;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(8px);
	color:      #fff;
	font-family: system-ui, sans-serif;
	font-size:  13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-radius: 999px;
	border:     1px solid rgba(255,255,255,0.15);
	pointer-events: none;
	opacity:    0;
	transition: opacity 0.3s ease;
	white-space: nowrap;
	z-index:    10;
}

.kr-symmetry-label.kr-visible {
	opacity: 1;
}

/* ── Steuerungsleiste ────────────────────────────────────────────────────────── */
.kr-controls {
	position:   absolute;
	bottom:     20px;
	left:       50%;
	transform:  translateX(-50%);
	display:    flex;
	align-items: center;
	gap:        6px;
	padding:    8px 14px;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(12px);
	border-radius: 999px;
	border:     1px solid rgba(255,255,255,0.12);
	z-index:    20;
	/* Sanftes Einblenden beim Hover */
	opacity:    0.6;
	transition: opacity 0.3s ease;
}

.kr-kaleidoscope-wrapper:hover .kr-controls {
	opacity: 1;
}

/* ── Buttons in der Steuerungsleiste ─────────────────────────────────────────── */
.kr-btn {
	display:    inline-flex;
	align-items: center;
	justify-content: center;
	width:      34px;
	height:     34px;
	padding:    0;
	background: rgba(255,255,255,0.1);
	border:     1px solid rgba(255,255,255,0.2);
	border-radius: 50%;
	color:      #fff;
	font-size:  14px;
	cursor:     pointer;
	transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	outline:    none;
	-webkit-appearance: none;
}

.kr-btn:hover {
	background:  rgba(255,255,255,0.25);
	box-shadow:  0 0 10px rgba(255,120,255,0.4);
	transform:   scale(1.1);
}

.kr-btn:active {
	transform:  scale(0.95);
}

/* Aktiver Symmetrie-Button */
.kr-btn-sym.kr-active {
	background: rgba(200, 80, 255, 0.5);
	border-color: rgba(200,80,255,0.8);
	box-shadow: 0 0 14px rgba(200,80,255,0.6);
}

/* Screenshot-Button etwas breiter */
.kr-btn-screenshot {
	font-size: 16px;
	margin-left: 4px;
}

/* ── Lightbox ────────────────────────────────────────────────────────────────── */
.kr-lightbox {
	position:   fixed;
	inset:      0;
	z-index:    999999;
	display:    flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(6px);
	animation: kr-fade-in 0.3s ease;
}

.kr-lightbox[hidden] {
	display: none;
}

@keyframes kr-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.kr-lightbox-inner {
	position:   relative;
	max-width:  90vw;
	max-height: 90vh;
	border-radius: 8px;
	overflow:   hidden;
	box-shadow: 0 0 60px rgba(200, 80, 255, 0.5),
	            0 0 120px rgba(0, 200, 255, 0.3);
	animation: kr-scale-in 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes kr-scale-in {
	from { transform: scale(0.85); opacity: 0; }
	to   { transform: scale(1);    opacity: 1; }
}

.kr-lightbox-canvas {
	display: block;
	max-width:  90vw;
	max-height: 90vh;
}

.kr-lightbox-close {
	position:   absolute;
	top:        12px;
	right:      12px;
	width:      36px;
	height:     36px;
	background: rgba(0,0,0,0.7);
	border:     1px solid rgba(255,255,255,0.3);
	border-radius: 50%;
	color:      #fff;
	font-size:  20px;
	line-height: 1;
	cursor:     pointer;
	display:    flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, transform 0.15s;
	z-index:    1;
}

.kr-lightbox-close:hover {
	background: rgba(200,80,255,0.5);
	transform:  rotate(90deg);
}

/* ── Lade-Animation ──────────────────────────────────────────────────────────── */
.kr-loader {
	position:   absolute;
	inset:      0;
	display:    flex;
	align-items: center;
	justify-content: center;
	background: #000;
	z-index:    30;
	transition: opacity 0.4s ease;
}

.kr-loader-ring {
	width:      56px;
	height:     56px;
	border:     4px solid rgba(255,255,255,0.1);
	border-top-color: #c850ff;
	border-right-color: #00ffff;
	border-radius: 50%;
	animation:  kr-spin 0.8s linear infinite;
}

@keyframes kr-spin {
	to { transform: rotate(360deg); }
}

/* ── Elementor-Editor-Platzhalter ────────────────────────────────────────────── */
.kr-editor-placeholder {
	display:    flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	background: linear-gradient(135deg, #1a001a, #001a2e);
	border:     2px dashed rgba(200,80,255,0.4);
	border-radius: 6px;
	color:      rgba(255,255,255,0.7);
	font-family: system-ui, sans-serif;
	gap:        8px;
}

.kr-editor-placeholder span {
	font-size:  20px;
}

.kr-editor-placeholder small {
	font-size:  12px;
	opacity:    0.5;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media ( max-width: 600px ) {
	.kr-controls {
		padding: 6px 10px;
		gap:     4px;
	}

	.kr-btn {
		width:     28px;
		height:    28px;
		font-size: 11px;
	}

	.kr-symmetry-label {
		font-size: 11px;
		padding:   4px 12px;
	}
}
