@import url("https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&display=swap");

/* ============================================
   CSS VARIABLES - DARK THEME (DEFAULT)
   ============================================ */
:root {
	/* Color Palette - Dark Theme */
	--bg-primary: #1e1e1e;
	--bg-secondary: #252526;
	--bg-tertiary: #2d2d30;
	--border: #3e3e42;

	--text-primary: #d4d4d4;
	--text-secondary: #858585;

	--accent-blue: #007acc;
	--accent-blue-hover: #1177bb;

	/* Syntax Highlighting Colors */
	--color-keyword: #569cd6;
	--color-variable: #9cdcfe;
	--color-string: #ce9178;
	--color-number: #b5cea8;
	--color-comment: #6a9955;
	--color-property: #9cdcfe;
	--color-function: #dcdcaa;
	--color-operator: #d4d4d4;
	--color-punctuation: #d4d4d4;
	--color-class: #4ec9b0;
	--color-header: #569cd6;
}

/* ============================================
   LIGHT THEME VARIABLES
   ============================================ */
[data-theme="light"] {
	/* Color Palette - Light Theme */
	--bg-primary: #b0b5bc;
	--bg-secondary: #a1a6ad;
	--bg-tertiary: #92979e;
	--border: #7a7f85;

	--text-primary: #000000;
	--text-secondary: #1a1c1e;

	--accent-blue: #004a99;
	--accent-blue-hover: #003366;

	/* Syntax Highlighting Colors - Light Theme */
	--color-keyword: #800000;
	--color-variable: #000080;
	--color-string: #004d00;
	--color-number: #663300;
	--color-comment: #333d47;
	--color-property: #4b0082;
	--color-function: #4a3500;
	--color-operator: #000000;
	--color-punctuation: #000000;
	--color-class: #004d4d;
	--color-header: #002d5e;
	letter-spacing: 0.3px;
}

/* ============================================
   GLOBAL RESET
   ============================================ */

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

/* ============================================
   BODY & LAYOUT GRID
   ============================================ */

body {
	font-family: "Fira Code", monospace;
	background-color: var(--bg-primary);
	color: var(--text-primary);
	height: 100vh;
	overflow: hidden;
	display: grid;
	grid-template-columns: 48px 250px 1fr;
	grid-template-rows: 35px 1fr;
	grid-template-areas:
		"aside nav header"
		"aside nav main";
	line-height: 1.5;
	opacity: 0;
	transition: opacity 0.3s ease;
}

body.page-loaded {
	opacity: 1;
}

/* ============================================
   HEADER SECTION
   ============================================ */
header {
	grid-area: header;
	background-color: var(--bg-secondary);
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid var(--border);
	font-size: 13px;
	gap: 5px;
}

header p {
	margin: 0;
	color: var(--text-primary);
}

header a {
	color: var(--accent-blue);
	text-decoration: none;
}

header a:hover {
	text-decoration: underline;
	color: var(--text-primary);
}

.file-name {
	background-color: var(--bg-primary);
	padding: 5px 20px;
	border-right: 1px solid var(--border);
	color: var(--text-primary);
	display: flex;
	align-items: center;
	min-width: 0;
	cursor: pointer;
	transition: transform 0.1s ease;
}

.file-name p {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.file-name-bounce {
	transform: scale(1.1);
}

.blue-bg {
	background-color: var(--accent-blue);
	padding: 5px 20px;
	color: white;
	flex-shrink: 0;
	z-index: 1;
}

.blue-bg a {
	color: white;
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
aside {
	grid-area: aside;
	background-color: var(--bg-secondary);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 30px 0;
	gap: 20px;
	border-right: 1px solid var(--border);
}

aside img {
	width: 35px;
	height: 35px;
	opacity: 0.7;
	transition: opacity 0.2s;
	filter: invert(1);
	padding: 5px;
}

.files {
	border-left: 3px solid var(--accent-blue);
}

aside img:hover {
	opacity: 1;
}

[data-theme="light"] aside img {
	filter: none;
	transition: filter 0.3s ease;
}

/* ============================================
   FILE TREE NAVIGATION
   ============================================ */
nav {
	grid-area: nav;
	background-color: var(--bg-secondary);
	overflow-y: auto;
	border-right: 1px solid var(--border);
	font-size: 13px;
}

nav ul {
	list-style: none;
	padding: 10px 0;
}

nav li {
	padding: 4px 20px 4px 8px;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: background-color 0.2s;
	color: var(--text-secondary);
}

nav li a:hover {
	color: var(--accent-blue);
}

nav li a {
	color: inherit;
	text-decoration: none;
}

nav li a:hover {
	color: var(--accent-blue);
}

/* Active page styling - BLUE BACKGROUND */
nav li a.active {
	color: white;
	background-color: var(--accent-blue);
}

nav li.active {
	background-color: var(--accent-blue);
	color: white;
}

nav li.active a {
	color: white;
}

nav li.map {
	font-weight: bold;
	font-size: 11px;
	text-transform: uppercase;
	padding-top: 15px;
	padding-bottom: 8px;
	cursor: default;
}

nav li.map:hover {
	background-color: transparent;
}

nav li::before {
	content: "";
	display: inline-block;
	width: 16px;
	height: 16px;
	margin-right: 8px;
	vertical-align: middle;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

nav li.map::before {
	background-image: url("./Images/frame.png");
}

nav li.md::before {
	background-image: url("./Images/frame2.png");
}

nav li.js::before {
	background-image: url("./Images/js.png");
}

nav li.json::before {
	background-image: url("./Images/Frame3.svg");
}

nav li.html::before {
	background-image: url("./Images/html.png");
}

nav li:nth-child(1) {
	padding-left: 8px;
}
nav li:nth-child(2),
nav li:nth-child(3) {
	padding-left: 24px;
}
nav li:nth-child(4) {
	padding-left: 24px;
}
nav li:nth-child(5) {
	padding-left: 40px;
}
nav li:nth-child(6),
nav li:nth-child(7) {
	padding-left: 56px;
}
nav li:nth-child(8) {
	padding-left: 40px;
}
nav li:nth-child(9),
nav li:nth-child(10),
nav li:nth-child(11) {
	padding-left: 56px;
}
nav li:nth-child(12),
nav li:nth-child(13),
nav li:nth-child(14),
nav li:nth-child(15) {
	padding-left: 24px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
main {
	grid-area: main;
	background-color: var(--bg-primary);
	overflow-y: auto;
	padding: 30px 40px;
	line-height: 1.7;
}

nav::-webkit-scrollbar,
main::-webkit-scrollbar {
	width: 10px;
}

nav::-webkit-scrollbar-track,
main::-webkit-scrollbar-track {
	background: var(--bg-secondary);
}

nav::-webkit-scrollbar-thumb,
main::-webkit-scrollbar-thumb {
	background: var(--bg-tertiary);
	border-radius: 5px;
}

nav::-webkit-scrollbar-thumb:hover,
main::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* ============================================
   TYPOGRAPHY STYLES
   ============================================ */
.title {
	font-size: 40px;
	margin-bottom: 20px;
	font-weight: 500;
}

.subtitle {
	font-size: 30px;
	margin: 30px 0 15px 0;
	font-weight: 400;
}

p {
	margin-bottom: 15px;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.8;
}
.indent-1 {
	padding-left: 30px;
}

/* ============================================
   SYNTAX HIGHLIGHTING COLORS
   ============================================ */
.color1 {
	color: var(--color-header);
}
.color2 {
	color: var(--color-variable);
}
.color3 {
	color: var(--color-punctuation);
}
.color4 {
	color: var(--color-keyword);
}
.color5 {
	color: var(--color-string);
}
.color6 {
	color: var(--color-comment);
}
.color7 {
	color: var(--text-primary);
}
.color8 {
	color: var(--color-comment);
}
.color9 {
	color: var(--color-comment);
}
.color10 {
	color: var(--color-operator);
}
.color11 {
	color: var(--color-function);
}

.facts {
	padding-left: 30px;
}

.contact .color1 {
	padding-left: 25px;
}

a {
	color: var(--accent-blue);
	text-decoration: none;
	transition: color 0.2s;
}

a:hover {
	color: var(--accent-blue-hover);
	text-decoration: underline;
}

.color5 a {
	color: var(--color-string);
}

.color5 a:hover {
	text-decoration: underline;
}

/* ============================================
   IMAGES
   ============================================ */
img,
.portfolio-img {
	width: 100%;
	max-height: 500px;
	object-fit: cover;
	border-radius: 8px;
	margin: 20px auto;
}

.hero-img {
	width: 100%;
	max-width: 400px;
	height: auto;
	opacity: 1;
}

article img {
	max-height: 250px;
	width: 100%;
	object-fit: cover;
}

.portfolio-img {
	max-height: 500px;
	max-width: 100%;
}

.code-container {
	background-color: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: 5px;
	padding: 20px;
	margin: 20px 0;
	overflow-x: auto;
}

pre {
	margin: 0;
}

code {
	font-size: 14px;
	line-height: 1.6;
}

/* ============================================
   TIMELINE COMPONENT
   ============================================ */
.timeline {
	position: relative;
	padding-left: 30px;
}

.event {
	position: relative;
	padding: 10px 0 10px 20px;
	border-left: 2px solid var(--accent-blue);
	margin-bottom: 15px;
	font-size: 14px;
}

.event::before {
	content: "";
	position: absolute;
	left: -6px;
	top: 15px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: var(--accent-blue);
	border: 2px solid var(--bg-primary);
}

::selection {
	background-color: var(--accent-blue);
	color: white;
}

a:focus,
button:focus {
	outline: 2px solid var(--accent-blue);
	outline-offset: 2px;
}

article {
	margin-bottom: 40px;
}

article:last-child {
	margin-bottom: 0;
}

/* ============================================
   HAMBURGER BUTTON
   ============================================ */
.hamburger {
	display: none;
	flex-direction: column;
	justify-content: space-between;
	width: 30px;
	height: 25px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 1001;
	margin: 8px 10px;
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

.hamburger:hover {
	transform: scale(1.1);
}

.hamburger span {
	width: 100%;
	height: 3px;
	background: var(--text-primary);
	border-radius: 10px;
	transition: all 0.3s ease;
	transform-origin: center;
}

.hamburger.active span:nth-child(1) {
	transform: translateY(11px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
	opacity: 0;
	transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
	transform: translateY(-11px) rotate(-45deg);
}
.hamburger.floating {
	position: absolute;
	left: 10px;
	top: 10px;
	z-index: 1001;
	margin: 0;
}

/* ============================================
   MENU OVERLAY
   ============================================ */
.menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: 999;
	backdrop-filter: blur(4px);
}

.menu-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* ============================================
   MOBILE NAVIGATION 
   ============================================ */
body.menu-open nav {
	transform: translateX(0) !important;
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

body.menu-open {
	overflow: hidden;
}

nav.mobile-open {
	padding-top: 60px;
}

nav.mobile-open ul {
	padding-bottom: 30px;
}

/* ============================================
   EASTER EGG BADGE
   ============================================ */
.secret-badge {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--bg-secondary);
	color: var(--text-primary);
	padding: 10px 20px;
	border-radius: 5px;
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 1002;
	white-space: nowrap;
	font-size: 14px;
	max-width: 90vw;
	text-align: center;
	border: 2px solid var(--accent-blue);
}

.secret-badge.show {
	opacity: 1;
}

.rainbow-border {
	animation: rainbow-border 2s linear infinite;
}

@keyframes rainbow-border {
	0% {
		border-right-color: #ff6b6b;
	}
	14% {
		border-right-color: #4ecdc4;
	}
	28% {
		border-right-color: #45b7d1;
	}
	42% {
		border-right-color: #ffa07a;
	}
	57% {
		border-right-color: #98d8c8;
	}
	71% {
		border-right-color: #f7dc6f;
	}
	85% {
		border-right-color: #bb8fce;
	}
	100% {
		border-right-color: #ff6b6b;
	}
}

/* ============================================
   THEME TOGGLE BUTTON (FROM JS)
   ============================================ */
.theme-toggle {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: var(--accent-blue);
	border: 2px solid var(--border);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
	transition: all 0.3s ease;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.theme-toggle:hover {
	transform: scale(1.1);
	background: var(--accent-blue-hover);
}

.theme-toggle svg {
	width: 24px;
	height: 24px;
	fill: white;
}

.theme-toggle .sun-icon {
	display: none;
}

.theme-toggle-spin {
	transform: rotate(360deg);
}

[data-theme="light"] .theme-toggle .sun-icon {
	display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
	display: none;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 1200px) {
	.hero-img {
		max-width: 350px;
	}

	main {
		padding: 25px 30px;
	}
}

@media (max-width: 1024px) {
	body {
		grid-template-columns: 48px 200px 1fr;
	}

	nav {
		font-size: 13px;
	}

	.title {
		font-size: 32px;
	}

	.subtitle {
		font-size: 24px;
	}

	.hero-img {
		max-width: 300px;
	}
}

/* ============================================
   TABLET LAYOUT (481px - 768px)
   ============================================ */
@media (max-width: 768px) and (min-width: 481px) {
	body {
		grid-template-columns: 48px 1fr;
		grid-template-areas:
			"aside header"
			"aside main";
		grid-template-rows: auto 1fr;
	}

	nav {
		display: none;
		font-size: 12px;
	}

	aside {
		display: flex;
		padding: 50px 0;
	}

	header {
		padding: 0;
		flex-direction: column;
		flex-wrap: wrap;
		height: auto;
		align-items: stretch;
		gap: 0;
	}

	.hamburger {
		display: flex;
		margin: 8px 10px;
		order: 0;
		margin-left: 5px;
		margin-right: 5px;
	}

	.file-name {
		flex: 1;
		min-width: 0;
		padding: 8px 5px;
		font-size: 13px;
		border-bottom: none;
		border-right: none;
		order: 1;
	}

	.file-name p {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		font-size: 13px;
	}

	.blue-bg {
		width: 100%;
		order: 3;
		text-align: center;
	}

	.blue-bg p {
		font-size: 13px;
		display: block !important;
		margin: 0;
	}

	main {
		padding: 20px;
	}

	.title {
		font-size: 28px;
	}

	.subtitle {
		font-size: 22px;
	}

	.hero-img {
		max-width: 280px;
	}

	.facts {
		padding-left: 15px;
	}

	.code-container {
		padding: 15px;
		font-size: 12px;
	}

	.secret-badge {
		font-size: 12px;
		padding: 8px 16px;
		bottom: 80px;
	}
}

/* ============================================
   MOBILE LAYOUT (max 768px)
   ============================================ */
@media (max-width: 768px) {
	body {
		grid-template-columns: 48px 1fr;
		grid-template-areas:
			"aside header"
			"aside main";
	}

	nav {
		position: fixed;
		top: 0;
		left: 0;
		height: 100%;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		z-index: 1000;
		overflow-y: auto;
		display: block;
	}

	.hamburger-visible {
		display: flex !important;
	}

	main {
		padding: 20px;
	}

	header {
		padding: 0;
		flex-direction: row;
		flex-wrap: wrap;
		height: auto;
		align-items: stretch;
	}

	.file-name {
		width: 100%;
		border-right: none;
		border-bottom: 1px solid var(--border);
		padding: 5px 30px;
		cursor: pointer;
	}

	.blue-bg {
		width: 100%;
		padding: 5px 10px;
		font-size: 11px;
	}

	.title {
		font-size: 28px;
	}

	.subtitle {
		font-size: 22px;
	}

	.hero-img {
		max-width: 250px;
	}

	.facts {
		padding-left: 15px;
	}
}

/* ============================================
   SMALL MOBILE (max 480px)
   ============================================ */
@media (max-width: 480px) {
	body {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"header"
			"main";
	}

	aside {
		display: none;
	}

	header {
		padding: 0;
		flex-direction: row;
		flex-wrap: wrap;
		height: auto;
		align-items: stretch;
	}

	.hamburger {
		margin-left: 5px;
		margin-right: 5px;
	}

	.file-name {
		flex: 1;
		min-width: 0;
		padding: 8px 30px;
		font-size: 12px;
		border-bottom: none;
		border-right: none;
	}

	.file-name p {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.blue-bg {
		width: 100%;
		padding: 5px 10px;
		font-size: 10px;
		order: 3;
		text-align: center;
	}

	.blue-bg p {
		font-size: 10px;
	}

	main {
		padding: 15px;
	}

	.title {
		font-size: 24px;
	}

	.subtitle {
		font-size: 20px;
	}

	p {
		font-size: 13px;
	}

	.hero-img {
		max-width: 200px;
	}

	.facts {
		padding-left: 10px;
	}

	.code-container {
		padding: 15px;
		font-size: 12px;
	}

	.theme-toggle {
		width: 40px;
		height: 40px;
		bottom: 10px;
		right: 10px;
	}
}

@media (max-width: 360px) {
	.title {
		font-size: 20px;
	}

	.subtitle {
		font-size: 18px;
	}

	p {
		font-size: 12px;
	}

	.hero-img {
		max-width: 180px;
	}

	.blue-bg {
		font-size: 9px;
		padding: 5px 8px;
	}

	.blue-bg p {
		font-size: 9px;
	}
	.file-name {
		padding: 8px 30px;
		font-size: 11px;
	}
}

@media (max-width: 768px) {
	.theme-toggle {
		width: 45px;
		height: 45px;
		bottom: 15px;
		right: 15px;
	}

	.theme-toggle svg {
		width: 20px;
		height: 20px;
	}
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
	aside,
	nav,
	.hamburger,
	.blue-bg,
	.theme-toggle,
	.menu-overlay {
		display: none !important;
	}

	body {
		grid-template-columns: 1fr;
		grid-template-areas: "main";
		background: white;
		color: black;
	}

	main {
		padding: 20px;
	}

	a {
		color: #000;
		text-decoration: underline;
	}

	img {
		max-width: 100%;
		page-break-inside: avoid;
	}
}

/* ============================================
   ACCESSIBILITY - FOCUS INDICATORS
   ============================================ */
*:focus-visible {
	outline: 2px solid var(--accent-blue);
	outline-offset: 2px;
	border-radius: 2px;
}
