/* Base menu styles */

.ttb-navbar {
	background: var(--main-nav-bg-color);
	color: #fff;
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
	z-index: 9998;
}

.ttb-menu a {
	color: var(--main-nav-text-color)
}

.ttb-navbar-content {
	display: flex;
	/* justify-content: center; */
	align-items: center;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
}

.ttb-menu {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

.ttb-menu > li {
	position: relative;
	z-index: 9999;
}

/* Ensure submenu is also relatively positioned for button placement */
.ttb-menu > li > ul {
	position: absolute;
}

.ttb-menu a {
	display: block;
	padding: 15px 10px;
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 5px;
	margin: 10px 5px;
	white-space: nowrap;
	font-size: 17px;
	line-height: normal;
}

/* Style for active menu item */
.ttb-menu a.active,
.ttb-menu a:hover,
.ttb-menu .current-menu-item > a {
	background: rgba(255, 255, 255, 0.1);
	text-decoration: none;;
}

/* Expanding Drawer Dropdown Styles */
.ttb-menu li ul {
	display: block;
	position: absolute;
	z-index: 10000;
	background: var(--main-nav-dropdown-bg-color);
	margin: 0;
	padding: 0;
	min-width: 200px;
	max-width: 350px;
	width: auto;
	white-space: nowrap;
	text-overflow: ellipsis;
	border-radius: 0px 0px 5px 5px;

	/* Drawer animation properties */
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	visibility: hidden;

	transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 0.3s ease,
	            visibility 0s linear 0.4s,
	            padding 0.4s ease;
}

/* Show submenu when parent has drawer-expanded class */
.ttb-menu > li.drawer-expanded > ul {
	max-height: 1000px; /* Large enough for content */
	opacity: 1;
	visibility: visible;
	padding: 0 5px 5px 5px;
	transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 0.3s ease,
	            visibility 0s linear 0s,
	            padding 0.4s ease;
}

/* Staggered Animation for Submenu Items */
.ttb-menu > li > ul > li {
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

/* When drawer is expanded, animate items in with staggered delays */
.ttb-menu > li.drawer-expanded > ul > li {
	opacity: 1;
	transform: translateY(0);
}

/* Stagger delays - each item appears 80ms after the previous */
.ttb-menu > li.drawer-expanded > ul > li:nth-child(1) { transition-delay: 0.1s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(2) { transition-delay: 0.18s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(3) { transition-delay: 0.26s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(4) { transition-delay: 0.34s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(5) { transition-delay: 0.42s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(6) { transition-delay: 0.5s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(7) { transition-delay: 0.58s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(8) { transition-delay: 0.66s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(9) { transition-delay: 0.74s; }
.ttb-menu > li.drawer-expanded > ul > li:nth-child(10) { transition-delay: 0.82s; }

/* Second level dropdown - centered below parent */
.ttb-menu > li > ul {
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-top: 0px;
}

/* Target the last top-level menu item's dropdown 
.ttb-menu > li:last-child > ul {
	left: auto;
	right: 0;
}

/* Target the second-level menu item's dropdown that goes off screen and adjust 
.ttb-menu > li > ul li:last-child > ul {
	left: auto;
	right: 100%;
}
*/
/* Third level dropdown - DISABLED FOR NOW */
.ttb-menu > li > ul > li > ul {
	display: none !important; /* Hide third-level menus completely */
}

/* Expanding Drawer Navigation Styles */

/* Menu items with children - restore normal padding */
.ttb-menu > li.menu-item-has-children > a {
	position: relative;
}

/* Drawer Toggle Buttons - Dual button system */
.ttb-drawer-toggle {
	width: 22px;
	height: 22px;
	border: none;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.25);
	color: #fff;
	cursor: pointer;
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;

	transition: all 0.3s ease;
}

.ttb-drawer-toggle i {
	font-size: 11px;
	transition: transform 0.3s ease;
}

/* Second-level drawer toggle buttons (for third-level menus) */
.ttb-drawer-toggle-level2 {
	width: 18px;
	height: 18px;
	border: none;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.25);
	color: #fff;
	cursor: pointer;
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.ttb-drawer-toggle-level2 i {
	font-size: 9px;
	transition: transform 0.3s ease;
}

/* Collapsed state button - positioned at bottom of menu item */
.ttb-drawer-toggle-collapsed {
	position: absolute;
	left: 50%;
	/* top is set by JavaScript based on link height */
	transform: translate(-50%, -11px);

	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease,
	            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0s linear 0s;
}

/* Collapsed state button for second-level items (smaller) */
.ttb-drawer-toggle-collapsed-level2 {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease,
	            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0s linear 0s;
}

/* When drawer expands, fade out and slide down collapsed button */
.ttb-menu > li.drawer-expanded .ttb-drawer-toggle-collapsed {
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 10px); /* Slide down 24px */
	transition: opacity 0.25s ease,
	            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0s linear 0.25s; /* Delay visibility to allow fade out */
	pointer-events: none;
}

/* Expanded state button - positioned at bottom of submenu */
.ttb-drawer-toggle-expanded {
	position: relative;
	margin: 10px auto 5px auto;

	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px); /* Start slightly above */
	transition: opacity 0.3s ease 0.15s, /* Delay fade in slightly */
	            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s,
	            visibility 0s linear 0.45s;
}

/* Expanded state button for second-level items */
.ttb-drawer-toggle-expanded-level2 {
	position: relative;
	margin: 5px auto 5px auto;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: opacity 0.3s ease 0.15s,
	            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s,
	            visibility 0s linear 0.45s;
}

/* When drawer expands, fade in and slide into position */
.ttb-menu > li.drawer-expanded .ttb-drawer-toggle-expanded {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.3s ease 0.15s, /* Delay to overlap with collapsed fade out */
	            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s,
	            visibility 0s linear 0s;
	pointer-events: all;
}

/* Hover effects */
.ttb-drawer-toggle:hover {
	background-color: rgba(0, 0, 0, 0.4);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ttb-drawer-toggle-level2:hover {
	background-color: rgba(0, 0, 0, 0.4);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ttb-menu > li:not(.drawer-expanded) .ttb-drawer-toggle-collapsed:hover {
	transform: translate(-50%, -11px) scale(1.1);
}

.ttb-menu > li > ul > li:not(.drawer-expanded-level2) .ttb-drawer-toggle-collapsed-level2:hover {
	transform: translateY(-50%) scale(1.1);
}

/* Second-level drawer expanded state toggle visibility */
.ttb-menu > li > ul > li.drawer-expanded-level2 .ttb-drawer-toggle-expanded-level2 {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.3s ease 0.15s,
	            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s,
	            visibility 0s linear 0s;
	pointer-events: all;
}

.ttb-menu > li > ul > li.drawer-expanded-level2 .ttb-drawer-toggle-collapsed-level2 {
	opacity: 0;
	visibility: hidden;
	transform: translateY(-50%) translateX(10px);
	transition: opacity 0.25s ease,
	            transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0s linear 0.25s;
	pointer-events: none;
}

.ttb-menu > li.drawer-expanded .ttb-drawer-toggle-expanded:hover {
	transform: translateY(0) scale(1.1);
}

/* Chevron rotation - animate during transition */
.ttb-drawer-toggle-collapsed i {
	transform: rotate(0deg); /* Points down when collapsed */
}

/* When expanding, rotate the collapsed button's chevron as it fades */
.ttb-menu > li.drawer-expanded .ttb-drawer-toggle-collapsed i {
	transform: rotate(180deg); /* Rotate up as it disappears */
}

.ttb-drawer-toggle-expanded i {
	transform: rotate(180deg); /* Points up when expanded */
}

/* When collapsing, rotate the expanded button's chevron as it fades */
.ttb-menu > li:not(.drawer-expanded) .ttb-drawer-toggle-expanded i {
	transform: rotate(0deg); /* Rotate down as it disappears */
}

/* Scale down the sub items */
.ttb-menu li ul li a {
	font-size: 14px;
}

/* Base styles for right-arrow indicators on second-level menu items - HIDDEN (third-level nav disabled) */
.ttb-menu > li > ul li.menu-item-has-children > a::after {
	display: none !important; /* Hide arrow indicators since third-level is disabled */
}

/* Ensure there is space for the arrow inside the anchor element for second-level menu items */
.ttb-menu > li > ul li.menu-item-has-children > a {
	padding-right: 10px; /* Reset padding since no toggle button */
	position: relative;
}

.ttb-hamburger-menu-trigger {
	display: none;
	cursor: pointer;
	font-size: 18px;
	text-align: center;
	font-weight: bold;
	padding: 15px;
}

@media (max-width: 1024px) {
	.ttb-navbar {
		justify-content: space-between;
	}

	.ttb-menu {
		display: none;
	}

	.ttb-hamburger-menu-trigger {
		background-color: var(--main-nav-bg-color);
		color: var(--main-nav-text-color);
		display: block;
	}
}

/****************/
/* Second Menu */
/****************/

.ttb-second-navbar {
	background-color: var(--second-nav-bg-color);
	color: var(--second-nav-text-color);
	display: flex;
	justify-content: center;
	align-items: center;
}

.ttb-second-content {
	display: flex;
	/* justify-content: center; */
	align-items: center;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
}

.ttb-menu-second {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	justify-content: center;
	align-items: center;
}

.ttb-menu-second > li {
	position: relative;
}

.ttb-menu-second a {
	display: block;
	color: var(--second-nav-text-color);
	padding: 6px;
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 5px;
	margin: 6px 4px;
	white-space: nowrap;
	font-size: 15px;
	line-height: normal;
}

/* Style for active menu item in the second menu */
.ttb-menu-second a.active,
.ttb-menu-second a:hover,
.ttb-menu-second .current-menu-item > a {
	background: rgba(255, 255, 255, 0.1);
	text-decoration: none;
}

/* Dropdown Styles for the second menu */
.ttb-menu-second li ul {
	display: block;
	visibility: hidden;
	opacity: 0;
	position: absolute;
	z-index: 12200;
	background-color: var( --second-nav-dropdown-bg-color);
	margin: 0;
	padding: 0 5px 5px 5px;
	min-width: 200px;
	max-width: 350px;
	width: auto;
	white-space: nowrap;
	text-overflow: ellipsis;
	transition: visibility 0s linear 0.3s, opacity 0.3s ease-out;
	border-radius: 0px 0px 5px 5px;
}

/* Show submenu on hover of the parent li with immediate effect for the second menu */
.ttb-menu-second > li:hover > ul,
.ttb-menu-second > li > ul > li:hover > ul {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
	transition-delay: 0s;
}

/* Second level dropdown for the second menu */
.ttb-menu-second > li > ul {
	top: 100%;
	left: 0;
	transform: translateY(-20px);
	transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Target the last top-level menu item's dropdown
.ttb-menu-second > li:last-child > ul {
	left: auto;
	right: 0;
}

/* Target the second-level menu item's dropdown that goes off screen and adjust 
.ttb-menu-second > li > ul li:last-child > ul {
	left: auto;
	right: 100%;
} */

/* Show third level menu on hover for the second menu - DISABLED FOR NOW */
.ttb-menu-second > li > ul > li > ul {
	display: none !important; /* Hide third-level menus completely */
}	


/* Base styles for menu-item indicators for the second menu */
.ttb-menu-second > li.menu-item-has-children > a {
	position: relative;
	padding-right: 40px;
}

.ttb-menu-second > li.menu-item-has-children > a::after {
	font-family: "Font Awesome 6 Free";
	content: "\f055";
	font-size: 0.65em;
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%) rotate(0deg);
	transition: transform 0.3s ease;
	font-weight: 900;
	vertical-align: middle;
	padding: 0.25rem 0.35rem;
	background-color: rgba(0, 0, 0, 0.25);
	border-radius: 4px;
	line-height: 1;
}

/* Hover styles for menu-item indicators for the second menu */
.ttb-menu-second > li.menu-item-has-children:hover > a::after {
	transform: translateY(-50%) rotate(180deg);
	content: "\f0aa";
}

/* Scale down the sub items for the second menu */
.ttb-menu-second li ul li a {
	font-size: 14px;
}

/* Base styles for right-arrow indicators on second-level menu items for the second menu - HIDDEN */
.ttb-menu-second > li > ul li.menu-item-has-children > a::after {
	display: none !important; /* Hide arrow indicators since third-level is disabled */
}

/* Ensure there is space for the arrow inside the anchor element for second-level menu items for the second menu */
.ttb-menu-second > li > ul li.menu-item-has-children > a {
	padding-right: 10px; /* Reset padding since no toggle button */
	position: relative;
}

/* Responsive styles for the second menu */
@media (max-width: 1024px) {
	.ttb-second-navbar {
		display: none;
	}

	.ttb-menu-second {
		display: none;
	}
}