/*
 * Top Navigation Bar Responsive Styles
 * Created: 2025-09-30
 * Purpose: Make ANZSRS top navigation bar responsive and visible on mobile devices
 */

/* Mobile responsive (up to 525px) */
@media (max-width: 525px) {
	/* Keep topbar visible on mobile */
	.menu-wrapper {
		margin-top: 10px;
	}
	td.topbar {
		display: table-cell !important;
	}

	table.topbar {
		display: table !important;
	}

	/* Topbar navigation container */
	td.topbar[align="right"] {
		display: block !important;
		width: 100% !important;
		text-align: center !important;
	}

	/* Convert horizontal nav to hamburger menu */
	nav[role="custom-dropdown"] {
		position: relative;
		z-index: 9;
	}

	/* Hamburger menu toggle button */
	nav[role="custom-dropdown"]:before {
		content: "☰ Menu";
		display: block;
		background-color: #106ba2;
		color: white;
		padding: 12px;
		cursor: pointer;
		text-align: center;
		font-size: 16px;
		font-weight: bold;
		border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	}

	/* Hide menu by default on mobile */
	nav[role="custom-dropdown"] ul.top-menu-bar {
		display: none;
		width: 100%;
		margin: 0;
		padding: 0;
		background-color: #106ba2;
	}

	/* Show menu when 'active' class is added (via JavaScript) */
	nav[role="custom-dropdown"].mobile-menu-active ul.top-menu-bar {
		display: block;
	}

	/* Stack menu items vertically */
	nav[role="custom-dropdown"] ul.top-menu-bar > li {
		display: block !important;
		width: 100% !important;
		text-align: left !important;
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
		padding: 0 !important;
	}

	nav[role="custom-dropdown"] ul.top-menu-bar > li:last-child {
		border-bottom: none;
	}

	/* Menu links - full width and better touch targets */
	nav[role="custom-dropdown"] ul.top-menu-bar > li > a {
		display: block !important;
		padding: 15px 20px !important;
		font-size: 14px !important;
		text-align: left !important;
		margin: 0 !important;
	}

	/* Selected/active item */
	nav[role="custom-dropdown"] ul.top-menu-bar > li.selected {
		background-color: #159fee;
	}

	/* Hover effect */
	nav[role="custom-dropdown"] ul.top-menu-bar > li:hover {
		background-color: #159fee;
	}

	/* Login info - adjust for mobile */
	td.login-info {
		display: block !important;
		width: 100% !important;
		text-align: center !important;
		padding: 10px 0 !important;
		border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	}

	.login-info ul {
		display: inline-block;
		margin: 0;
		padding: 0;
	}

	.login-info li {
		display: inline-block;
	}

	/* Dropdown menu items (for menu with sub-items) */
	.dropdown-master .dropdown-content {
		position: static;
		display: none;
		background-color: rgba(0, 0, 0, 0.2);
		box-shadow: none;
		margin-left: 0;
	}

	.dropdown-master:hover .dropdown-content,
	.dropdown-master:focus .dropdown-content {
		display: block;
	}

	.dropdown-content a {
		padding: 12px 30px !important;
		font-size: 13px !important;
	}
}

/* Tablet responsive (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
	/* Slightly smaller font for tablet */
	nav[role="custom-dropdown"] a,
	nav[role="custom-dropdown"] label {
		font-size: 1.2em;
		margin: 0px 5px;
	}

	a.topbar:link,
	a.topbar:visited,
	a.topbar:active {
		font-size: 10px;
		padding: 7px;
	}
}

/* Extra small mobile (up to 480px) */
@media (max-width: 480px) {
	nav[role="custom-dropdown"] ul.top-menu-bar > li > a {
		padding: 12px 15px !important;
		font-size: 13px !important;
	}

	.login-info ul ul li {
		width: 100px;
	}
}
