/* General Reset */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* Theme variables */
:root {
	--bg-color: #ffffff;
	--text-color: #fffece;
	--card-bg: #f0fff0f1;
	--card-border: rgba(0, 0, 0, 0.125);
	--heading-color: #242424;
	--muted-text: #6c757d;
	--nav-bg: #272c31ec;
	--nav-text: #fff;
	--hover-bg: #444444;
}

[data-theme="dark"] {
	--bg-color: #131313;
	--text-color: #e7fde5;
	--card-bg: #4b4d53;
	--card-border: rgb(5, 0, 54);
	--heading-color: #dddddd;
	--muted-text: #ebffe7b0;
	--nav-bg: #1a1a1af3;
	--nav-text: #ffffff;
	--hover-bg: #414141;
}

/* Apply theme colors */
body {
	font-family: "Arial", sans-serif;
	line-height: 1.6;
	color: var(--text-color);
	background-color: var(--bg-color);
	padding: 0;
	margin: 0;
	transition: all 0.3s ease;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	cursor: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--heading-color);
}

/* Add text-muted override for dark mode */
.text-muted {
	color: var(--muted-text) !important;
}

h1 {
	font-size: 2.5rem;
	margin-bottom: 1rem;
	position: relative;
	text-align: center;
	transition: ease 0.3s;
	&:hover {
		color: #c7ffcb;
	}
}

/* Header Styling */
header {
	background: var(--bg-color);
	color: var(--text-color);
	padding: 1rem 0;
	text-align: center;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
	font-size: 2.5rem;
	margin: 0;
}

/* Navigation Bar */
nav {
	display: flex;
	justify-content: center;
	background: var(--nav-bg);
}

nav a {
	color: var(--nav-text);
	text-decoration: none;
	padding: 0.75rem 1.5rem;
	display: block;
	transition: all ease 0.3s;
}

/* Navigation hover effects */
.d-lg-flex {
	position: relative;
}

.nav-highlight {
	position: absolute;
	top: 0;
	height: 100%;
	background: var(--hover-bg);
	transition: all 0.3s ease;
	z-index: 1;
	pointer-events: none;
	opacity: 0;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tttgs,
.ponggs {
	position: relative;
	color: var(--nav-text);
	text-decoration: none;
	padding: 0.75rem 1.5rem;
	z-index: 2;
	transition: all 0.3s ease;
}

.tttgs:hover,
.ponggs:hover {
	color: var(--nav-text);
}

.tttgs i,
.ponggs i,
.tttgs span,
.ponggs span {
	position: relative;
	z-index: 2;
	transition: all 0.3s ease;
}

nav a:hover {
	background: transparent;
}

/* Main Content */
main {
	padding: 2rem;
	max-width: 1200px;
	margin: 0 auto;
	flex: 1;
}

main h2 {
	font-size: 2rem;
	margin-bottom: 1rem;
	color: var(--heading-color);
}

main p {
	margin-bottom: 1.5rem;
	color: var(--text-color);
}

table {
	justify-self: center;
	width: 100%;
	text-align: center;
	transition: ease 0.3s;
	gap: 0px;
	border-color: var(--card-border);
}

td {
	transition: ease 0.3s;
	border-color: var(--card-border);
}
#gameselection {
	justify-self: center;
	width: 75%;
	overflow: hidden;
	border-radius: 30px;
	border-color: var(--card-border);
}

tr {
	transition: ease 0.3s;
	&:hover {
		background-color: #0d0b14;
	}
}
a {
	text-decoration: none;
	color: var(--text-color);
}

/* cursor style on buttons(a)*/
.pongbtn {
	background-color: #4caf50 !important;
	border: none !important;
	opacity: 0.7;

	&:hover {
		cursor: not-allowed;
		background-color: #45a049 !important;
		opacity: 0.7;
		transform: none !important;
	}
}

.tttbtn {
	background-color: #4caf50 !important;
	border: none !important;
}

/* Card styling */
.card {
	background-color: var(--card-bg);
	border: 1px solid var(--card-border);
	transition: all 0.3s ease;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.card-body {
	padding: 1.5rem;
}

.card-title {
	color: var(--heading-color);
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1rem;
}

.card-text {
	color: var(--muted-text);
	font-size: 1rem;
	line-height: 1.5;
	margin-bottom: 1.5rem;
}

/* Button styling */
.btn-primary {
	background: linear-gradient(145deg, #4caf50, #45a049) !important;
	border: none !important;
	padding: 0.8rem 1.5rem !important;
	font-weight: 500 !important;
	letter-spacing: 0.5px;
	transition: all 0.3s ease !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.btn-primary:hover {
	transform: translateY(-2px) !important;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
	background: linear-gradient(145deg, #45a049, #409444) !important;
}

.pongbtn {
	background: linear-gradient(145deg, #4caf50, #45a049) !important;
	opacity: 0.7 !important;
	box-shadow: none !important;
}

.pongbtn:hover {
	cursor: not-allowed !important;
	transform: none !important;
	box-shadow: none !important;
	opacity: 0.7 !important;
}

/* Play button styling */
.btn-primary {
	background-color: #4caf50 !important;
	border: none !important;
	transition: all 0.3s ease;
}

.btn-primary:hover {
	background-color: #45a049 !important;
	transform: translateY(-2px);
}

/* Loading Screen Styles */
#loading-screen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--bg-color);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 9999;
	transition: opacity 0.5s;
}

.loading-content {
	text-align: center;
	color: var(--text-color);
}

.loading-content h4 {
	color: var(--heading-color);
	margin-top: 1rem;
}

.loading-spinner {
	width: 50px;
	height: 50px;
	border: 5px solid #f3f3f3;
	border-top: 5px solid #3498db;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Welcome section */
.display-4 {
	color: var(--heading-color);
	font-weight: 600;
	margin-bottom: 1.5rem;
}

.lead.text-muted {
	color: var(--muted-text) !important;
	font-size: 1.1rem;
	line-height: 1.6;
	max-width: 800px;
	margin: 0 auto;
}

/* Sliding text animation */
.sliding-text {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	position: relative;
	cursor: none;
}

.sliding-text span {
	position: relative;
	display: inline-block;
	background: linear-gradient(
		90deg,
		#1f7e56 0%,
		#148fa5 var(--x, 0%),
		var(--heading-color) var(--x, 0%),
		var(--heading-color) 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-weight: 700;
	transition: --x 0.1s ease;
}

.sliding-text:hover span {
	background-position: 0 0;
}

/* Mobile Sidebar Styles */
.mobile-sidebar {
	position: fixed;
	top: 0;
	left: -250px;
	width: 250px;
	height: 100vh;
	background-color: var(--nav-bg);
	z-index: 1050;
	transition: left 0.3s ease-in-out;
	box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

.mobile-sidebar.active {
	left: 0;
}

#sidebar-header {
	margin: 0;
	padding: 8px;
	color: #f8f8f8;
	box-shadow: inset 0.5px 0.5px 15px rgba(0, 0, 0, 0.712);
	border-radius: 8px;
	background-color: #00000057;
	width: 80%;
	text-align: center;
}

.sidebar-header {
	padding: 1rem;
	background-color: var(--nav-bg);
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: var(--nav-text);
}

.sidebar-content {
	padding: 1rem 0;
}

.sidebar-item {
	display: block;
	padding: 0.75rem 1rem;
	color: var(--nav-text);
	text-decoration: none;
	transition: background-color 0.2s;
}

.sidebar-item:hover {
	background-color: var(--hover-bg);
	color: var(--nav-text);
}

/* Overlay when sidebar is open */
.sidebar-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1040;
}

.sidebar-overlay.active {
	display: block;
}

/* Footer Styling */
footer {
	background: var(--bg-color);
	color: var(--text-color);
	text-align: center;
	padding: 1rem 0;
	width: 100%;
	border-top: 1px solid var(--card-border);
}

footer p {
	margin: 0;
	font-size: 0.9rem;
	color: var(--text-color);
}

/* Theme Switch styling */
.theme-switch-wrapper {
	display: flex;
	align-items: center;
	color: var(--text-color);
}

.theme-switch {
	display: inline-block;
	height: 24px;
	position: relative;
	width: 48px;
}

.theme-switch input {
	display: none;
}

.slider {
	background-color: #ccc;
	bottom: 0;
	cursor: pointer;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
	transition: 0.4s;
}

.slider:before {
	background-color: #fff;
	bottom: 4px;
	content: "";
	height: 16px;
	left: 4px;
	position: absolute;
	transition: 0.4s;
	width: 16px;
}

.slider.round {
	border-radius: 34px;
}

.slider.round:before {
	border-radius: 50%;
}

input:checked + .slider {
	background-color: #4caf50;
}

input:checked + .slider:before {
	transform: translateX(24px);
}

/* Responsive Design */
@media (max-width: 768px) {
	header h1 {
		font-size: 2rem;
	}

	nav a {
		padding: 0.5rem 1rem;
	}

	main {
		padding: 1rem;
	}

	.navbar-toggler {
		border: none;
		padding: 0.5rem;
	}

	.navbar-toggler:focus {
		box-shadow: none;
	}
}

/* Hide cursor on all interactive elements */
button, a, input, select, textarea, [role="button"], [tabindex] {
	cursor: none !important;
}

@media (min-width: 601px) {
	.custom-cursor {
		position: fixed;
		width: 30px;
		height: 30px;
		background-color: white;
		border-radius: 50%;
		pointer-events: none;
		mix-blend-mode: difference;
		transform: translate(-50%, -50%);
		z-index: 2147483647; /* Maximum z-index value */
		will-change: transform;
	}
}

@media (max-width: 600px) {
	body {
		cursor: auto;
	}
	
	button, a, input, select, textarea, [role="button"], [tabindex] {
		cursor: pointer !important;
	}
	
	.custom-cursor {
		display: none;
	}
}
