/* Global styles with enhanced typography and colors */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
	color: #2d3748;
	line-height: 1.6;
	min-height: 100vh;
	overflow-x: hidden;
}

.container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 24px;
}

/* Enhanced Header with glassmorphism */
header {
	text-align: center;
	margin-bottom: 40px;
	padding: 32px;
	background: rgba(255, 255, 255, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 24px;
	box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

header h1 {
	font-size: clamp(2rem, 4vw, 3.5rem);
	font-weight: 800;
	margin-bottom: 16px;
	background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
	letter-spacing: -0.025em;
}

.subtitle {
	font-size: 1.2rem;
	color: rgba(255, 255, 255, 0.9);
	font-weight: 400;
	letter-spacing: 0.025em;
}

/* Enhanced Controls with modern styling */
.controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 40px;
	background: rgba(255, 255, 255, 0.95);
	padding: 24px;
	border-radius: 20px;
	box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15), 0 2px 8px rgba(0, 0, 0, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.period-selector,
.country-selector {
	display: flex;
	align-items: center;
	gap: 12px;
}

.period-selector label,
.country-selector label {
	font-weight: 600;
	color: #4a5568;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.period-selector select,
.country-selector select {
	padding: 12px 16px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 500;
	background: white;
	cursor: pointer;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	min-width: 160px;
}

.period-selector select:focus,
.country-selector select:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
	transform: translateY(-1px);
}

.period-selector select:hover,
.country-selector select:hover {
	border-color: #cbd5e0;
	transform: translateY(-1px);
}

/* Enhanced Navigation Buttons */
.navigation {
	display: flex;
	gap: 12px;
}

.navigation button {
	padding: 12px 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.navigation button:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.navigation button:active {
	transform: translateY(0);
}

.navigation button:disabled {
	background: linear-gradient(135deg, #a0aec0 0%, #cbd5e0 100%);
	cursor: not-allowed;
	transform: none;
	box-shadow: 0 2px 4px rgba(160, 174, 192, 0.3);
}

/* Beautiful Main Content Grid */
.main-content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
	gap: 32px;
	margin-bottom: 40px;
}

/* Enhanced Chart Containers */
.chart-container {
	background: rgba(255, 255, 255, 0.95);
	padding: 32px;
	border-radius: 24px;
	box-shadow: 0 20px 40px rgba(31, 38, 135, 0.1), 0 8px 16px rgba(0, 0, 0, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.2);
	height: 500px;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	position: relative;
	overflow: hidden;
}

.chart-container::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
	border-radius: 24px 24px 0 0;
}

.chart-container:hover {
	transform: translateY(-4px);
	box-shadow: 0 32px 64px rgba(31, 38, 135, 0.15), 0 16px 32px rgba(0, 0, 0, 0.08);
}

.chart-container canvas {
	max-width: 100%;
	height: 100%;
	border-radius: 12px;
}

/* Full-width containers for specific charts */
.time-series-container,
.delta-container,
.total-delta-container {
	grid-column: 1 / -1;
	height: 600px;
}

.comparison-container {
	grid-column: 1 / -1;
	height: 700px;
}

/* Enhanced Source Attribution */
.source-attribution {
	grid-column: 1 / -1;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(20px);
	padding: 32px;
	border-radius: 20px;
	margin-top: 20px;
	box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.source-attribution h3 {
	color: #2d3748;
	margin-bottom: 16px;
	font-size: 1.4rem;
	font-weight: 700;
}

.source-attribution p {
	color: #4a5568;
	line-height: 1.6;
}

/* Beautiful Data Sources Section */
.data-sources {
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(20px);
	padding: 40px;
	border-radius: 24px;
	box-shadow: 0 20px 40px rgba(31, 38, 135, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	margin-top: 40px;
}

.data-sources h3 {
	text-align: center;
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 32px;
	color: #2d3748;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.source-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 24px;
}

.source-card {
	background: white;
	padding: 24px;
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(31, 38, 135, 0.08);
	border: 1px solid rgba(226, 232, 240, 0.8);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.source-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 40px rgba(31, 38, 135, 0.15);
	border-color: #667eea;
}

.source-card h4 {
	color: #2d3748;
	margin-bottom: 12px;
	font-size: 1.1rem;
	font-weight: 600;
}

.source-card p {
	color: #4a5568;
	font-size: 0.95rem;
	line-height: 1.5;
}

/* Error Messages */
.error-message {
	position: fixed;
	top: 24px;
	right: 24px;
	background: rgba(254, 226, 226, 0.95);
	color: #dc2626;
	padding: 16px 24px;
	border-radius: 16px;
	border: 1px solid rgba(252, 165, 165, 0.8);
	box-shadow: 0 10px 25px rgba(220, 38, 38, 0.15);
	font-weight: 600;
	z-index: 1000;
	animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Responsive Design */
@media (max-width: 1024px) {
	.container {
		padding: 20px;
	}

	.main-content {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.chart-container {
		height: 400px;
		padding: 24px;
	}
}

@media (max-width: 768px) {
	.container {
		padding: 16px;
	}

	header {
		padding: 24px;
	}

	.controls {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.period-selector,
	.country-selector {
		justify-content: center;
	}

	.navigation {
		justify-content: center;
	}

	.chart-container {
		height: 350px;
		padding: 20px;
	}

	.time-series-container,
	.delta-container,
	.total-delta-container {
		height: 400px;
	}

	.source-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}

@media (max-width: 480px) {
	.controls {
		padding: 20px;
	}

	.period-selector select,
	.country-selector select {
		min-width: auto;
		width: 100%;
	}

	.chart-container {
		height: 300px;
		padding: 16px;
	}

	.data-sources {
		padding: 24px;
	}
}

/* Smooth loading animations */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.main-content {
	animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
button:focus,
select:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

/* Print styles */
@media print {
	body {
		background: white;
	}

	.container {
		max-width: none;
		padding: 0;
	}

	.chart-container {
		box-shadow: none;
		border: 1px solid #e2e8f0;
	}
}
