/* Language Selection Overlay Styles - Korrigierte Version ohne grünen Balken */

#language-selection-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	min-height: 100vh;
	background: linear-gradient(135deg, #1e3b1e, #2c582c, #3a6b3a);
	z-index: 95;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
	color: #f0f0f0;
	text-align: center;
	opacity: 1;
	visibility: visible;
	transition: opacity 2s ease-out, visibility 2s ease-out;
	overflow: hidden;
	padding-top: min(8vh, 100px);
	padding-bottom: 60px;
	box-sizing: border-box;
}

/* Versteckt nach Sprachauswahl */
#language-selection-overlay.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* Magisches Siegel */
.start-seal {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    background: linear-gradient(135deg, #3a6b3a, #4a8c4a, #3a6b3a);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 60px;
    margin-bottom: 40px;
    box-shadow: 0 0 30px rgba(58, 107, 58, 0.9);
    animation: gentle-pulse 4s ease-in-out infinite;
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

/* Rotierender Ring um das Siegel */
.start-seal::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    min-width: 140px;
    min-height: 140px;
    aspect-ratio: 1 / 1;
    border: 2px solid #4a8c4a;
    border-radius: 50%;
    animation: rotate 15s linear infinite;
    opacity: 0.6;
}

.f11-notice,
.touch-notice,
.music-notice {
    font-size: 16px;
    color: #d0e8d0;
    font-style: italic;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    opacity: 0.9;
}

.start-seal::before {
	content: "🌱";
}

@keyframes gentle-pulse {
	0%, 100% { 
		transform: scale(1);
		box-shadow: 0 0 30px rgba(58, 107, 58, 0.9);
	}
	50% { 
		transform: scale(1.05);
		box-shadow: 0 0 40px rgba(58, 107, 58, 1.2);
	}
}

@keyframes rotate {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Titel und Untertitel */
.start-title {
	font-size: 48px;
	color: #ffffff;
	text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(58, 107, 58, 0.6);
	margin-bottom: 15px;
	letter-spacing: 2px;
	font-weight: normal;
	margin-top: 0px;
}

.start-subtitle {
	font-size: 24px;
	color: #e8f5e8;
	margin-bottom: 30px;
	font-style: italic;
	text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

.start-description {
	font-size: 18px;
	color: #d0e8d0;
	max-width: 600px;
	line-height: 2;
	margin-bottom: 30px;
	text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Sprachauswahl */
.language-selection {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 30px;
}

.language-instruction {
	font-size: 20px;
	color: #ffffff;
	margin-bottom: 10spx;
	text-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

.language-buttons {
	display: flex;
	gap: 30px;
	flex-wrap: wrap;
	justify-content: center;
}

/* Sprach-Buttons - Basis-Styling */
.language-button {
	position: relative;
	padding: 20px 40px;
	background: linear-gradient(145deg, #4a8c4a, #3a6b3a);
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-radius: 15px;
	color: #ffffff;
	font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
	font-size: 18px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
	min-width: 140px;
	text-align: center;
	overflow: hidden;
}

.language-button:hover:not(.disabled):not(.loading) {
	background: linear-gradient(145deg, #5a9c5a, #4a8c4a);
	border-color: rgba(255, 255, 255, 0.4);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(58, 107, 58, 0.6);
	transform: translateY(-3px);
}

.language-button:active:not(.disabled):not(.loading) {
	transform: translateY(-1px);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Aktive Sprache */
.language-button.active {
	background: linear-gradient(145deg, #6aac6a, #5a9c5a);
	border-color: rgba(255, 255, 255, 0.6);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(58, 107, 58, 0.8);
}

/* JSON-LOADING STATES */

/* Loading State für Sprach-Buttons */
.language-button.loading {
	background: linear-gradient(145deg, #666666, #555555);
	cursor: wait;
	opacity: 0.8;
	pointer-events: none;
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
	transform: none;
}

.language-button.loading:hover {
	transform: none;
	background: linear-gradient(145deg, #666666, #555555);
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Loading Animation - Pulsierender Effekt */
.language-button.loading::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, 
		transparent, 
		rgba(255, 255, 255, 0.2), 
		transparent
	);
	animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
	0% { left: -100%; }
	100% { left: 100%; }
}

/* Loading Dots Animation für Text */
.language-button.loading .language-label::after {
	content: "";
	animation: loading-dots 1.2s infinite;
}

@keyframes loading-dots {
	0%, 20% { content: "."; }
	40% { content: ".."; }
	60% { content: "..."; }
	80%, 100% { content: ""; }
}

/* Success State - Kurzes grünes Feedback */
.language-button.success {
	background: linear-gradient(145deg, #4caf50, #388e3c);
	border-color: rgba(76, 175, 80, 0.6);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(76, 175, 80, 0.6);
	animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); }
	100% { transform: scale(1); }
}

/* Error State - Rotes Feedback bei Fehlern */
.language-button.error {
	background: linear-gradient(145deg, #f44336, #d32f2f);
	border-color: rgba(244, 67, 54, 0.6);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(244, 67, 54, 0.4);
	animation: error-shake 0.5s ease-out;
}

@keyframes error-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-5px); }
	75% { transform: translateX(5px); }
}

/* Deaktivierte Sprachen (für später) */
.language-button.disabled {
	background: linear-gradient(145deg, #555555, #444444);
	border-color: rgba(255, 255, 255, 0.1);
	color: #aaaaaa;
	cursor: not-allowed;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.language-button.disabled:hover {
	transform: none;
	background: linear-gradient(145deg, #555555, #444444);
	border-color: rgba(255, 255, 255, 0.1);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.language-button.disabled[data-language="de"]:hover,
.language-button.disabled[data-language="es"]:hover {
	background: linear-gradient(145deg, #5a9c5a, #4a8c4a) !important;
	border-color: rgba(255, 255, 255, 0.4) !important;
	transform: translateY(-3px) !important;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(58, 107, 58, 0.6) !important;
}

.language-button.disabled[data-language="de"]:active,
.language-button.disabled[data-language="es"]:active {
	transform: translateY(-1px) !important;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Sprach-Info */
.language-info {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
}

.language-flag {
	font-size: 24px;
	margin-bottom: 5px;
}

.language-label {
	font-size: 16px;
	font-weight: 500;
	position: relative;
}

.language-status {
	font-size: 12px;
	opacity: 0.8;
	font-style: italic;
}

/* Start Button (erscheint nach Sprachauswahl) */
.start-journey-button {
	margin-top: 0px;
	padding: 15px 30px;
	background: linear-gradient(145deg, #8b6b43, #a68153);
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 12px;
	color: #ffffff;
	font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
	font-size: 20px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px);
}

.start-journey-button.visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.start-journey-button:hover {
	background: linear-gradient(145deg, #9b7b53, #b69163);
	border-color: rgba(255, 255, 255, 0.5);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 107, 67, 0.6);
	transform: translateY(-3px);
}

.start-journey-button:active {
	transform: translateY(-1px);
}

/* Mystischer Nebel-Effekt */
#language-selection-overlay::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: radial-gradient(ellipse at center, transparent 0%, rgba(30, 59, 30, 0.3) 100%);
	z-index: -1;
}

/* Zusätzliche Loading-Feedback Elemente */
.language-button.loading .language-flag {
	animation: loading-rotate 2s linear infinite;
}

@keyframes loading-rotate {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Globaler Loading-Indikator (optional für Preloading) */
.global-language-loading {
	position: fixed;
	bottom: 30px;
	right: 30px;
	background: rgba(0, 0, 0, 0.8);
	color: white;
	padding: 10px 15px;
	border-radius: 8px;
	font-size: 14px;
	z-index: 1000000;
	opacity: 0;
	transition: opacity 0.3s ease;
	display: flex;
	align-items: center;
	gap: 10px;
}

.global-language-loading.visible {
	opacity: 1;
}

.global-language-loading::before {
	content: "⏳";
	animation: loading-rotate 1s linear infinite;
}

/* Accessibility Improvements für Loading States */
.language-button[aria-busy="true"] {
	position: relative;
}

.language-button[aria-busy="true"]::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 15px;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top: 2px solid #ffffff;
	border-radius: 50%;
	animation: spinner 1s linear infinite;
	transform: translateY(-50%);
}

@keyframes spinner {
	0% { transform: translateY(-50%) rotate(0deg); }
	100% { transform: translateY(-50%) rotate(360deg); }
}

/* Focus States für bessere Keyboard Navigation */
.language-button:focus-visible {
	outline: 3px solid rgba(255, 255, 255, 0.6);
	outline-offset: 2px;
}

.language-button.loading:focus-visible {
	outline: 3px solid rgba(102, 102, 102, 0.8);
}
