/* NE Design System — components/mobile-nav.css (#89) */
/* Bottom tab bar, bottom sheet, desktop dropdown, overlay */

/* ============================================
   BOTTOM TAB BAR
   Hidden on desktop, visible on mobile (<= 1024px)
   ============================================ */
.ne-bottom-tabs {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 56px;
	background: var(--ne-nav-bg);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	border-top: 1px solid var(--ne-border);
	z-index: var(--ne-z-bottom-tabs);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	align-items: center;
	justify-content: space-around;
}

/* Individual tab (both <a> and <button>) */
.ne-bottom-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	height: 100%;
	gap: 2px;
	text-decoration: none;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 6px 0;
	font-family: var(--ne-font-body);
	-webkit-tap-highlight-color: transparent;
	transition: color var(--ne-duration) var(--ne-ease);
}

.ne-bottom-tab__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ne-text-subtle);
	transition: color var(--ne-duration) var(--ne-ease);
	line-height: 1;
}

.ne-bottom-tab__label {
	font-size: 10px;
	color: var(--ne-text-subtle);
	font-weight: 500;
	transition: color var(--ne-duration) var(--ne-ease);
	line-height: 1;
}

/* Active tab */
.ne-bottom-tab.is-active .ne-bottom-tab__icon,
.ne-bottom-tab.is-active .ne-bottom-tab__label {
	color: var(--ne-accent);
}

/* Hover */
.ne-bottom-tab:hover .ne-bottom-tab__icon,
.ne-bottom-tab:hover .ne-bottom-tab__label {
	color: var(--ne-text-muted);
}

.ne-bottom-tab.is-active:hover .ne-bottom-tab__icon,
.ne-bottom-tab.is-active:hover .ne-bottom-tab__label {
	color: var(--ne-accent);
}


/* ============================================
   OVERLAY
   ============================================ */
.ne-profile-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: var(--ne-z-bottom-sheet-overlay);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s var(--ne-ease), visibility 0.3s;
}

.ne-profile-overlay.is-active {
	opacity: 1;
	visibility: visible;
}


/* ============================================
   BOTTOM SHEET (mobile profile menu)
   ============================================ */
.ne-bottom-sheet {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: var(--ne-z-bottom-sheet);
	background: var(--ne-surface);
	border-top-left-radius: var(--ne-radius-lg);
	border-top-right-radius: var(--ne-radius-lg);
	transform: translateY(100%);
	transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
	max-height: 70vh;
	overflow-y: auto;
	padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

.ne-bottom-sheet.is-open {
	transform: translateY(0);
}

/* Handle / grab bar */
.ne-bottom-sheet__handle {
	display: flex;
	justify-content: center;
	padding: var(--ne-space-3) 0 var(--ne-space-2);
	cursor: grab;
}

.ne-bottom-sheet__bar {
	width: 36px;
	height: 4px;
	background: var(--ne-border-s);
	border-radius: var(--ne-radius-pill);
}

/* Sheet content */
.ne-bottom-sheet__content {
	padding: 0 var(--ne-space-4) var(--ne-space-4);
}

/* User header */
.ne-bottom-sheet__user {
	display: flex;
	align-items: center;
	gap: var(--ne-space-3);
	padding: var(--ne-space-2) var(--ne-space-4) var(--ne-space-4);
	border-bottom: 1px solid var(--ne-border);
	margin-bottom: var(--ne-space-3);
}

.ne-bottom-sheet__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.ne-bottom-sheet__name {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ne-text);
}

/* Navigation items */
.ne-bottom-sheet__nav {
	display: flex;
	flex-direction: column;
	gap: var(--ne-space-1);
}

.ne-bottom-sheet__item {
	display: flex;
	align-items: center;
	gap: var(--ne-space-3);
	padding: var(--ne-space-3) var(--ne-space-4);
	color: var(--ne-text-subtle);
	text-decoration: none;
	font-size: 0.875rem;
	border-radius: var(--ne-radius-md);
	transition: background var(--ne-duration) var(--ne-ease),
	            color var(--ne-duration) var(--ne-ease);
}

.ne-bottom-sheet__item:hover {
	background: var(--ne-overlay);
	color: var(--ne-text);
	text-decoration: none;
}

.ne-bottom-sheet__item svg {
	flex-shrink: 0;
}

.ne-bottom-sheet__item-label {
	flex: 1;
}

/* Dark mode toggle row */
.ne-bottom-sheet__toggle-row {
	cursor: default;
}

.ne-bottom-sheet__toggle-row:hover {
	background: transparent;
}

/* Logout item — red text */
.ne-bottom-sheet__item[href*="logout"],
.ne-profile-dropdown__item[href*="logout"] {
	color: var(--ne-red);
}

.ne-bottom-sheet__item[href*="logout"]:hover,
.ne-profile-dropdown__item[href*="logout"]:hover {
	color: var(--ne-red);
	background: rgba(255, 79, 79, 0.08);
}

.ne-bottom-sheet__item[href*="logout"] svg,
.ne-profile-dropdown__item[href*="logout"] svg {
	stroke: var(--ne-red);
}

/* ============================================
   PILOTO / FEDERACIÓN MODE TOGGLE
   ============================================ */
.ne-mode-toggle {
	display: flex;
	gap: 2px;
	padding: var(--ne-space-2) var(--ne-space-4);
	margin-top: var(--ne-space-3);
	margin-bottom: var(--ne-space-3);
	background: var(--ne-bg);
	border-radius: var(--ne-radius-md);
	margin-left: var(--ne-space-4);
	margin-right: var(--ne-space-4);
}

.ne-mode-toggle__btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--ne-space-1);
	padding: var(--ne-space-2) var(--ne-space-3);
	font-size: 0.75rem;
	font-family: var(--ne-font-body);
	font-weight: 500;
	color: var(--ne-text-subtle);
	background: transparent;
	border: none;
	border-radius: var(--ne-radius-sm);
	cursor: pointer;
	transition: color var(--ne-duration) var(--ne-ease),
	            background var(--ne-duration) var(--ne-ease);
	-webkit-tap-highlight-color: transparent;
}

.ne-mode-toggle__btn:hover:not(:disabled) {
	color: var(--ne-text);
}

.ne-mode-toggle__btn.is-active {
	background: var(--ne-surface);
	color: var(--ne-text);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ne-mode-toggle__btn:disabled,
.ne-mode-toggle__btn.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.ne-mode-toggle__btn svg {
	flex-shrink: 0;
}

/* Dropdown-specific toggle spacing */
.ne-profile-dropdown .ne-mode-toggle {
	margin-left: var(--ne-space-3);
	margin-right: var(--ne-space-3);
	margin-bottom: var(--ne-space-1);
}


/* ============================================
   DESKTOP PROFILE DROPDOWN
   ============================================ */
.ne-profile-dropdown {
	position: fixed;
	top: calc(52px + var(--ne-space-2));
	right: var(--ne-space-6);
	width: 260px;
	background: var(--ne-surface);
	border: 1px solid var(--ne-border-s);
	border-radius: var(--ne-radius-lg);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
	z-index: var(--ne-z-dropdown);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity var(--ne-duration) var(--ne-ease),
	            transform var(--ne-duration) var(--ne-ease),
	            visibility var(--ne-duration);
	overflow: visible;
}

.ne-profile-dropdown.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* User header */
.ne-profile-dropdown__user {
	display: flex;
	align-items: center;
	gap: var(--ne-space-3);
	padding: var(--ne-space-4);
	border-bottom: 1px solid var(--ne-border);
}

.ne-profile-dropdown__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.ne-profile-dropdown__name {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ne-text);
}

/* Navigation items */
.ne-profile-dropdown__nav {
	display: flex;
	flex-direction: column;
	padding: var(--ne-space-2) var(--ne-space-2);
}

.ne-profile-dropdown__item {
	display: flex;
	align-items: center;
	gap: var(--ne-space-3);
	padding: var(--ne-space-2) var(--ne-space-3);
	color: var(--ne-text-subtle);
	text-decoration: none;
	font-size: 0.8125rem;
	border-radius: var(--ne-radius-md);
	transition: background var(--ne-duration) var(--ne-ease),
	            color var(--ne-duration) var(--ne-ease);
}

.ne-profile-dropdown__item:hover {
	background: var(--ne-overlay);
	color: var(--ne-text);
	text-decoration: none;
}

.ne-profile-dropdown__item svg {
	flex-shrink: 0;
}

.ne-profile-dropdown__item-label {
	flex: 1;
}

/* Dark mode toggle row */
.ne-profile-dropdown__toggle-row {
	cursor: default;
}

.ne-profile-dropdown__toggle-row:hover {
	background: transparent;
}


/* ============================================
   TOGGLE SWITCH (shared, dark mode)
   ============================================ */
.ne-toggle-switch {
	position: relative;
	display: inline-flex;
	align-items: center;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	margin-left: auto;
	-webkit-tap-highlight-color: transparent;
}

.ne-toggle-switch__track {
	display: block;
	width: 40px;
	height: 22px;
	background: var(--ne-border-s);
	border-radius: 11px;
	position: relative;
	transition: background var(--ne-duration) var(--ne-ease);
}

.ne-toggle-switch[aria-checked="true"] .ne-toggle-switch__track {
	background: var(--ne-accent);
}

.ne-toggle-switch__thumb {
	display: block;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	position: absolute;
	top: 2px;
	left: 2px;
	transition: transform var(--ne-duration) var(--ne-ease);
}

.ne-toggle-switch[aria-checked="true"] .ne-toggle-switch__thumb {
	transform: translateX(18px);
}


/* ============================================
   RESPONSIVE — show mobile elements
   ============================================ */
@media (max-width: 1024px) {
	.ne-bottom-tabs {
		display: flex;
	}

	.ne-bottom-sheet {
		display: block;
	}

	/* Body padding to prevent content from hiding behind bottom tabs */
	body {
		padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
	}

	/* Extra footer padding so content clears bottom tabs */
	.ne-footer {
		padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px) + var(--ne-space-6));
	}

	/* Hide desktop dropdown on mobile — bottom sheet takes over */
	.ne-profile-dropdown {
		display: none !important;
	}
}

/* Hide on desktop — bottom sheet is mobile only */
@media (min-width: 1025px) {
	.ne-bottom-tabs {
		display: none !important;
	}

	.ne-bottom-sheet {
		display: none !important;
	}

	.ne-profile-overlay {
		display: none !important;
	}
}
