/* Header Styles */
header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background-color: var(--primary-color);
	padding: 1.25rem 2rem;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	height: 75px;
}

.logo {
	display: flex;
	align-items: center;
}

.logo img {
	height: 40px;
}

.right-logo {
	display: flex;
	align-items: center;
}

.right-logo > img {
	height: 80px;
}

.right-logo .divider {
	height: 34px;
	width: 1px;
	background-color: #7cc248;
	margin: 0 1rem;
}

.share-btn {
	display: flex;
	align-items: center;
	justify-content: center;
}

.share-btn img {
	height: 24px;
}

/* Desktop Navigation */
.desktop-nav ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
}

.desktop-nav li {
	margin: 0 0.5rem;
}

.desktop-nav a {
	color: var(--white);
	text-decoration: none;
	font-family: var(--body-font);
	font-size: 14px;
	padding: 0.5rem 0.75rem;
	transition: background-color 0.3s;
	border-radius: 80px;
	box-sizing: border-box;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
}

.desktop-nav a:hover {
	text-decoration: none;
	background-color: rgba(255, 255, 255, 0.1);
}

.desktop-nav a.active {
	background-color: var(--secondary-color-yellow);
	color: var(--text-color);
	border: 1px solid var(--secondary-color-yellow);
}

/* Desktop Dropdown Styles */
.nav-dropdown {
	position: relative;
}

.dropdown-trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Highlight Resources trigger when any dropdown item is active */
.nav-dropdown.resources-active > .dropdown-trigger {
	background-color: var(--secondary-color-yellow);
	color: var(--text-color);
	border: 1px solid var(--secondary-color-yellow);
}

.dropdown-arrow {
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

.nav-dropdown:hover .dropdown-arrow {
	transform: rotate(180deg);
}

.dropdown-menu {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	background-color: var(--primary-color);
	border-radius: 12px;
	padding: 12px 8px;
	min-width: 220px;
	box-shadow:
		0 8px 24px rgba(0, 0, 0, 0.15),
		0 16px 40px rgba(0, 0, 0, 0.2);
	border: 1px solid rgba(255, 255, 255, 0.15);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	margin-top: 8px;
	z-index: 1000;
	list-style: none;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.dropdown-menu::before {
	content: "";
	position: absolute;
	top: -8px;
	left: 0;
	right: 0;
	height: 8px;
	background: transparent;
}

.nav-dropdown:hover .dropdown-menu {
	opacity: 1;
	visibility: visible;
}

.dropdown-menu li {
	margin: 2px 0;
}

.dropdown-menu a {
	display: block;
	padding: 0.6rem 1rem;
	white-space: nowrap;
	border-radius: 80px;
	height: auto;
	justify-content: flex-start;
	font-size: 13px;
	margin: 0 4px;
}

.dropdown-menu a:hover {
	background-color: rgba(255, 255, 255, 0.15);
}

/* Active state for dropdown items */
.dropdown-menu a.active {
	background-color: var(--secondary-color-yellow);
	color: var(--text-color);
}

/* Mobile Navigation Controls */
.mobile-nav-controls {
	display: none;
	align-items: center;
	gap: 1rem;
}

.current-section-title {
	background-color: var(--secondary-color-yellow);
	color: var(--text-color);
	font-family: var(--body-font);
	font-size: 14px;
	font-weight: 500;
	min-width: 128px;
	max-width: 300px;
	width: max-content;
	padding: 0.5rem 0.75rem;
	border-radius: 80px;
	border: 1px solid var(--secondary-color-yellow);
	box-sizing: border-box;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.current-section-title span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 110px;
	text-align: center;
}

.section-scroll-to-top {
	background: none;
	border: none;
	color: inherit;
	font: inherit;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-align: center;
	border-radius: inherit;
	direction: ltr;
	min-width: 0;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
	display: flex;
	flex-direction: column;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	z-index: 1002;
	flex-shrink: 0;
}

.hamburger-line {
	width: 24px;
	height: 3px;
	background-color: var(--white);
	margin: 3px 0;
	transition: 0.3s ease-in-out;
	border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
	transform: rotate(-45deg) translate(-6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
	opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
	transform: rotate(45deg) translate(-6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	background-color: var(--primary-color);
	z-index: 1001;
	transform: translateX(-100%);
	transition: transform 0.3s ease-in-out;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mobile-menu-overlay.active {
	transform: translateX(0);
}

.close-overlay {
	position: absolute;
	top: 70px;
	right: 50px;
	background-color: var(--secondary-color-yellow);
	border-radius: 50%;
	border: none;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.3s ease;
	color: var(--text-color);
}

.close-overlay:hover {
	background-color: #f0d000;
	transform: scale(1.05);
}

.close-overlay svg {
	width: 24px;
	height: 24px;
}

.mobile-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: center;
}

.mobile-nav li {
	margin: 1.5rem 0;
}

.mobile-nav-link {
	color: var(--white);
	text-decoration: none;
	font-family: var(--body-font);
	font-size: 24px;
	font-weight: 500;
	padding: 1rem 2rem;
	transition: all 0.3s ease;
	border-radius: 80px;
	display: block;
	border: 2px solid transparent;
}

.mobile-nav-link:hover {
	background-color: rgba(255, 255, 255, 0.1);
	text-decoration: none;
}

.mobile-nav-link.active {
	background-color: var(--secondary-color-yellow);
	color: var(--text-color);
	border: 2px solid var(--secondary-color-yellow);
}

.anchor-try-it-yourself {
	display: none;
}

/* Mobile Dropdown Styles */
.mobile-nav-dropdown {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.mobile-dropdown-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: none;
	cursor: pointer;
}

.mobile-dropdown-trigger .dropdown-arrow {
	transition: transform 0.3s ease;
}

.mobile-nav-dropdown.active .mobile-dropdown-trigger .dropdown-arrow {
	transform: rotate(180deg);
}

.mobile-dropdown-menu {
	list-style: none;
	padding: 0;
	margin: 0.5rem 0 0 0;
	max-height: 0;
	overflow: hidden;
	transition:
		max-height 0.3s ease,
		opacity 0.3s ease;
	opacity: 0;
	width: 100%;
}

.mobile-nav-dropdown.active .mobile-dropdown-menu {
	max-height: 300px;
	opacity: 1;
}

.mobile-dropdown-menu li {
	margin: 0.5rem 0;
}

.mobile-dropdown-menu a {
	font-size: 18px;
	padding: 0.6rem 1.5rem;
	opacity: 0.85;
}

.mobile-dropdown-menu a:hover {
	opacity: 1;
}

/* Mobile Resources trigger highlighted when any dropdown item is active */
.mobile-nav-dropdown.resources-active > .mobile-dropdown-trigger {
	background-color: var(--secondary-color-yellow);
	color: var(--text-color);
	border: 2px solid var(--secondary-color-yellow);
}

/* Mobile dropdown item active state - pill shape */
.mobile-dropdown-menu a.active {
	background-color: var(--secondary-color-yellow);
	color: var(--text-color);
	border-radius: 80px;
	opacity: 1;
}

/* Adjustments for main content to account for fixed header */
body {
	padding-top: 60px;
}

/* Prevent body scroll when mobile menu is open */
body.menu-open {
	overflow: hidden;
}

/* Responsive Navigation */
@media (max-width: 1440px) {
	header {
		display: flex;
		gap: 20px;
		padding: 20px 18px 20px 12px;
	}

	.logo img {
		height: 34px;
	}

	.desktop-nav ul {
		display: flex;
		flex-wrap: nowrap;
		gap: 6px;
		justify-content: center;
	}

	.desktop-nav li {
		margin: 0;
	}

	.desktop-nav a {
		font-size: 12px;
		padding: 8px 10px;
		text-align: center;
	}
}

/* Tablet and Mobile Styles */
@media (max-width: 900px) {
	header {
		justify-content: left;
	}

	.desktop-nav {
		display: none;
	}

	.mobile-nav-controls {
		display: flex;
	}

	.right-logo .divider {
		margin: 0;
	}

	.right-logo {
		gap: 0.5rem;
	}

	.logo {
		margin-left: auto;
	}

	.second-try-it-yourself {
		background-color: inherit;
		border: none;
	}

	.current-section-title {
		min-width: 0;
	}
}

@media (max-width: 900px) {
	header {
		padding: 1rem;
		height: 60px;
	}

	.logo img {
		content: url("../images/mobile/logo.svg");
		height: 30px;
	}

	.right-logo > img {
		height: 64px;
	}

	.current-section-title {
		font-size: 12px;
		padding: 8px 10px;
		height: 32px;
		width: max-content;
	}

	.section-scroll-to-top {
		justify-content: flex-start;
		text-align: left;
		padding: 0 4px;
	}

	.mobile-nav-link {
		font-size: 20px;
		padding: 0.8rem 1.5rem;
	}

	body {
		padding-top: 60px;
	}
}

@media (max-width: 480px) {
	header {
		padding: 0.75rem;
		height: 55px;
	}

	.logo img {
		content: url("../images/mobile/logo.svg");
		height: 26px;
	}

	.right-logo > img {
		height: 56px;
	}

	.current-section-title {
		font-size: 11px;
		padding: 6px 8px;
		height: 28px;
		max-width: 140px;
		width: max-content;
	}

	.section-scroll-to-top {
		justify-content: flex-start;
		text-align: left;
		padding: 0 4px;
	}

	.mobile-nav-link {
		font-size: 18px;
		padding: 0.6rem 1rem;
	}

	body {
		padding-top: 55px;
	}
}

@media (max-width: 376px) {
	.right-logo {
		gap: 0.3rem;
	}

	header {
		gap: 12px;
	}
}
