/* ######################################################################
verre_composants.css : variables communes, ecran de chargement, coque du jeu (menu lateral, bandeau) et composants (pastilles, filtres, champs).
   Charge apres les feuilles par page et juste avant verre.css.
###################################################################### */

/* ======================================================================
   Variables communes (typographie, espacements, rayons)
   (ancienne feuille : styles/tokens.css)
   ====================================================================== */
/*
 * tokens.css : variables communes a tous les themes (Dark / Light / Gray).
 * Charge AVANT le theme. Les couleurs restent definies par chaque theme
 * (global.css :root) ; ici on ne definit que ce qui est independant du theme.
 */
:root {
	/* Typographie */
	--font-sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--text-xs: 0.75rem;
	--text-sm: 0.85rem;
	--text-base: 0.95rem;
	--text-lg: 1.15rem;

	/* Espacements (echelle 4 px) */
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 24px;
	--space-6: 32px;

	/* Rayons */
	--radius-sm: 8px;
	--radius-md: 12px;
	--radius-lg: 16px;

	/* Coque du jeu */
	--sidebar-w: 240px;
	--tap-min: 44px;
	--bp-mobile: 767px;

	/* Mouvement */
	--ease: 0.25s ease;

	/* Alias vers les variables des themes (avec valeur de secours) */
	--shell-accent: var(--accent, #7c5cff);
	--shell-border: var(--glass-border, rgba(255, 255, 255, 0.06));
	--shell-chip-bg: var(--background-box, rgba(32, 32, 32, 0.31));
	--shell-bar-bg: color-mix(in srgb, var(--panel, #0f1720) 72%, transparent);
}


/* ======================================================================
   Ecran de chargement
   (ancienne feuille : styles/loader.css)
   ====================================================================== */
	#chargement_page {
	  position: fixed;
	  z-index: 999999999 !important;
	  background: #0e1215;
	  top: 0;
	  left: 0;
	  right: 0;
	  bottom: 0;
	  width: 100%;
	  height: 100%;
	}
	.chargement_page {
	  position: absolute;
	  top: 40%;
	  left: 35%;
	  width: 550px;
	  display: inline-block;
	  content: " ";
	  display: block;
	}
	
	@keyframes dual-ring {
	  0% {
	    transform: rotate(0deg);
	  }
	  100% {
	    transform: rotate(360deg);
	  }
	}


/* ======================================================================
   Coque du jeu : menu lateral, bandeau du haut
   (ancienne feuille : styles/shell.css)
   ====================================================================== */
/*
 * shell.css : coque du jeu (sidebar, barre de stats, zone de contenu), responsive.
 * Charge APRES le theme et les CSS de page : il surcharge les anciennes regles
 * de mise en page (float, largeurs fixes, vh) de global.css / menu.css.
 * Point de rupture mobile : 767 px (identique a menu.css).
 */

/* ---------- Base ---------- */
html, body {
	font-family: var(--font-sans);
}
body {
	overflow-x: hidden;
}
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--shell-accent);
	outline-offset: 2px;
}

/* ---------- Mise en page generale ---------- */
#interface {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	max-height: none !important;
}
#menu {
	flex: 0 0 var(--sidebar-w);
	width: var(--sidebar-w) !important;
	float: none;
}
#jeu {
	flex: 1 1 0;
	min-width: 0;
	width: auto !important;
	float: none;
	height: auto;
	min-height: 100vh;
}
#jeu img {
	max-width: 100%;
	height: auto;
}

/* ---------- Barre de stats (en-tete compagnie) ---------- */
#header_compagnie {
	position: sticky;
	top: 0;
	z-index: 50;
	margin: 0 !important;
	background: var(--shell-bar-bg) !important;
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--shell-border);
}
#header_compagnie .interface {
	width: 100%;
	max-height: none;
}
#interface_compagnie {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-2);
	padding: var(--space-3) var(--space-4);
}
.header_compagnie {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	padding: var(--space-2) var(--space-4) !important;
	font-size: var(--text-sm) !important;
	line-height: 1.2;
	white-space: nowrap;
	text-align: center;
	background: var(--shell-chip-bg);
	border: 1px solid var(--shell-border) !important;
	border-radius: var(--radius-md);
	box-shadow: none;
}
.header_compagnie g {
	font-weight: 700;
}

/* ---------- Sidebar ---------- */
.sidebar {
	font-size: var(--text-base);
}
.menu-link {
	min-height: var(--tap-min);
	padding-top: 0;
	padding-bottom: 0;
}
.menu-link:focus-visible,
.submenu-item:focus-visible {
	background: rgba(255, 255, 255, 0.08);
}
.submenu-item {
	font-size: var(--text-sm);
}
.category-title {
	color: var(--color-side-bar, #9aa6b2);
}
.toggle-btn {
	min-width: var(--tap-min);
	min-height: var(--tap-min);
	padding: 0;
	align-items: center;
	justify-content: center;
	background: var(--shell-accent);
	box-shadow: var(--card-shadow, 0 4px 15px rgba(0, 0, 0, 0.35));
}

/* ---------- Publicites : ne pas reserver de place vide ---------- */
ins.adsbygoogle {
	max-width: 100%;
}
ins.adsbygoogle[data-ad-status="unfilled"] {
	display: none !important;
}
.box.ad-empty {
	display: none !important;
}

/* ---------- Notifications / astuces (une seule visible, voir js/astuce.js) ---------- */
#notification {
	width: min(380px, calc(100vw - 16px));
	max-height: calc(100vh - 80px);
}

/* ---------- Mobile (<= 767 px) ---------- */
@media (max-width: 767px) {
	#interface {
		display: block;
	}
	/* la sidebar est un tiroir (position: fixed) : #menu ne doit rien reserver */
	#menu {
		width: 0 !important;
		flex: none;
		height: 0;
		overflow: visible;
	}
	.sidebar {
		width: min(320px, 85vw);
		max-width: none;
		/* fond opaque : le fond du theme est translucide (OK en colonne fixe, pas en tiroir) */
		background: var(--panel, #0f1720);
	}
	body.sidebar-open .toggle-btn {
		left: calc(min(320px, 85vw) + var(--space-2));
	}
	#jeu {
		width: 100% !important;
		min-height: 100vh;
	}

	/* barre de stats : une seule ligne defilante, a droite du bouton menu */
	#header_compagnie {
		margin: 0 !important;
	}
	#interface_compagnie {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		gap: var(--space-2);
		/* place pour le bouton menu (position: fixed a gauche) */
		padding: var(--space-3) var(--space-3) var(--space-3) 72px;
		scroll-padding-left: 72px;
		scrollbar-width: none;
	}
	#interface_compagnie::-webkit-scrollbar {
		display: none;
	}
	.header_compagnie {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}
	.toggle-btn {
		display: inline-flex;
		top: var(--space-2);
		left: var(--space-3);
	}

	/* contenu : pleine largeur, tableaux defilables au lieu de deborder */
	.interface,
	.affichage,
	#affichage {
		width: 100%;
		max-height: none;
		padding: 0 var(--space-2);
		box-sizing: border-box;
	}
	.box, .box_medium, .box_flotte, .box_quart, .box_alerte, .box_small,
	.box_information, .box_large, .box_radar, .box_maintenance_serveur, .proposition_contrat, .commande {
		flex: 1 1 100% !important;
		min-width: 0;
		max-width: 100%;
		box-sizing: border-box;
		overflow-x: auto;
	}
	.table, table {
		max-width: 100%;
	}
	ins.adsbygoogle {
		width: 100% !important;
		height: auto !important;
	}
	#notification {
		width: calc(100vw - 16px);
		right: 8px;
		top: 64px;
	}
}


/* ======================================================================
   Composants : pastilles, filtres, champs de recherche
   (ancienne feuille : styles/components.css)
   ====================================================================== */
/*
 * components.css : composants communs (pastilles de filtre, champs, listes de choix, pubs).
 * Charge APRES shell.css. Utilise les variables des themes et de tokens.css.
 */

/* ---------- Barres de defilement fines (remplace les barres blanches natives) ---------- */
#jeu * {
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

/* ---------- Cartes ---------- */
.box, .box_large, .box_medium, .box_flotte, .box_quart {
	border-radius: var(--radius-lg);
}

/* ---------- Listes de choix (constructeurs, hubs) : on passe a la ligne au lieu de defiler ---------- */
.box_liste:has(> .choix_box) {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	white-space: normal;
	overflow: visible;
	padding: var(--space-3) var(--space-4);
}
.box_liste:has(> .choix_box) > .choix_box {
	margin: 0;
	display: inline-flex;
	align-items: center;
}

/* ---------- Illustrations d'avions : contenues dans la carte (plus de barre de defilement) ---------- */
.illustration_box {
	overflow: hidden;
	text-align: center;
}
.illustration_box img {
	margin: var(--space-4) !important;
	max-width: calc(100% - 2 * var(--space-4));
	height: auto;
	object-fit: contain;
}

/* ---------- Pastilles de filtre (radio / case a cocher avec libelle) ---------- */
.filtre-pills,
.filtre-tri {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	padding: var(--space-2) 0;
}
.pill {
	position: relative;
	display: inline-flex;
	cursor: pointer;
}
.pill input {
	position: absolute;
	opacity: 0;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	cursor: pointer;
}
.pill span {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 var(--space-4);
	font-size: var(--text-sm);
	color: var(--muted, #9aa6b2);
	background: var(--shell-chip-bg);
	border: 1px solid var(--shell-border);
	border-radius: 999px;
	transition: background var(--ease), color var(--ease), border-color var(--ease);
	user-select: none;
}
.pill:hover span {
	color: var(--color-hover, #e6eef6);
	border-color: rgba(255, 255, 255, 0.18);
}
.pill input:checked + span {
	background: var(--background-verte, rgba(45, 108, 14, 1));
	color: #fff;
	border-color: transparent;
}
.pill input:focus-visible + span {
	outline: 2px solid var(--shell-accent);
	outline-offset: 2px;
}
.pill-reset span {
	margin-left: auto;
}

/* Tri du marche : un groupe par critere (icone + titre + 2 pastilles) */
.filtre-tri {
	gap: var(--space-4) var(--space-5);
}
.filtre-tri-groupe {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--space-2);
}
.filtre-tri-groupe .image_rubrique {
	width: 28px;
	height: 28px;
	object-fit: contain;
}
.filtre-tri-titre {
	min-width: 96px;
	font-weight: 600;
	font-size: var(--text-sm);
}

/* ---------- Champs de recherche ---------- */
.filtre-champs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3) var(--space-5);
	padding: var(--space-2) 0;
}
.champ {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--text-sm);
}
.champ > span {
	font-weight: 600;
	color: var(--color-contenu, #e6eef6);
}
.champ em {
	font-style: normal;
	color: var(--muted, #9aa6b2);
}
.champ input {
	min-height: 36px;
	box-sizing: border-box;
	padding: 0 var(--space-3);
	color: var(--color-contenu, #e6eef6);
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--shell-border);
	border-radius: var(--radius-sm);
}
.champ input[type="number"] {
	width: 72px;
	text-align: right;
}
.champ-recherche {
	flex: 1 1 260px;
}
.champ-recherche input {
	flex: 1 1 auto;
	min-width: 0;
}

/* ---------- Publicites : trois encarts cote a cote au lieu d'empiles ---------- */
.box:has(> ins.adsbygoogle) {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: var(--space-3);
	align-items: start;
	padding: var(--space-3);
}
.box:has(> ins.adsbygoogle) > ins.adsbygoogle {
	display: block;
	width: 100% !important;
	max-width: 100%;
	margin: 0;
}

/* le formulaire de tri occupe toute la largeur de la grille (au lieu d'une demi-colonne) */
.grille > .choix_tri {
	grid-column: 1 / -1;
	width: 100%;
}
@media (min-width: 768px) {
	.filtre-tri-groupe {
		flex-wrap: nowrap;
	}
}

@media (max-width: 767px) {
	.pill span {
		min-height: var(--tap-min);
	}
	.pill-reset span {
		margin-left: 0;
	}
	.champ-recherche {
		flex-basis: 100%;
	}
	.filtre-tri-titre {
		min-width: 0;
		flex: 1 0 100%;
	}
	.filtre-tri-groupe .image_rubrique {
		display: none;
	}
	/* bandeau d'info pose sur la carte (reseau) : ne depasse plus a droite */
	.infos {
		box-sizing: border-box;
		max-width: calc(100% - 84px);
	}
}


