/**
 * Frontend CSS
 * Styling für Modal, Buttons und Profilbilder
 */

.samurait-profile-display {
	display: inline-block;
	background: #f5f5f5;
	border-radius: 50%;
	overflow: hidden;
}

.samurait-profile-display img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

/* Upload-Button */
.samurait-profile-upload-btn {
	padding: 10px 20px;
	background-color: #0073aa;
	color: white;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.3s ease;
}

.samurait-profile-upload-btn:hover {
	background-color: #005a87;
}

.samurait-profile-upload-btn:active {
	background-color: #003d5c;
}

/* Modal Styling */
.samurait-profile-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	overflow-y: auto;
	box-sizing: border-box;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.samurait-profile-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(8px);
}

.samurait-profile-modal-content {
	position: relative;
	background: white;
	border-radius: 8px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
	max-width: 600px;
	width: 90%;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.samurait-profile-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px;
	border-bottom: 1px solid #eee;
}

.samurait-profile-modal-header h2 {
	margin: 0;
	font-size: 20px;
	color: #333;
}

.samurait-profile-modal-close {
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: #666;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.samurait-profile-modal-close:hover {
	color: #000;
}

.samurait-profile-modal-body {
	padding: 20px;
	flex: 1;
	overflow-y: auto;
	min-height: 0;
}

.samurait-profile-modal-footer {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	padding: 20px;
	border-top: 1px solid #eee;
	background-color: #f9f9f9;
}

/* Schritt-Container */
.samurait-profile-step {
	animation: slideIn 0.3s ease;
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Dateiauswahl */
.samurait-profile-file-input-wrapper {
	text-align: center;
}

.samurait-profile-file-input-wrapper.is-drag-over .samurait-profile-file-input-label {
	background-color: #dff0ff;
	border-color: #005a87;
	color: #005a87;
}

.samurait-profile-file-input-wrapper input[type="file"] {
	display: none;
}

.samurait-profile-file-input-label {
	display: inline-block;
	padding: 20px 40px;
	background-color: #f5f5f5;
	border: 2px dashed #0073aa;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
	font-weight: 500;
	color: #0073aa;
}

.samurait-profile-file-input-label:hover {
	background-color: #e8f3ff;
}

.samurait-profile-help-text {
	margin-top: 10px;
	font-size: 12px;
	color: #666;
}

.samurait-profile-drop-hint {
	margin-top: 10px;
	margin-bottom: 0;
	font-size: 13px;
	color: #50575e;
}

/* Cropper-Container */
.samurait-profile-cropper-container {
	display: block;
	margin-bottom: 20px;
}

#samurait-profile-canvas {
	border: 1px solid #ddd;
	background: white;
	border-radius: 4px;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	display: block;
}

.samurait-profile-canvas-hidden {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.samurait-profile-preview {
	position: relative;
	background: #f5f5f5;
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1;
	min-height: 260px;
	cursor: move;
	user-select: none;
}

.samurait-profile-preview.is-dragging {
	cursor: grabbing;
}

.samurait-profile-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	-webkit-user-drag: none;
	user-select: none;
	pointer-events: none;
}

.samurait-profile-preview-mask {
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: var(--samurait-preview-radius, 50%);
	box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
}

/* Regler Controls */
.samurait-profile-controls {
	margin-bottom: 15px;
	padding: 15px;
	background-color: #f9f9f9;
	border-radius: 4px;
}

.samurait-profile-controls label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
}

.samurait-slider-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 12px;
}

.samurait-slider-row:first-child {
	margin-top: 0;
}

.samurait-slider-row label {
	min-width: 180px;
	white-space: nowrap;
}

.samurait-slider-row input[type="range"] {
	flex: 1;
	height: 8px;
	-webkit-appearance: none;
	appearance: none;
	background: #ccd0d4;
	border-radius: 4px;
	cursor: pointer;
	outline: none;
}

.samurait-slider-row input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #2271b1;
	cursor: pointer;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

.samurait-slider-row input[type="range"]::-moz-range-thumb {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #2271b1;
	border: 2px solid #fff;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0,0,0,.25);
}

.samurait-slider-reset {
	width: 60px;
	height: 60px;
	border-radius: 999px;
	border: 1px solid #ccd0d4;
	background: #fff;
	color: #1d2327;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.samurait-slider-reset:hover {
	background: #f0f0f1;
}

.samurait-profile-controls input[type="range"] {
	flex: 1;
	cursor: pointer;
}

/* Fehler Meldung */
.samurait-profile-error {
	padding: 12px 15px;
	background-color: #fee;
	border-left: 4px solid #f44;
	color: #c33;
	border-radius: 4px;
	margin-bottom: 15px;
	font-size: 14px;
}

/* Loading Spinner */
.samurait-profile-loading {
	padding: 15px;
	background-color: #f0f8ff;
	border-radius: 4px;
	text-align: center;
	color: #0073aa;
	font-weight: 500;
}

/* Buttons */
.samurait-profile-btn {
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: background-color 0.2s ease;
}

.samurait-profile-btn-primary {
	background-color: #0073aa;
	color: white;
}

.samurait-profile-btn-primary:hover:not(:disabled) {
	background-color: #005a87;
}

.samurait-profile-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.samurait-profile-btn-secondary {
	background-color: #f0f0f0;
	color: #333;
	border: 1px solid #ccc;
}

.samurait-profile-btn-secondary:hover {
	background-color: #e0e0e0;
}

/* Success Message */
.samurait-profile-success {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background-color: #28a745;
	color: white;
	padding: 15px 20px;
	border-radius: 4px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	z-index: 100000;
	animation: slideInBottom 0.3s ease;
}

@keyframes slideInBottom {
	from {
		transform: translateY(100px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Responsive */
@media (max-width: 480px) {
	.samurait-profile-modal-content {
		max-width: 95%;
	}

	.samurait-profile-modal-header,
	.samurait-profile-modal-body,
	.samurait-profile-modal-footer {
		padding: 15px;
	}

	.samurait-profile-modal-footer {
		flex-direction: column;
	}

	.samurait-profile-modal-footer .samurait-profile-btn {
		width: 100%;
	}

	.samurait-profile-file-input-label {
		padding: 15px 30px;
		font-size: 14px;
	}
}
