/* CSS Variables for theming */
:root {
	/* Dark Mode Colors */
	--color-bg-primary-dark: #0e0e0e;
	--color-bg-secondary-dark: #1a1a1a;
	--color-bg-secondary-dark-translucent: rgba(26, 26, 26, 0.95); /* For header background */
	--color-text-primary-dark: #f2f2f2;
	--color-text-secondary-dark: #b0b0b0;
	--color-border-dark: #333;
	--color-shadow-dark: rgba(0, 0, 0, 0.6);
	--color-header-bg-dark: rgba(20, 20, 20, 0.9); /* More opaque for sticky */
	--color-toggle-bg-dark: #333;
	--color-iframe-bg-dark: #1c1c1c; /* Slightly different for contrast */

	/* Light Mode Colors */
	--color-bg-primary-light: #f9f9f9;
	--color-bg-secondary-light: #ffffff;
	--color-bg-secondary-light-translucent: rgba(255, 255, 255, 0.95); /* For header background */
	--color-text-primary-light: #222;
	--color-text-secondary-light: #555;
	--color-border-light: #e0e0e0;
	--color-shadow-light: rgba(0, 0, 0, 0.1);
	--color-header-bg-light: rgba(255, 255, 255, 0.9);
	--color-toggle-bg-light: #28a745;
	--color-iframe-bg-light: #f0f0f0;

	/* Accent Colors (Green for consistency) */
	--color-accent-primary: #28a745; /* Your existing green */
	--color-accent-secondary: #218838;
	--color-accent-tertiary: #1e7e34;

	/* Specific Brand Colors for Hover */
	--color-linkedin: #0077b5;
	--color-github: #6e5494;
	--color-email: var(--color-accent-primary); /* Using primary accent for email */

	/* Typography */
	--font-family-primary: 'Inter', sans-serif;
	--font-size-body: 0.5rem;
	--font-size-heading-large: 2.5rem;
	--font-size-heading-medium: 1.8rem;
	--font-size-heading-small: 1.25rem;

	/* Spacing */
	--spacing-unit: 0.5rem;
	--padding-section: 4rem 2rem;
	--max-width: 960px;
	--max-width-main: 1200px;
}

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

body {
	font-family: var(--font-family-primary);
	line-height: 1.6;
	background-color: var(--color-bg-primary-dark);
	color: var(--color-text-primary-dark);
	transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

body.light {
	background-color: var(--color-bg-primary-light);
	color: var(--color-text-primary-light);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--color-text-primary-dark);
	transition: color 0.3s ease-in-out;
}
body.light h1,
body.light h2,
body.light h3,
body.light h4,
body.light h5,
body.light h6 {
	color: var(--color-text-primary-light);
}

a {
	text-decoration: none;
	color: var(--color-accent-primary);
	transition: color 0.25s ease;
}
a:hover {
	color: var(--color-accent-secondary);
}

.container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 2rem;
}

.container-main {
	max-width: var(--max-width-main);
	margin: 0 auto;
	padding: 0 2rem;
}

/* Header */
header {
	padding: 1.5rem 0; /* Adjusted to use container padding */
	background: var(--color-header-bg-dark);
	backdrop-filter: blur(10px);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 2px 10px var(--color-shadow-dark);
	transition: background 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

body.light header {
	background: var(--color-header-bg-light);
	box-shadow: 0 2px 10px var(--color-shadow-light);
}

.header-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.name {
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: 1px;
	user-select: none;
}

/* Desktop-only header elements */
.header-right.desktop-only {
	display: flex;
	align-items: center;
	gap: 1.2rem;
}

.contacts {
	display: flex;
	gap: var(--spacing-unit);
}

.contacts a {
	display: flex;
	align-items: center;
	gap: var(--spacing-unit);
	color: var(--color-text-primary-dark);
	background: var(--color-bg-secondary-dark);
	border: 1px solid var(--color-border-dark);
	padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.9rem;
	transition: all 0.25s ease;
	user-select: none;
	transform: translateY(0); /* For hover effect */
}

.contacts a:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.contacts a svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
	transition: fill 0.25s ease;
}

.contacts a[href*='mailto:']:hover {
	color: var(--color-email);
}
.contacts a[href*='linkedin.com']:hover {
	color: var(--color-linkedin);
}
.contacts a[href*='github.com']:hover {
	color: var(--color-github);
}

body.light .contacts a {
	color: var(--color-text-primary-light);
	background: var(--color-bg-secondary-light);
	border-color: var(--color-border-light);
}
body.light .contacts a:hover {
	box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}
body.light .contacts a[href*='mailto:']:hover {
	color: var(--color-email);
}
body.light .contacts a[href*='linkedin.com']:hover {
	color: var(--color-linkedin);
}
body.light .contacts a[href*='github.com']:hover {
	color: var(--color-github);
}

/* Theme Toggle */
.theme-toggle {
	display: flex;
	align-items: center;
	gap: var(--spacing-unit);
	cursor: pointer;
	user-select: none;
	color: var(--color-text-primary-dark);
	font-weight: 600;
	font-size: 0.9rem;
	transition: color 0.3s ease;
}
body.light .theme-toggle {
	color: var(--color-text-primary-light);
}
.theme-toggle input {
	width: 44px;
	height: 24px;
	position: relative;
	appearance: none;
	background: var(--color-toggle-bg-dark);
	outline: none;
	border-radius: 24px;
	transition: background 0.3s ease;
	cursor: pointer;
	flex-shrink: 0; /* Prevent squishing on small screens */
}
.theme-toggle input:checked {
	background: var(--color-toggle-bg-light);
}
.theme-toggle input::before {
	content: '';
	position: absolute;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	top: 1px;
	left: 1px;
	background: white;
	transform: translateX(0);
	transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bounce effect */
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.theme-toggle input:checked::before {
	transform: translateX(20px);
}
.theme-icon {
	width: 20px;
	height: 20px;
	fill: currentColor;
	pointer-events: none;
}

/* Hero Section */
.hero-section {
	text-align: center;
	padding: var(--padding-section);
	background: linear-gradient(145deg, var(--color-bg-secondary-dark), var(--color-bg-primary-dark));
	border-radius: 16px;
	margin: 3rem auto;
	box-shadow: 0 10px 40px var(--color-shadow-dark);
	transition: background 0.3s ease, box-shadow 0.3s ease;
}
body.light .hero-section {
	background: linear-gradient(145deg, var(--color-bg-secondary-light), var(--color-bg-primary-light));
	box-shadow: 0 10px 40px var(--color-shadow-light);
}

.hero-section h1 {
	font-size: var(--font-size-heading-large);
	margin-bottom: 0.75rem;
	font-weight: 800;
	background: linear-gradient(to right, var(--color-accent-primary), #a7ffbc); /* Glowing gradient */
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	line-height: 1.2;
}
body.light .hero-section h1 {
	background: linear-gradient(to right, var(--color-accent-secondary), #0d9d30);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.hero-section p {
	font-size: 1.15rem;
	max-width: 700px;
	margin: 0 auto 2rem auto;
	color: var(--color-text-secondary-dark);
}
body.light .hero-section p {
	color: var(--color-text-secondary-light);
}

.hero-section .download-btn {
	font-size: 1.15rem;
	padding: 1rem 2.5rem;
	background: linear-gradient(to right, var(--color-accent-primary), var(--color-accent-secondary));
	color: white;
	font-weight: 700;
	border-radius: 10px;
	box-shadow: 0 8px 20px rgba(40, 167, 69, 0.6);
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;

	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	justify-content: center;
}

.hero-section .download-btn:hover {
	background: linear-gradient(to right, var(--color-accent-secondary), var(--color-accent-tertiary));
	box-shadow: 0 10px 25px rgba(33, 136, 56, 0.8);
	transform: translateY(-5px) scale(1.02);
}

.hero-section .download-btn:active {
	transform: translateY(0);
	box-shadow: 0 3px 8px rgba(33, 136, 56, 0.5);
}

.hero-buttons {
	display: flex;
	justify-content: center;
	gap: 1.5rem;
	margin-top: 2rem;
}

/* Main Content Area */
main {
	padding-bottom: 4rem;
}

/* Resume Viewer Card */
.resume-viewer-card {
	background: var(--color-bg-secondary-dark);
	padding: 2.5rem 3rem;
	border-radius: 16px;
	box-shadow: 0 6px 30px var(--color-shadow-dark);
	transition: background 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;

	p {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-start;
	}

	h3 {
		width: 100%;
	}
}
body.light .resume-viewer-card {
	background: var(--color-bg-secondary-light);
	box-shadow: 0 6px 30px var(--color-shadow-light);
}

.iframe-wrapper {
	position: relative;
	width: 100%;
	height: 900px; /* Adjust as needed */
	border-radius: 12px;
	background-color: var(--color-iframe-bg-dark);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
	transition: background-color 0.3s ease;
	overflow: hidden; /* Ensure spinner stays within bounds */
	display: flex;
	justify-content: center;
	align-items: center;
}
body.light .iframe-wrapper {
	background-color: var(--color-iframe-bg-light);
}

/* Loading Spinner */
.spinner {
	border: 5px solid var(--color-border-dark);
	border-top: 5px solid var(--color-accent-primary);
	border-radius: 50%;
	width: 50px;
	height: 50px;
	animation: spin 1s linear infinite;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}
body.light .spinner {
	border-color: var(--color-border-light);
	border-top-color: var(--color-accent-primary);
}
@keyframes spin {
	0% {
		transform: translate(-50%, -50%) rotate(0deg);
	}
	100% {
		transform: translate(-50%, -50%) rotate(360deg);
	}
}

/* Footer */
footer {
	text-align: center;
	padding: 2rem 0;
	font-size: 0.85rem;
	color: var(--color-text-secondary-dark);
	border-top: 1px solid var(--color-border-dark);
	margin-top: 4rem;
	transition: color 0.3s ease, border-color 0.3s ease;
}
body.light footer {
	color: var(--color-text-secondary-light);
	border-color: var(--color-border-light);
}

/* Responsive Adjustments */
/* Mobile Menu Toggle (Hamburger) */
.menu-toggle {
	display: none; /* Hidden by default on desktop */
	flex-direction: column;
	justify-content: space-around;
	width: 30px;
	height: 25px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 101; /* Above mobile nav */
}

.menu-toggle .bar {
	width: 100%;
	height: 3px;
	background-color: var(--color-text-primary-dark);
	border-radius: 5px;
	transition: all 0.3s ease;
}
body.light .menu-toggle .bar {
	background-color: var(--color-text-primary-light);
}

/* Transform hamburger to 'X' */
body.menu-open .menu-toggle .bar:nth-child(1) {
	transform: translateY(11px) rotate(45deg);
}
body.menu-open .menu-toggle .bar:nth-child(2) {
	opacity: 0;
}
body.menu-open .menu-toggle .bar:nth-child(3) {
	transform: translateY(-11px) rotate(-45deg);
}

/* Mobile Navigation Menu */
.mobile-nav {
	display: none; /* Hidden by default */
	flex-direction: column;
	position: fixed;
	top: -100vh; /* Off-screen from top */
	left: 0; /* Align to left */
	width: 100%; /* Make it full width for top slide */
	max-width: 100%; /* Ensure it covers full width */
	height: 100vh; /* Cover full viewport height */
	background-color: var(--color-bg-secondary-dark-translucent); /* Semi-transparent background */
	box-shadow: 0 5px 15px var(--color-shadow-dark); /* Adjust shadow for top slide */
	padding: 5rem 1.5rem 1.5rem; /* Adjust top padding to clear header */
	transition: top 0.3s ease-in-out; /* Transition 'top' property */
	z-index: 99; /* Maintain high z-index */
	gap: 1.5rem; /* Spacing between sections in mobile nav */
	overflow-y: auto; /* Enable scrolling for long content */
	align-items: flex-start; /* Align contents to the left */
}

body.light .mobile-nav {
	background-color: var(--color-bg-secondary-light-translucent); /* Semi-transparent background for light mode */
	box-shadow: 0 5px 15px var(--color-shadow-light);
}

body.menu-open .mobile-nav {
	top: 0; /* Slide in from top */
}

/* Adjust contact and theme toggle within mobile nav */
.mobile-nav .contacts {
	flex-direction: column; /* Stack contact links */
	width: 100%;
	gap: 1rem;
}

.mobile-nav .contacts a {
	width: 100%; /* Full width buttons */
	justify-content: center; /* Center text in stacked buttons */
}

.mobile-nav .theme-toggle {
	width: 100%;
	justify-content: center; /* Center toggle */
	margin-top: 1rem;
}

#pdf-container {
	/* width: 100%;
	max-width: 800px; */
	height: 100%;
	overflow: auto;
	position: absolute;

	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE 10+ */
}

#pdf-container::-webkit-scrollbar {
	display: none; /* Safari and Chrome */
}

/* This is often needed for PDF.js viewer to layout pages */
.pdfViewer {
	direction: ltr;
	position: relative;
	user-select: text;
	-webkit-user-select: text;
	overflow: visible !important;
	width: 100%;
}

.content-section {
	margin: 4rem 0;
	padding: 2rem;
	background-color: var(--color-bg-secondary-dark);
	border-radius: 16px;
	box-shadow: 0 6px 20px var(--color-shadow-dark);
	transition: all 0.3s ease-in-out;

	h2 {
		width: 100%;
		display: flex;
		justify-content: center;
	}
}
body.light .content-section {
	background-color: var(--color-bg-secondary-light);
	box-shadow: 0 6px 20px var(--color-shadow-light);
}

.about-me {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.grid {
	display: flex;
	flex-wrap: wrap;
	flex-direction: row;
	justify-content: center;
	align-items: stretch;
	width: 100%;
	max-width: 1200px;
	gap: 2rem;
	padding: 1rem;
}

.card {
	padding: 1.5rem;
	background: var(--color-bg-secondary-dark);
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
	gap: 1rem;

	max-width: 45%; /* Limit card width */

	ul {
		margin-left: 5%;
	}
}
.card:hover {
	transform: translateY(-4px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
body.light .card {
	background: var(--color-bg-secondary-light);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	height: 50px; /* Ensure consistent height */
}

.card a {
	color: var(--color-accent-primary);
	font-weight: 600;
}
.card a:hover {
	text-decoration: underline;
}

.center-text {
	text-align: center;
}

.resume-viewer-card img {
	margin: 4px;
	vertical-align: middle;
}

.add-gap {
	margin-right: 20px;
}

.site-footer {
	padding: 2rem 0;
	text-align: center;
	background-color: var(--bg);
	border-top: 1px solid var(--border-color);
	color: var(--text-secondary);
}

.footer-container {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0 1.5rem;
}

.site-footer .contacts {
	display: flex;
	gap: 1.2rem;
}

.site-footer .footer-text {
	color: var(--text-secondary);
	font-size: 1rem;
}

.site-footer .theme-icon {
	width: 24px;
	height: 24px;
	fill: currentColor;
	transition: transform 0.2s ease;
}

.site-footer .theme-icon:hover {
	transform: scale(1.1);
}

.card-title svg {
	width: auto;
	min-width: 50px;
	min-height: 50px;
	height: 40%;
	fill: currentColor;
	transition: fill 0.25s ease;
}

/* Responsive Styles */
@media (max-width: 768px) {
	.desktop-only {
		display: none !important; /* Hide desktop elements */
	}
	.menu-toggle {
		display: flex; /* Show hamburger on mobile */
	}
	.mobile-nav {
		display: flex; /* Always flex on mobile, control visibility with `top` */
	}

	header {
		padding: 1rem 0; /* Adjust padding for mobile header */
	}
	.header-container {
		padding: 0 1rem; /* Padding for the container within header */
	}

	.name {
		font-size: 1.75rem;
	}

	.hero-section {
		padding: 3rem 1.5rem;
		margin: 2rem auto;
	}
	.hero-section h1 {
		font-size: 2rem;
	}
	.hero-section p {
		font-size: 1rem;
	}
	.hero-section .download-btn {
		font-size: 1rem;
		padding: 0.8rem 2rem;
	}

	.resume-viewer-card {
		padding: 1.5rem;
	}

	.hero-buttons {
		flex-direction: column; /* Stack buttons on mobile */
		gap: 1rem;
	}

	.grid {
		display: flex;
		flex-direction: column; /* Stack cards vertically on mobile */
		gap: 1.5rem;
		justify-content: center;
		align-items: center;
		width: 100%;
		padding: 1rem 0; /* Add padding for mobile */
	}

	.card {
		max-width: 90%; /* Full width on mobile */
	}

	.add-gap {
		margin-right: 0; /* Remove right margin on mobile */
	}

	.content-section {
		padding: 1.5rem;
		margin: 2rem 0; /* Adjust margin for mobile */
	}

	#pdf-container {
		width: 100%;
	}

	footer {
		margin-top: 2rem; /* Adjust footer margin for mobile */
	}

	.site-footer {
		padding: 1.5rem 1rem; /* Adjust footer padding for mobile */
	}

	.card-title {
		height: auto; /* Allow height to adjust based on content */
	}

	.card-title svg {
		width: auto;
		min-width: 40px; /* Ensure minimum width for icons */
		height: 50px;
		fill: currentColor;
	}
}

@media (max-width: 480px) {
	.container {
		padding: 0 1rem;
	}

	.container-main {
		padding: 0 1rem;
	}

	.card {
		max-width: 100%; /* Full width on very small screens */
	}

	.hero-section h1 {
		font-size: 1.5rem; /* Smaller heading on very small screens */
	}

	h2 {
		font-size: 1.5rem; /* Adjust h2 size for smaller screens */
	}

	h3 {
		font-size: 1.25rem; /* Adjust h3 size for smaller screens */
	}

	.name {
		font-size: 1.5rem;
	}

	.resume-viewer-card {
		padding: 1rem; /* Reduce padding on very small screens */
	}

	footer {
		margin-top: 1rem; /* Reduce footer margin on very small screens */
	}

	.site-footer {
		padding: 0.5rem
	}

	.site-footer .footer-text {
		font-size: 0.9rem; /* Smaller footer text */
	}

	.footer-container {
		flex-direction: column; /* Stack footer items on small screens */
		align-items: center;
		justify-content: center;
		gap: 1rem;
		margin-bottom: 0.5rem
	}

	.card-title svg {
		width: 50%; 
		height: 100px;
		fill: currentColor;
	}
}