/* Base Variables */
:root {
	--header-text: #FFB905;        /* Lighter yellow for header text */
	--primary: #FFB905;            /* Complementary blue for primary color */
	--secondary: #181A1B;
	--accent: #d39803;             /* Lighter blue for accent */
	--background: #1E2122;         /* More amber tinted background */
	--card-bg: #26292A;            /* Warmer card background */
	--text: #CBCAC7;
	--text-light: #CBCAC7;
	--border: #928068;             /* Darker separator color */
	--transition-speed: 0.3s;
	--elastic-transition: 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Elastic transition */
	--border-radius: 8px;
	--shadow: 0 15px 15px rgba(0, 0, 0, 0.4);
	--shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.4);
}

/* Reset and Base Styles */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
		
body {
	font-family: 'Roboto Mono', Tahoma, Geneva, Verdana, sans-serif;
	background-color: var(--background);
	color: var(--text);
	line-height: 1.35;
	font-size: 1.2rem;
	transition: background-color var(--transition-speed), color var(--transition-speed);
}

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

/* Header Styles */
header {
	background-color: var(--secondary); /* Yellow header background */
	padding: 20px 0;
	margin-bottom: 30px;
	box-shadow: var(--shadow);
	position: sticky;
	top: 0;
	z-index: 100;
}
		
header .container {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

header h1 {
	color: var(--header-text); /* Yellow text in header */
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); /* Text shadow for better readability */
}

/* Typography */
h1 {
	color: var(--primary); /* Yellow text in header */
	font-size: 2.2rem;
	margin-bottom: 10px;
}
		
h2 {
	color: var(--primary); /* Yellow text in header */
	font-size: 1.6rem;
	margin-bottom: 15px;
	border-bottom: 2px solid var(--border); /* Darker separator */
	padding-bottom: 5px;
}

p {
	margin-bottom: 15px;
}

/* Links */
a {
	color: var(--primary);         /* Complementary blue for links */
	text-decoration: none;
	transition: color var(--transition-speed);
}
		
a:hover {
	text-decoration: underline;
	color: var(--accent);
}

/* Introduction Section */
.intro {
	margin-bottom: 40px;
	padding: 20px;
	background-color: var(--card-bg);
	border-radius: var(--border-radius);
	box-shadow: var(--shadow);
	border: 1px solid var(--border);
}
		
.intro p {
	margin-bottom: 15px;
}

/* Categories Navigation */
.categories-nav {
	margin-top: 25px;
	padding-top: 15px;
	border-top: 1px solid var(--border);
}

.categories-nav h2 {
	margin-bottom: 10px;
	font-size: 1.4rem;
}

.categories-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	margin-left: 0;
}

.categories-nav li {
	background-color: var(--primary);
	border-radius: 4px;
	padding: 5px 12px;
	transition: all var(--elastic-transition);
}

.categories-nav li:hover {
	background-color: var(--accent);
	box-shadow: var(--shadow-hover);
}

.categories-nav a {
	color: white;                 /* White text on blue background */
	text-decoration: none;
	font-weight: 500;
}

.categories-nav a:hover {
	text-decoration: none;
}

/* Category Sections */
.category-section {
	margin-bottom: 50px;
	scroll-margin-top: 100px; /* For smooth scrolling with sticky header */
}

.category-section h2 {
	margin-top: 10px;
	padding: 10px 0;
	position: sticky;
	top: 80px;
	background-color: var(--background);
	z-index: 10;
}

/* Card Component */
.card {
	background-color: var(--card-bg);
	border-radius: var(--border-radius);
	box-shadow: var(--shadow);
	margin-bottom: 20px;
	overflow: hidden;
	transition: transform var(--elastic-transition), box-shadow var(--elastic-transition);
	cursor: pointer;
	border: 1px solid var(--border);
}
		
.card:hover {
	box-shadow: var(--shadow-hover);
}

/* Card Header */
.card-header {
	color: var(--header-text); /* Yellow text in header */
	background-color: var(--secondary);
	padding: 15px 20px;
	font-weight: bold;
	font-size: 1.2rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.card-header:hover {
	color: var(--accent); /* Yellow text in header */
}

/* Card Body */
.card-body {
	padding: 20px;
	display: none;
}
		
.card.active .card-body {
	display: block;
}

/* Code Blocks */
.code-block {
	background-color: var(--secondary);
	color: #f8f8f2;
	padding: 15px;
	border-radius: 5px;
	margin: 15px 0;
	overflow-x: auto;
	font-family: 'Consolas', 'Courier New', monospace;
	border: 1px solid var(--border);
}

/* Toggle Icon */
.toggle-icon {
	transition: transform var(--elastic-transition);
}
		
.card.active .toggle-icon {
	transform: rotate(180deg);
}

/* Toggle label */
.toggle-label {
	margin-left: 10px;
	font-size: 0.9rem;
	user-select: none;
	color: #333333;
}

/* Error message */
.error {
	color: #e74c3c;
	padding: 10px;
	border: 1px solid #e74c3c;
	border-radius: var(--border-radius);
	background-color: rgba(231, 76, 60, 0.1);
}

/* Footer */
footer {
	text-align: center;
	margin-top: 50px;
	padding: 20px;
	background-color: var(--background);
	color: var(--text);
	border-top: 1px solid var(--border);
}

footer a {
	color: var(--primary);
	font-weight: bold;
}

/* Lists */
ul, ol {
	margin-left: 20px;
	margin-bottom: 15px;
}

/* Back to Top Button */
.top-button {
	position: fixed;
	bottom: 30px;
	right: 30px;
	background-color: var(--primary);
	color: white;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	transition: all var(--elastic-transition);
	opacity: 0;
	pointer-events: none;
	outline: none;  /* Remove outline when clicked */
	-webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
	user-select: none; /* Prevent text selection */
}
		
.top-button.visible {
	opacity: 1;
	pointer-events: all;
}
		
.top-button:hover {
	background-color: var(--accent);
	transform: translateY(-5px) scale(1.0);
}

.top-button:active {
	transform: translateY(-2px) scale(0.95);
}

/* Theme Transition */
.theme-transition {
	transition: background-color var(--elastic-transition), color var(--elastic-transition);
}

.theme-transition * {
	transition: background-color var(--elastic-transition), color var(--elastic-transition), 
							border-color var(--elastic-transition), box-shadow var(--elastic-transition);
}

/* Responsive Design */
@media (max-width: 768px) {
	.container {
			padding: 15px;
	}
									
	h1 {
			font-size: 1.8rem;
	}
									
	h2 {
			font-size: 1.4rem;
	}
									
	.card-header {
			font-size: 1.1rem;
			padding: 12px 15px;
	}
	
	.categories-nav ul {
			flex-direction: column;
			gap: 5px;
	}
	
	header {
			position: relative;
	}
	
	.category-section h2 {
			position: relative;
			top: 0;
	}
	
	/* Adjust toggle size for mobile */
	:root {
			--toggle-size: 50px;
	}
}