/**
 * DOD Loading Screen Styles
 * Branded loading screen with spinner animation and SEO-friendly static content
 */

/* Απόκρυψη caret για να μην αναβοσβήνει κατά το loading */
body {
	caret-color: transparent;
    margin: 0;
}

/* Static landing content (visible immediately for users and SEO) */
#landing-static {
	min-height: 100vh;
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/* Safe-area aware: never smaller than 2rem, but clears notch / status bar /
	   home indicator on iOS PWA (viewport-fit=cover) and Capacitor edge-to-edge.
	   env() is used directly so it works during the earliest load, before any JS runs. */
	padding-top: max(2rem, env(safe-area-inset-top));
	padding-bottom: max(2rem, env(safe-area-inset-bottom));
	padding-left: max(2rem, env(safe-area-inset-left));
	padding-right: max(2rem, env(safe-area-inset-right));
	text-align: center;
	font-family: system-ui, -apple-system, sans-serif;
}

.landing-header {
	margin-bottom: 2rem;
}

.landing-header h1 {
	color: #ffffff;
	font-size: 2.25rem;
	font-weight: 800;
	margin: 1rem 0 0.5rem 0;
	line-height: 1.2;
}

.landing-header h2 {
	color: #93c5fd;
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0.5rem 0;
	line-height: 1.4;
}

.landing-header h3 {
	color: #dbeafe;
	font-size: 1.125rem;
	font-weight: 500;
	margin: 0.75rem 0 1rem 0;
	line-height: 1.5;
	max-width: 700px;
	margin-left: auto;
	margin-right: auto;
}

/* Inline loading indicator (not overlay) */
#loading-indicator {
	margin: 2rem 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

/* User instruction text */
.landing-description {
	color: #94a3b8;
	font-size: 1rem;
	font-weight: 400;
	margin: 1.5rem 0 3rem 0;
	max-width: 600px;
	line-height: 1.6;
	font-style: italic;
}

/* Game categories layout */
.games-list {
	display: flex;
	gap: 3rem;
	justify-content: center;
	flex-wrap: wrap;
	max-width: 1000px;
	margin: 0 auto;
}

.game-category {
	min-width: 200px;
	text-align: left;
}

.game-category h2 {
	color: #60a5fa;
	font-size: 1.25rem;
	font-weight: 600;
	margin-bottom: 1rem;
	border-bottom: 2px solid #3b82f6;
	padding-bottom: 0.5rem;
}

.game-category ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.game-category li {
	margin: 0.5rem 0;
}

.game-category a {
	color: #93c5fd;
	text-decoration: none;
	font-size: 1rem;
	transition: color 0.2s, transform 0.2s;
	display: inline-block;
}

.game-category a:hover {
	color: #dbeafe;
	text-decoration: underline;
	transform: translateX(4px);
}

/* Logo */
.loading-logo {
	width: 120px;
	height: auto;
	margin: 0 auto 2rem;
	display: block;
	animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.8;
		transform: scale(0.95);
	}
}

/* Triple Ring Spinner */
.loading-spinner {
	position: relative;
	width: 80px;
	height: 80px;
	margin: 0 auto 1.5rem;
}

.spinner-ring {
	position: absolute;
	width: 100%;
	height: 100%;
	border: 3px solid transparent;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
	animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
	width: 70%;
	height: 70%;
	margin: 15%;
	border-top-color: #60a5fa;
	animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
	width: 40%;
	height: 40%;
	margin: 30%;
	border-top-color: #93c5fd;
	animation-delay: -0.15s;
}

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

/* Loading Text */
.loading-text {
	color: #94a3b8;
	font-size: 1rem;
	font-weight: 500;
	margin: 0;
	font-family: system-ui, -apple-system, sans-serif;
	animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
	0%, 100% {
		opacity: 0.6;
	}
	50% {
		opacity: 1;
	}
}

/* Error State */
#loading-screen.error-shown .loading-text {
	opacity: 0.5;
}

/* Loading Error Message */
#loading-error {
	margin-top: 2rem;
	padding: 1.5rem;
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.3);
	border-radius: 0.5rem;
	max-width: 320px;
	margin-left: auto;
	margin-right: auto;
}

.error-icon {
	font-size: 2rem;
	margin-bottom: 0.5rem;
}

.error-title {
	color: #fca5a5;
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 0.5rem 0;
	font-family: system-ui, -apple-system, sans-serif;
}

.error-description {
	color: #94a3b8;
	font-size: 0.875rem;
	margin: 0 0 1rem 0;
	line-height: 1.5;
	font-family: system-ui, -apple-system, sans-serif;
}

.error-reload {
	padding: 0.625rem 1.5rem;
	background: #3b82f6;
	color: white;
	border: none;
	border-radius: 0.375rem;
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 600;
	transition: background 0.2s;
	font-family: system-ui, -apple-system, sans-serif;
}

.error-reload:hover {
	background: #2563eb;
}

.error-reload:active {
	transform: scale(0.98);
}

/* Responsive adjustments */
@media (max-width: 640px) {
	.loading-logo {
		width: 100px;
	}

	.loading-spinner {
		width: 60px;
		height: 60px;
	}

	#loading-error {
		padding: 1rem;
		margin-top: 1.5rem;
	}

	.error-title {
		font-size: 0.9rem;
	}

	.error-description {
		font-size: 0.8rem;
	}
}
