body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
		sans-serif;
	/* Enhanced gradient background for light mode */
	background: linear-gradient(
		135deg,
		#667eea 0%,
		#764ba2 25%,
		#5922ef 50%,
		#37a5ff 75%,
		#4af3ff 100%
	);
	background-size: 400% 400%;
	animation: gradientShift 15s ease infinite;
	margin: 0;
	padding: 20px;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

@keyframes gradientShift {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

.container {
	background-color: transparent;
	border-radius: 20px;
	padding: 30px;
	width: 100%;
	max-width: 1200px;
	box-sizing: border-box;
}

header {
	text-align: center;
	margin-bottom: 40px;
}

header h1 {
	color: rgba(255, 255, 255, 0.95);
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 2.5rem;
	text-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
	letter-spacing: -0.02em;
}

header p {
	color: rgba(255, 255, 255, 0.8);
	font-size: 1.2em;
	font-weight: 400;
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
}

.card {
	/* Enhanced Liquid Glass Effect */
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 24px;
	padding: 32px;
	margin-bottom: 24px;
	box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1), 0 2px 16px 0 rgba(0, 0, 0, 0.05),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	position: relative;
	overflow: hidden;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.4),
		transparent
	);
	pointer-events: none;
}

.card:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.15),
		0 4px 20px 0 rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card h2 {
	color: rgba(255, 255, 255, 0.95);
	margin-top: 0;
	margin-bottom: 24px;
	font-weight: 600;
	font-size: 1.5rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	padding-bottom: 12px;
	letter-spacing: -0.01em;
}

.card h3 {
	color: rgba(255, 255, 255, 0.9);
	margin-top: 24px;
	margin-bottom: 16px;
	font-weight: 500;
	font-size: 1.1rem;
}

.form-group {
	margin-bottom: 20px;
}

.form-group label {
	display: block;
	margin-bottom: 6px;
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.9em;
	font-weight: 500;
}

input[type="text"],
input[type="number"],
select {
	width: calc(100% - 24px);
	padding: 12px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 12px;
	font-size: 1em;
	color: rgba(255, 255, 255, 0.95);
	box-sizing: border-box;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

input::placeholder {
	color: rgba(255, 255, 255, 0.5);
	font-weight: 400;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
	outline: none;
	border-color: rgba(255, 255, 255, 0.4);
	background: rgba(255, 255, 255, 0.08);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1), 0 4px 20px rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

.button-add,
.button-primary,
.button-secondary,
.button-remove {
	padding: 12px 24px;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	font-size: 1em;
	font-weight: 500;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	margin-top: 12px;
	position: relative;
	overflow: hidden;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.button-add {
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.2);
	margin-right: 12px;
}

.button-add:hover {
	background: rgba(255, 255, 255, 0.15);
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.button-primary {
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.2) 0%,
		rgba(255, 255, 255, 0.1) 100%
	);
	color: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(255, 255, 255, 0.3);
	margin-top: 24px;
	width: 100%;
	font-weight: 600;
}

.button-primary:hover {
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.25) 0%,
		rgba(255, 255, 255, 0.15) 100%
	);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.button-secondary {
	background: rgba(255, 255, 255, 0.05);
	color: rgba(255, 255, 255, 0.8);
	border: 1px solid rgba(255, 255, 255, 0.15);
	margin-top: 12px;
	margin-bottom: 12px;
}

.button-secondary:hover {
	background: rgba(255, 255, 255, 0.1);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.button-remove {
	background: linear-gradient(
		135deg,
		rgba(255, 59, 48, 0.8) 0%,
		rgba(255, 45, 85, 0.8) 100%
	);
	color: rgba(255, 255, 255, 0.95);
	border: 1px solid rgba(255, 59, 48, 0.3);
	padding: 8px 16px;
	font-size: 0.9em;
	margin-left: 12px;
}

.button-remove:hover {
	background: linear-gradient(
		135deg,
		rgba(255, 59, 48, 0.9) 0%,
		rgba(255, 45, 85, 0.9) 100%
	);
	transform: translateY(-1px);
	box-shadow: 0 4px 16px rgba(255, 59, 48, 0.3);
}

.input-row {
	display: flex;
	align-items: center;
	margin-bottom: 12px;
}

.input-row input {
	flex-grow: 1;
	margin-right: 12px;
}

.input-container {
	margin-bottom: 24px;
	padding: 20px;
	border: 1px dashed rgba(255, 255, 255, 0.2);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.03);
	backdrop-filter: blur(10px);
	color: rgba(255, 255, 255, 0.8);
	-webkit-backdrop-filter: blur(10px);
}

/* Enhanced Table Styling */
.table-container {
	overflow-x: auto;
	margin-bottom: 24px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 20px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(16px) saturate(180%);
	-webkit-backdrop-filter: blur(16px) saturate(180%);
	background: rgba(255, 255, 255, 0.05);
	overflow: hidden;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

table thead th {
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.1) 0%,
		rgba(255, 255, 255, 0.05) 100%
	);
	color: rgba(255, 255, 255, 0.9);
	padding: 16px 20px;
	text-align: left;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	font-weight: 600;
	font-size: 0.9em;
	letter-spacing: 0.02em;
}

table tbody td {
	padding: 16px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.95em;
	transition: background-color 0.3s ease;
}

table tbody tr:last-child td {
	border-bottom: none;
}

table tbody tr:hover {
	background: rgba(255, 255, 255, 0.05);
}

.result-section {
	display: none;
}

.winner-info {
	background: linear-gradient(
		135deg,
		rgba(52, 199, 89, 0.2) 0%,
		rgba(48, 209, 88, 0.1) 100%
	);
	border: 1px solid rgba(52, 199, 89, 0.3);
	border-radius: 20px;
	padding: 24px 28px;
	margin-top: 32px;
	text-align: center;
	box-shadow: 0 4px 20px rgba(52, 199, 89, 0.1),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.winner-info h3 {
	color: rgba(52, 199, 89, 1);
	margin: 0 0 12px 0;
	font-weight: 600;
	font-size: 1.3rem;
}

.winner-info p {
	color: rgba(52, 199, 89, 0.9);
	margin: 0;
	font-size: 1.1em;
	font-weight: 500;
}

.winner-info #best-alternative-name {
	font-weight: 700;
	font-size: 1.2em;
	color: rgba(255, 255, 255, 0.95);
}

.winner-info #best-alternative-score {
	font-weight: 700;
	font-size: 1.1em;
	color: rgba(255, 255, 255, 0.9);
}

/* Enhanced Modal Styles */
.modal {
	display: none;
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	justify-content: center;
	align-items: center;
}

.modal-content {
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	margin: auto;
	padding: 32px;
	border-radius: 24px;
	width: 80%;
	max-width: 400px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	position: relative;
	text-align: center;
	animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.close-button {
	color: rgba(255, 255, 255, 0.6);
	position: absolute;
	top: 16px;
	right: 20px;
	font-size: 24px;
	font-weight: bold;
	cursor: pointer;
	transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
	color: rgba(255, 255, 255, 0.9);
}

#modal-title {
	color: rgba(255, 255, 255, 0.95);
	margin-top: 0;
	margin-bottom: 16px;
	font-weight: 600;
}

#modal-message {
	margin-bottom: 28px;
	color: rgba(255, 255, 255, 0.8);
	line-height: 1.5;
}

#modal-ok-button {
	width: auto;
	padding: 12px 32px;
}

/* Dark Mode Enhancements */
body.dark-mode {
	background: linear-gradient(
		135deg,
		#1a1a2e 0%,
		#16213e 25%,
		#0f3460 50%,
		#533483 75%,
		#e43a19 100%
	);
	background-size: 400% 400%;
	animation: gradientShift 20s ease infinite;
}

body.dark-mode .card {
	background: rgba(0, 0, 0, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3), 0 2px 16px 0 rgba(0, 0, 0, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-mode .card:hover {
	box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4), 0 4px 20px 0 rgba(0, 0, 0, 0.25),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.dark-mode input[type="text"],
body.dark-mode input[type="number"],
body.dark-mode select {
	background: rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode input[type="text"]:focus,
body.dark-mode input[type="number"]:focus,
body.dark-mode select:focus {
	background: rgba(0, 0, 0, 0.25);
	border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .table-container {
	border-color: rgba(255, 255, 255, 0.1);
	background: rgba(0, 0, 0, 0.1);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-mode table thead th {
	background: linear-gradient(
		135deg,
		rgba(0, 0, 0, 0.2) 0%,
		rgba(0, 0, 0, 0.1) 100%
	);
}

body.dark-mode .input-container {
	background: rgba(0, 0, 0, 0.1);
	border-color: rgba(255, 255, 255, 0.1);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
	position: fixed;
	bottom: 24px;
	right: 24px;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50px;
	padding: 12px 18px;
	display: flex;
	align-items: center;
	cursor: pointer;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 999;
}

.dark-mode-toggle:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15),
		inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.dark-mode-toggle span {
	margin-right: 12px;
	color: rgba(255, 255, 255, 0.9);
	font-weight: 500;
	font-size: 0.9rem;
}

.dark-mode-toggle.active {
	background: rgba(0, 0, 0, 0.2);
	border-color: rgba(255, 255, 255, 0.1);
}

/* Enhanced Switch */
.switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255, 255, 255, 0.2);
	transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 24px;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
	position: absolute;
	content: "";
	height: 20px;
	width: 20px;
	left: 2px;
	bottom: 2px;
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.9) 0%,
		rgba(255, 255, 255, 0.8) 100%
	);
	transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
	background: linear-gradient(
		135deg,
		rgba(52, 199, 89, 0.8) 0%,
		rgba(48, 209, 88, 0.9) 100%
	);
}

input:checked + .slider:before {
	transform: translateX(20px);
}

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

	header h1 {
		font-size: 2rem;
	}

	.card {
		padding: 24px;
		border-radius: 20px;
	}

	.input-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.input-row input,
	.input-row select {
		width: calc(100% - 24px);
		margin-right: 0;
		margin-bottom: 12px;
	}

	.button-remove {
		margin-left: 0;
		width: 100%;
		margin-top: 8px;
	}

	.dark-mode-toggle {
		bottom: 16px;
		right: 16px;
		padding: 10px 14px;
	}
}

/* Table specific styling */
#final-results-table th:nth-child(2),
#final-results-table td:nth-child(2) {
	text-align: right;
	padding-right: 24px;
}

#final-results-table th:nth-child(3),
#final-results-table td:nth-child(3) {
	text-align: center;
}
