/* Define CSS Variables */
:root {
	/* Core Colors */
	--primary-color: #007bff;
	--secondary-color: #0056b3;
	--background-color: #181a1b;
	--light-background: #272a2c;
	--text-color: #f0f7ff;
	--border-color: var(--primary-color);

	/* Component Colors */
	--header-footer-background: var(--light-background);
	--card-background: var(--light-background);

	/* Interactive Colors */
	--hover-color: #e9ecef;
	--correct-color: #1abc9c;
	--incorrect-color: #dc3545;

	/* Shadows */
	--shadow-color: rgba(0, 0, 0, 0.1);
	--shadow-color-dark: rgba(0, 0, 0, 0.2);
}

/* Reset some default styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* Base Styles */
html {
	font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, serif;
	color: var(--text-color);
	background-color: var(--background-color);
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	line-height: 1.6;
	padding-top: 70px;
}

/* Header Styling */
header {
	position: fixed;
	top: 0;
	width: 100%;
	background-color: var(--header-footer-background);
	box-shadow: 0 2px 5px var(--shadow-color);
	z-index: 1000;
	display: flex;
	align-items: center;
	padding: 0 20px;
	height: 65px;
}

header nav {
	display: flex;
	gap: 10px;
	align-items: center;
}

header nav a {
	text-decoration: none;
	color: var(--text-color);
	font-size: 1rem;
	transition: color 0.3s, background-color 0.3s, transform 0.2s;
	padding: 6px 12px;
	border-radius: 5px;
	background-color: var(--light-background);
	border: 1px solid var(--border-color);
}

header nav a:hover {
	color: var(--text-color);
	background-color: var(--secondary-color);
	transform: translateY(-2px);
}

header .nav-right {
	margin-left: auto;
}

header .nav-left {
	margin-left: 20px;
}

/* Navigation Styling */
.navigation {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: var(--background-color);
	padding: 10px 20px;
	box-shadow: 0 2px 5px var(--shadow-color);
	margin: 20px;
}

.navigation a {
	text-decoration: none;
	color: var(--text-color);
	margin: 0 15px;
	font-size: 1.2rem;
	transition: color 0.3s, background-color 0.3s;
	padding: 10px 15px;
	border-radius: 5px;
	background-color: var(--light-background);
	border: 2px solid var(--border-color);
}

.navigation a:hover {
	color: var(--text-color);
	background-color: var(--primary-color);
}

/* Footer Styling */
footer {
	background-color: var(--header-footer-background);
	padding: 20px;
	border-top: 1px solid var(--border-color);
	box-shadow: 0 -2px 5px var(--shadow-color);
	width: 100%;
	margin-top: auto;
	display: flex;
	justify-content: center;
	align-items: center;
	color: var(--text-color);
}

footer a {
	text-decoration: none;
	color: var(--text-color);
	padding: 0 15px;
	font-size: 0.9rem;
	transition: color 0.3s;
	position: relative;
}

footer a:not(:last-child)::after {
	content: "|";
	position: absolute;
	right: -3px;
	color: var(--border-color);
}

footer a:hover {
	color: var(--hover-color);
}

/* Container and Layout */
.container {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
}

.main {
	flex: 1;
	padding: 100px 20px 40px;
	max-width: 1200px;
	margin: 0 auto;
	text-align: center;
}

/* Course Cards */
.courses {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 40px;
}

.course-card {
	background-color: var(--card-background);
	border: 1px solid var(--border-color);
	border-radius: 10px;
	width: 300px;
	padding: 20px;
	box-shadow: 0 2px 5px var(--shadow-color);
	transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 4px 10px var(--shadow-color-dark);
}

.course-card h2 {
	color: var(--primary-color);
	margin-bottom: 15px;
}

.course-card p {
	font-size: 1rem;
	margin-bottom: 20px;
}

/* Buttons and Interactive Elements */
button,
.button {
	display: inline-block;
	padding: 10px 20px;
	background-color: var(--primary-color);
	color: white;
	border: none;
	border-radius: 5px;
	text-decoration: none;
	font-size: 1rem;
	transition: background-color 0.3s, transform 0.2s;
	cursor: pointer;
}

button:hover,
.button:hover {
	background-color: var(--secondary-color);
	transform: translateY(-2px);
}

/* Common styles for buttons */
.button,
.quiz-button {
	display: inline-block;
	margin-top: 20px;
	padding: 10px 20px;
	font-size: 1.2rem;
	color: var(--text-color);
	background-color: var(--primary-color);
	border: none;
	border-radius: 5px;
	text-decoration: none;
	cursor: pointer;
}

.button:hover,
.quiz-button:hover {
	background-color: var(--secondary-color);
}

/* Completed state styles */
.completed {
	border-color: #28a745 !important; /* Green border for completed */
}

.completed .button {
	background-color: #28a745 !important; /* Green button for completed */
	border-color: #28a745 !important; /* Green border for button */
}

/* Practice and Quiz Elements */
.practice-section {
	margin-top: 40px;
	padding: 20px;
	background-color: var(--light-background);
	border-radius: 8px;
	box-shadow: 0 2px 5px var(--shadow-color);
}

.practice-area,
.bordered-box {
	width: 100%;
	min-height: 100px;
	border: 2px solid var(--border-color);
	color: var(--text-color);
	border-radius: 5px;
	padding: 10px;
	margin-top: 10px;
	font-size: 1rem;
	outline: none;
	background-color: var(--background-color);
}

.answer-input {
	width: 100px;
	padding: 5px;
	font-size: 1rem;
	margin-left: 10px;
	border: 2px solid var(--border-color);
	color: var(--text-color);
	outline: none;
	background-color: var(--background-color);
	border-radius: 5px;
}

.feedback {
	margin-top: 10px;
	font-size: 0.9rem;
	color: var(--incorrect-color);
}

/* Typography */
h1,
h2 {
	margin-bottom: 15px;
	color: var(--primary-color);
}

h1 {
	font-size: 2.5rem;
	text-align: center;
	margin-bottom: 30px;
}

h2 {
	font-size: 1.8rem;
	margin-top: 25px;
}

p {
	margin-bottom: 15px;
	font-size: 1rem;
}

/* Lists */
ul {
	list-style-type: disc;
	margin-left: 20px;
	margin-bottom: 15px;
}

li {
	margin-bottom: 10px;
}

/* Code Blocks */
code {
	background-color: var(--light-background);
	padding: 2px 6px;
	border-radius: 4px;
	font-family: "Courier New", Courier, monospace;
}

/* Images */
.list-image {
	max-width: 100%;
	height: auto;
	margin-top: 10px;
	border-radius: 8px;
	box-shadow: 0 2px 5px var(--shadow-color);
}

/* Responsive Design */
@media (max-width: 768px) {
	.courses {
		flex-direction: column;
		align-items: center;
	}

	.course-card {
		width: 90%;
	}

	h1 {
		font-size: 2rem;
	}

	h2 {
		font-size: 1.5rem;
	}

	nav button {
		font-size: 1rem;
	}

	.button {
		width: 100%;
		text-align: center;
	}
}

/* Quiz Container */
#quiz {
	max-width: 800px;
	margin: 20px auto;
	padding: 20px;
}

#quiz .card {
	margin-bottom: 20px;
}

#quiz button {
	margin: 20px auto;
	display: block;
}

/* Quiz Section Styles */
.quiz-section {
	margin-top: 40px;
	padding: 20px;
	background-color: var(--light-background);
	border: 2px solid var(--primary-color);
	border-radius: 10px;
	text-align: center;
}

.quiz-section h2 {
	font-size: 2rem;
	color: var(--primary-color);
}

.quiz-section p {
	font-size: 1.2rem;
	color: var(--text-color);
}

.quiz-section .quiz-button {
	display: inline-block;
	margin-top: 20px;
	padding: 10px 20px;
	font-size: 1.2rem;
	color: var(--text-color);
	background-color: var(--primary-color);
	border: 1px solid var(--border-color);
	border-radius: 5px;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.3s, transform 0.2s;
}

.quiz-section .quiz-button:hover {
	background-color: var(--secondary-color);
	transform: translateY(-2px);
}

/* Global transition for smooth theme changes */
body,
.container,
header,
footer,
.certificate,
.practice-section,
.bordered-box,
.answer-input,
.course-card,
nav a {
	transition: background-color 0.3s ease, color 0.3s ease,
		border-color 0.3s ease;
}

/* Quiz Styles */
.bordered-box:focus {
	border: 2px solid var(--primary-color);
}

.submit-button {
	margin-top: 30px;
}

.certificate-button {
	display: block;
	margin: 20px auto;
	padding: 10px 20px;
	background-color: var(--primary-color);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 5px;
	cursor: pointer;
	font-size: 16px;
	transition: background-color 0.3s, transform 0.2s;
}

.certificate-button:hover {
	background-color: var(--secondary-color);
	transform: translateY(-2px);
}

.name-dialog {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.name-dialog-content {
	background-color: var(--card-background-color);
	color: var(--text-color);
	padding: 30px;
	border-radius: 10px;
	text-align: center;
	max-width: 400px;
	width: 90%;
	border: 1px solid var(--border-color);
	box-shadow: 0 4px 10px var(--card-box-shadow);
}

.name-dialog-content h2 {
	color: var(--primary-color);
	margin-bottom: 15px;
}

.name-dialog-content input {
	width: 100%;
	padding: 10px;
	margin: 15px 0;
	border: 1px solid var(--border-color);
	border-radius: 5px;
	background-color: var(--light-background);
	color: var(--text-color);
}

.name-dialog-content input:focus {
	outline: none;
	border-color: var(--primary-color);
}

.dialog-buttons {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 20px;
}

.name-dialog-content button {
	padding: 10px 20px;
	background-color: var(--primary-color);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 5px;
	cursor: pointer;
	transition: background-color 0.3s, transform 0.2s;
}

.name-dialog-content button:hover {
	background-color: var(--secondary-color);
	transform: translateY(-2px);
}

.cancel-button {
	background-color: var(--light-background) !important;
}

.cancel-button:hover {
	background-color: var(--background-color) !important;
}

/* Fade-in Animation */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.fade-in {
	animation: fadeIn 1s ease-out;
}

/* About page styles */
.about-section {
	margin: 2rem 0;
	padding: 1.5rem;
	background-color: #ffffff;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.about-section h2 {
	color: #333;
	margin-bottom: 1rem;
}

.about-section ul {
	list-style-type: disc;
	margin-left: 2rem;
	margin-top: 0.5rem;
}

.about-section li {
	margin-bottom: 0.5rem;
	color: #555;
}
