/* ============================================
   Story 3.1 + 3.2: Menu Burger L4z-R-u$
   Direction Artistique Complète
   ============================================ */

/* ================================================
   BURGER BUTTON - Bouton hamburger flottant
   ================================================ */

.burger-navigation {
	position: relative;
	z-index: 999;
}

.burger-btn {
	position: fixed;
	top: 16px;
	left: 16px;
	z-index: 1000;
	width: 52px;
	height: 52px;

	/* Glassmorphism L4z-R-u$ */
	background: rgba(26, 31, 46, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);

	/* Border cyan glow */
	border: 1px solid rgba(0, 240, 255, 0.3);
	border-radius: 12px;

	/* Icon */
	color: var(--primary-cyan);
	font-size: 22px;

	/* Layout */
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;

	/* Glow effect */
	box-shadow:
		0 0 20px rgba(0, 240, 255, 0.15),
		0 4px 15px rgba(0, 0, 0, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);

	/* Smooth transitions */
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger-btn:hover {
	/* Intensify glow on hover */
	border-color: var(--primary-cyan);
	box-shadow:
		0 0 30px rgba(0, 240, 255, 0.4),
		0 0 60px rgba(0, 240, 255, 0.2),
		0 8px 25px rgba(0, 0, 0, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);

	/* Slight elevation */
	transform: translateY(-2px) scale(1.02);

	/* Icon color shift */
	color: var(--text-primary);
}

.burger-btn:active {
	transform: translateY(0) scale(0.98);
}

.burger-btn:focus {
	outline: none;
	border-color: var(--primary-cyan);
	box-shadow:
		0 0 0 3px rgba(0, 240, 255, 0.3),
		0 0 30px rgba(0, 240, 255, 0.4);
}

/* Pulse animation when menu is closed */
@keyframes burger-pulse {
	0%, 100% {
		box-shadow:
			0 0 20px rgba(0, 240, 255, 0.15),
			0 4px 15px rgba(0, 0, 0, 0.3);
	}
	50% {
		box-shadow:
			0 0 25px rgba(0, 240, 255, 0.25),
			0 4px 15px rgba(0, 0, 0, 0.3);
	}
}

.burger-btn:not([aria-expanded="true"]) {
	animation: burger-pulse 3s ease-in-out infinite;
}

/* ================================================
   BACKDROP - Overlay avec blur
   ================================================ */

.burger-backdrop {
	position: fixed;
	inset: 0;
	z-index: 1001;

	/* Dark overlay with blur */
	background: rgba(10, 14, 20, 0.8);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

/* ================================================
   MENU SIDEBAR - Panel principal
   ================================================ */

.burger-menu {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 1002;
	width: 300px;
	max-width: 85vw;

	/* Glassmorphism dark */
	background: linear-gradient(
		180deg,
		rgba(26, 31, 46, 0.98) 0%,
		rgba(10, 14, 20, 0.98) 100%
	);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);

	/* Cyan border accent */
	border-right: 1px solid rgba(0, 240, 255, 0.2);

	/* Shadow + glow */
	box-shadow:
		4px 0 30px rgba(0, 0, 0, 0.5),
		1px 0 0 rgba(0, 240, 255, 0.1);

	/* Layout */
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* ================================================
   MENU HEADER - Titre + Close button
   ================================================ */

.burger-menu-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;

	/* Gradient top accent */
	background: linear-gradient(
		180deg,
		rgba(0, 240, 255, 0.08) 0%,
		transparent 100%
	);

	/* Bottom border */
	border-bottom: 1px solid rgba(0, 240, 255, 0.15);

	/* Position for decorative element */
	position: relative;
}

/* Decorative scanline */
.burger-menu-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(
		90deg,
		transparent 0%,
		var(--primary-cyan) 20%,
		var(--primary-magenta) 50%,
		var(--primary-cyan) 80%,
		transparent 100%
	);
	opacity: 0.8;
}

.burger-menu-header h2 {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	margin: 0;

	/* Cyan text with glow */
	color: var(--primary-cyan);
	text-shadow:
		0 0 10px rgba(0, 240, 255, 0.5),
		0 0 20px rgba(0, 240, 255, 0.3);
}

/* Close button */
.burger-close-btn {
	width: 44px;
	height: 44px;

	/* Glass button */
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;

	/* Icon */
	color: var(--text-secondary);
	font-size: 20px;

	/* Layout */
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;

	/* Transition */
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger-close-btn:hover {
	background: rgba(255, 51, 102, 0.15);
	border-color: var(--error);
	color: var(--error);

	/* Rotate icon */
	transform: rotate(90deg);
}

.burger-close-btn:focus {
	outline: none;
	border-color: var(--primary-cyan);
	box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.2);
}

/* ================================================
   TEAM INFO SECTION - Informations équipe
   ================================================ */

.burger-team-info {
	padding: 20px 24px;

	/* Subtle background */
	background: rgba(0, 0, 0, 0.2);

	/* Border */
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Info items (Équipe, Agent, Capitaine) */
.burger-team-info-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;

	/* Separator */
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.burger-team-info-item:last-of-type {
	border-bottom: none;
	margin-bottom: 0;
}

.burger-team-info-label {
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-secondary);
}

.burger-team-info-value {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-primary);
	text-align: right;
	max-width: 60%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Stats cards (Points + Position) */
.burger-team-info-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 16px;
}

.burger-team-info-stat {
	/* Glassmorphism card */
	background: rgba(0, 240, 255, 0.03);
	border: 1px solid rgba(0, 240, 255, 0.15);
	border-radius: 12px;

	/* Layout */
	padding: 16px 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;

	/* Subtle glow */
	box-shadow:
		0 0 15px rgba(0, 240, 255, 0.05),
		inset 0 1px 0 rgba(255, 255, 255, 0.03);

	/* Transition */
	transition: all 0.25s ease;
}

.burger-team-info-stat:hover {
	border-color: rgba(0, 240, 255, 0.3);
	background: rgba(0, 240, 255, 0.06);
	box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.burger-team-info-stat i {
	font-size: 24px;
	color: var(--primary-cyan);

	/* Icon glow */
	filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.4));
}

.burger-team-info-stat .burger-team-info-label {
	font-size: 10px;
	color: var(--text-secondary);
}

.burger-team-info-stat .burger-team-info-value {
	font-size: 22px;
	font-weight: 700;
	color: var(--primary-cyan);

	/* Text glow */
	text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* ================================================
   NAVIGATION LIST - Menu items
   ================================================ */

.burger-menu-list {
	list-style: none;
	padding: 16px 0;
	margin: 0;
	flex: 1;
	overflow-y: auto;
}

.burger-menu-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px 24px;
	margin: 0 12px 4px;

	/* Text */
	color: var(--text-primary);
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;

	/* Border radius for each item */
	border-radius: 10px;

	/* Left accent border (invisible by default) */
	border-left: 3px solid transparent;

	/* Minimum touch target */
	min-height: 52px;

	/* Transitions */
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

	/* Position for hover effect */
	position: relative;
	overflow: hidden;
}

/* Hover background gradient */
.burger-menu-item::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		rgba(0, 240, 255, 0.1) 0%,
		rgba(0, 240, 255, 0.03) 50%,
		transparent 100%
	);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.burger-menu-item:hover::before {
	opacity: 1;
}

.burger-menu-item:hover {
	/* Cyan accent */
	color: var(--primary-cyan);
	border-left-color: var(--primary-cyan);

	/* Background */
	background: rgba(0, 240, 255, 0.05);

	/* No underline */
	text-decoration: none;
}

.burger-menu-item:focus {
	outline: none;
	background: rgba(0, 240, 255, 0.08);
	border-left-color: var(--primary-cyan);
	box-shadow: inset 0 0 0 2px rgba(0, 240, 255, 0.2);
}

/* Active page indicator */
.burger-menu-item.active {
	background: rgba(0, 240, 255, 0.08);
	border-left-color: var(--primary-cyan);
	color: var(--primary-cyan);
}

/* Icons */
.burger-menu-item i {
	width: 24px;
	font-size: 18px;
	text-align: center;

	/* Cyan color */
	color: var(--primary-cyan);

	/* Subtle glow */
	filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.3));

	/* Transition */
	transition: all 0.25s ease;

	/* Position relative for z-index */
	position: relative;
	z-index: 1;
}

.burger-menu-item:hover i {
	/* Magenta shift on hover */
	color: var(--primary-magenta);
	filter: drop-shadow(0 0 8px rgba(255, 0, 110, 0.5));

	/* Scale up */
	transform: scale(1.15);
}

/* Item text */
.burger-menu-item span {
	position: relative;
	z-index: 1;
}

/* ================================================
   LOGOUT SPECIAL STYLING
   ================================================ */

.burger-menu-item[href*="logout"] {
	margin-top: auto;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	margin-left: 12px;
	margin-right: 12px;
	padding-top: 20px;
}

.burger-menu-item[href*="logout"] i {
	color: var(--error);
	filter: drop-shadow(0 0 4px rgba(255, 51, 102, 0.3));
}

.burger-menu-item[href*="logout"]:hover {
	color: var(--error);
	border-left-color: var(--error);
	background: rgba(255, 51, 102, 0.08);
}

.burger-menu-item[href*="logout"]:hover::before {
	background: linear-gradient(
		90deg,
		rgba(255, 51, 102, 0.1) 0%,
		rgba(255, 51, 102, 0.03) 50%,
		transparent 100%
	);
}

.burger-menu-item[href*="logout"]:hover i {
	color: var(--error);
	filter: drop-shadow(0 0 8px rgba(255, 51, 102, 0.5));
}

/* ================================================
   ANIMATIONS
   ================================================ */

/* Menu slide in */
@keyframes menu-slide-in {
	from {
		transform: translateX(-100%);
		opacity: 0.5;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Staggered item animation */
@keyframes item-fade-in {
	from {
		opacity: 0;
		transform: translateX(-20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Apply stagger to menu items */
.burger-menu[x-show="true"] .burger-menu-item {
	animation: item-fade-in 0.3s ease-out backwards;
}

.burger-menu[x-show="true"] .burger-menu-list li:nth-child(1) .burger-menu-item { animation-delay: 0.05s; }
.burger-menu[x-show="true"] .burger-menu-list li:nth-child(2) .burger-menu-item { animation-delay: 0.1s; }
.burger-menu[x-show="true"] .burger-menu-list li:nth-child(3) .burger-menu-item { animation-delay: 0.15s; }
.burger-menu[x-show="true"] .burger-menu-list li:nth-child(4) .burger-menu-item { animation-delay: 0.2s; }
.burger-menu[x-show="true"] .burger-menu-list li:nth-child(5) .burger-menu-item { animation-delay: 0.25s; }

/* ================================================
   GPU ACCELERATION & PERFORMANCE
   ================================================ */

.burger-menu,
.burger-backdrop {
	will-change: transform, opacity;
}

/* ================================================
   ACCESSIBILITY - Reduced motion
   ================================================ */

@media (prefers-reduced-motion: reduce) {
	.burger-menu,
	.burger-backdrop,
	.burger-btn,
	.burger-menu-item,
	.burger-close-btn {
		transition: none !important;
		animation: none !important;
	}

	.burger-btn:not([aria-expanded="true"]) {
		animation: none;
	}
}

/* ================================================
   RESPONSIVE - Mobile small screens
   ================================================ */

@media (max-width: 375px) {
	.burger-menu {
		width: 100vw;
		max-width: 100vw;
		border-right: none;
	}

	.burger-btn {
		top: 12px;
		left: 12px;
		width: 48px;
		height: 48px;
	}
}

/* ================================================
   HIDE DEFAULT NAVBAR
   ================================================ */

/* Masquer la navbar CTFd existante pour utilisateurs connectés */
body:not(.admin-page) .navbar {
	display: none;
}

/* Ajuster le padding top du main pour compenser l'absence de navbar */
body:not(.admin-page) main {
	padding-top: 0;
}
