/**
 * assets/css/mobile-menu-fix.css
 * Mobile menu positioning below navigation bar
 */

/* Ensure navigation bar stays on top */
.nav-container,
.navbar,
nav {
	position: relative;
	z-index: 10010 !important;
}

/* Fix hamburger button z-index to be below nav but clickable */
#hamburger-btn,
.hamburger-btn {
	position: relative;
	z-index: 9999 !important; /* Below nav but above content */
	min-width: 44px !important;
	min-height: 44px !important;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	cursor: pointer !important;
	user-select: none;
	transition: background-color 0.2s ease;
}

/* Mobile menu positioned below navigation */
#mobile-menu {
	display: none !important;
	position: fixed !important;
	z-index: 9998 !important; /* Below nav and hamburger button */
	top: 104px !important; /* Adjust based on your nav height */
	left: 0 !important;
	right: 0 !important;
	bottom: auto !important;
	background: white !important;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
	max-height: calc(100vh - 104px) !important;
	overflow-y: auto !important;
	-webkit-overflow-scrolling: touch;
	transition: none !important;
	margin-top: 0 !important; /* Ensure no margin pushes it up */
}

/* Only show when not hidden */
#mobile-menu:not(.hidden) {
	display: block !important;
	animation: slideDown 0.3s ease;
}

/* Ensure menu slides down from correct position */
@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
		visibility: hidden;
	}
	to {
		opacity: 1;
		transform: translateY(0);
		visibility: visible;
	}
}

/* Mobile menu content spacing */
#mobile-menu .mobile-menu-content {
	padding: 1rem;
	position: relative;
	z-index: 1;
}

/* Standard menu items */
#mobile-menu a,
#mobile-menu button {
	position: relative;
	z-index: 1;
	touch-action: manipulation;
	-webkit-tap-highlight-color: rgba(0,0,0,0.1);
	display: block;
	width: 100%;
	padding: 1rem;
	text-align: left;
	text-decoration: none;
	color: #374151;
	border: none;
	background: none;
	font-size: 1.125rem;
	font-weight: 500;
	border-radius: 0.5rem;
	transition: background-color 0.2s;
	cursor: pointer;
	margin-bottom: 0.25rem;
}

#mobile-menu a:hover,
#mobile-menu button:hover {
	background-color: #f3f4f6;
}

/* Purple CTA Button for Register/Sign Up */
#mobile-menu .btn-register-mobile,
#mobile-menu .btn-primary-mobile,
#mobile-menu button[onclick*="handleNavRegistration"] {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
	color: white !important;
	text-align: center !important;
	font-weight: 600 !important;
	padding: 1rem 1.5rem !important;
	margin: 1rem 0.5rem 0.5rem 0.5rem !important;
	border-radius: 0.75rem !important;
	box-shadow: 0 4px 6px rgba(99, 102, 241, 0.25) !important;
	transition: all 0.3s ease !important;
	border: none !important;
	font-size: 1.125rem !important;
	letter-spacing: 0.025em !important;
	text-transform: none !important;
}

/* Hover state for CTA button */
#mobile-menu .btn-register-mobile:hover,
#mobile-menu .btn-primary-mobile:hover,
#mobile-menu button[onclick*="handleNavRegistration"]:hover {
	background: linear-gradient(135deg, #5558e3 0%, #7c4fde 100%) !important;
	transform: translateY(-2px) !important;
	box-shadow: 0 6px 12px rgba(99, 102, 241, 0.35) !important;
}

/* Active/pressed state */
#mobile-menu .btn-register-mobile:active,
#mobile-menu .btn-primary-mobile:active,
#mobile-menu button[onclick*="handleNavRegistration"]:active {
	transform: translateY(0) !important;
	box-shadow: 0 2px 4px rgba(99, 102, 241, 0.25) !important;
}

/* Hamburger button states */
#hamburger-btn.active,
.hamburger-btn.active {
	background-color: #e5e7eb !important;
}

/* Icon transition */
#hamburger-icon {
	transition: transform 0.2s ease;
}

/* Body state when menu is open */
body.mobile-menu-open {
	overflow: hidden !important;
	position: fixed !important;
	width: 100% !important;
}

/* Create stacking context for header */
header,
.header,
.nav-wrapper {
	position: relative;
	z-index: 10010 !important;
	background: white; /* Ensure solid background */
}

/* Desktop - ensure menu is always hidden */
@media (min-width: 768px) {
	#mobile-menu {
		display: none !important;
	}
	
	body.mobile-menu-open {
		overflow: auto !important;
		position: static !important;
	}
}

/* Critical - prevent FOUC */
#mobile-menu.hidden {
	display: none !important;
	visibility: hidden !important;
}

/* Divider for visual separation before CTA */
#mobile-menu .mobile-menu-divider {
	height: 1px;
	background: #e5e7eb;
	margin: 1rem 0;
}

/* Ensure proper layering */
.mobile-menu-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.3);
	z-index: 9997; /* Below menu */
}

.mobile-menu-overlay.active {
	display: block;
}