/* ================================================= */
/* VARIABLES GLOBALES                                */
/* ================================================= */
:root {
  --bg: #111;
  --text: #eee;
  --card: #1b1b1b;
  --accent: #ff8c00;
  --accent-dark: #cc6f00;
  --nav-height: 90px;
  --border-radius: 10px;
  --btn-pill: 50px;
  --transition: 0.3s ease;
}

/* ================================================= */
/* RESET                                             */
/* ================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px); 
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================================================= */
/* NAVIGATION PRINCIPALE (HEADER MODERNE)            */
/* ================================================= */
nav.main-nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-height);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: space-between; 
  padding: 0 5%;
  z-index: 2000;
  border-bottom: 2px solid var(--accent);
}

.nav-brand a { font-size: 1.5rem; font-weight: bold; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; }

.nav-links { display: flex; gap: 0.5rem; align-items: center; height: 100%; }

.nav-links a, .dropdown-trigger {
  color: var(--text); font-weight: bold; padding: 0.8rem 1.2rem;
  transition: var(--transition); white-space: nowrap; display: flex; align-items: center; cursor: pointer;
}

.nav-links a.active {
  color: var(--accent) !important; font-size: 1.15rem; text-shadow: 2px 2px 4px #000; 
  background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="15" fill="%23FFD700" opacity="0.3"/><path d="M50 20 L55 0 L65 10 L55 20 Z" fill="%23FF8C00" /><path d="M50 80 L55 100 L65 90 L55 80 Z" fill="%23FF8C00" /><path d="M20 50 L0 60 L10 70 L20 60 Z" fill="%23FF8C00" /><path d="M80 50 L100 60 L90 70 L80 60 Z" fill="%23FF8C00" /><path d="M25 25 L5 10 L20 0 L30 15 Z" fill="%23FF8C00" /><path d="M75 25 L95 10 L80 0 L70 15 Z" fill="%23FF8C00" /><path d="M25 75 L5 90 L20 100 L30 85 Z" fill="%23FF8C00" /><path d="M75 75 L95 90 L80 100 L70 85 Z" fill="%23FF8C00" /></svg>');
  background-size: contain; background-repeat: no-repeat; background-position: center; transition: all 0.2s ease;
}

.dropdown-menu a.active { background-image: none !important; font-size: 1rem; text-shadow: none; }

/* --- DROPDOWN (DESKTOP) --- */
.has-dropdown { position: relative; height: 100%; display: flex; align-items: center; }

.dropdown-menu {
  position: absolute; top: var(--nav-height); left: 50%; transform: translateX(-50%) translateY(10px);
  background: #151515; border: 1px solid #333; border-top: 2px solid var(--accent); min-width: 200px;
  display: none; flex-direction: column; box-shadow: 0 10px 25px rgba(0,0,0,0.7); padding: 0.5rem 0;
  opacity: 0; transition: 0.2s;
}

.has-dropdown:hover .dropdown-menu { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.dropdown-menu a { padding: 0.8rem 1.5rem; font-size: 0.9rem; text-align: left; width: 100%; }
.dropdown-menu a:hover { background: rgba(255, 140, 0, 0.1); color: var(--accent); }

/* --- BURGER --- */
.burger { display: none; flex-direction: column; justify-content: space-around; width: 30px; height: 21px; cursor: pointer; }
.burger span { width: 100%; height: 3px; background: var(--accent); border-radius: 10px; transition: all 0.3s linear; }
.burger.toggle span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger.toggle span:nth-child(2) { opacity: 0; }
.burger.toggle span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* ================================================= */
/* SPECIFIQUE ACCUEIL - HERO & EXPERTISES            */
/* ================================================= */
header.hero {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 450px; width: 100%; margin-top: var(--nav-height);
  background-image: url("../assets/img/hero.jpg") !important; background-position: center;
  background-size: cover; background-repeat: no-repeat; overflow: hidden;
}

.hero-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1; }
.hero-content { position: relative; z-index: 2; padding: 0 1rem; }
.hero-content a {
  display: inline-block; background: transparent; border: 2px solid var(--accent); color: #fff;
  padding: 0.8rem 2rem; border-radius: var(--btn-pill); font-weight: bold; text-decoration: none; margin-top: 1.5rem; transition: var(--transition);
}
.hero-content a:hover { background: var(--accent); color: #000; }
.accent-text { color: var(--accent); }

.expertises-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.expertise-card { background: var(--card); border: 1px solid #333; padding: 2rem; border-radius: var(--border-radius); transition: var(--transition); }
.expertise-card:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.expertise-icon { font-size: 3.2rem; display: block; margin-bottom: 1rem; color: var(--accent); }

/* ================================================= */
/* CONTENEUR PAGE                                    */
/* ================================================= */
.page-container { max-width: 1100px; margin: calc(var(--nav-height) + 2rem) auto 2rem; padding: 0 1rem; text-align: center; }
.page-container h1::after { content: ""; display: block; width: 120px; height: 3px; background: var(--accent); margin: 0.8rem auto 2rem; border-radius: 2px; }

/* ================================================= */
/* SOUS-MENUS DES PAGES (ONGLETS)                    */
/* ================================================= */
.prestations-menu, .demos-menu, .resource-menu, .history-menu { display: flex; justify-content: center; gap: 1rem; margin: 2rem 0 3rem; flex-wrap: wrap; }
.prestations-menu button, .demos-menu button, .resource-menu button, .history-menu button {
  padding: 0.7rem 1.6rem; border-radius: var(--btn-pill); border: 2px solid var(--accent); background: transparent; color: #fff; cursor: pointer; transition: var(--transition); font-size: 1rem; font-weight: bold;
}
.prestations-menu button:hover, .demos-menu button:hover, .resource-menu button:hover, .history-menu button:hover,
.prestations-menu button.active, .demos-menu button.active, .resource-menu button.active, .history-menu button.active { background: var(--accent); color: #000; }

/* ================================================= */
/* SECTIONS FILTRÉES                                 */
/* ================================================= */
.prestations-section, .demos-section, .resource-section, .history-section { display: none; }
.prestations-section.active, .demos-section.active, .resource-section.active, .history-section.active { display: block; }

/* ================================================= */
/* PRESTATIONS & PROJETS - CARDS                     */
/* ================================================= */
.cards, .project-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; margin-bottom: 2rem; }
.card, .project-card {
  background: var(--card); border: 1px solid #333; border-radius: var(--border-radius); transition: transform var(--transition); display: flex; flex-direction: column; overflow: hidden; padding: 1.5rem; align-items: center; text-align: center;
}
.card:hover, .project-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card a.card-link, .project-card a.project-link {
  display: inline-block; background: rgba(255, 140, 0, 0.1); border: 2px solid var(--accent); color: #fff; padding: 0.6rem 1.8rem; border-radius: var(--btn-pill); font-weight: bold; margin-top: 1rem; transition: var(--transition);
}
.card a.card-link:hover, .project-card a.project-link:hover { background: var(--accent); color: #000; }
.project-card img { max-width: 120px !important; max-height: 80px !important; width: auto; height: auto; object-fit: contain !important; margin: 0 auto 1.5rem auto; display: block; }
.card-icon { width: 72px; height: 72px; flex-shrink: 0; }
.card-entretien .card-icon { filter: invert(19%) sepia(92%) saturate(7480%) hue-rotate(357deg) brightness(95%) contrast(108%); }
.card-autre .card-icon { filter: invert(63%) sepia(88%) saturate(4000%) hue-rotate(5deg) brightness(105%) contrast(103%); }

/* ================================================= */
/* VIEWERS — RESSOURCES & DEMOS                      */
/* ================================================= */
.demos-container { display: flex; gap: 1.2rem; min-height: calc(100vh - var(--nav-height) - 6rem); flex-wrap: wrap; }
.demos-sidebar { width: 300px; background: var(--card); padding: 1rem; border-radius: var(--border-radius); border: 1px solid #333; overflow-y: auto; flex-shrink: 0; }
.demos-sidebar a { display: block; margin: 0.35rem 0; padding: 0.5rem; border-radius: 4px; transition: var(--transition); }
.demos-sidebar a:hover { background: var(--accent-dark); color: #000; text-decoration: none; }

.viewer-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 300px; }

/* CORRECTIF : Bouton réduit, plaqué à droite */
.viewer-controls {
  background: #222; border: 1px solid #333; border-bottom: none;
  border-radius: var(--border-radius) var(--border-radius) 0 0; padding: 8px 15px;
  display: flex; justify-content: flex-end; align-items: center;
}

.btn-fullscreen {
  display: inline-flex; justify-content: center; align-items: center;
  width: max-content; /* Ne prend que la largeur nécessaire */
  background: transparent; color: var(--text); border: 1px solid var(--accent);
  padding: 5px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 0.85rem; transition: var(--transition);
}
.btn-fullscreen:hover { background: var(--accent); color: #000; }

.viewer {
  flex: 1; display: flex; flex-direction: column; background: var(--card);
  border-radius: 0 0 var(--border-radius) var(--border-radius); border: 1px solid #333; overflow: hidden; position: relative; min-height: 500px;
}
.preview-content { flex: 1; position: relative; width: 100%; height: 100%; background: #000; display: flex; align-items: center; justify-content: center; }
.preview-content embed, .preview-content iframe, .preview-content video, .preview-content object {
  position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; border: none; display: block;
}

/* ================================================= */
/* HISTOIRE, EQUIPES & LOGIQUE COLONNES              */
/* ================================================= */
.timeline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.6rem; margin: 2.5rem 0; }
.timeline-item { background: var(--card); border: 1px solid #333; border-radius: 12px; padding: 1.4rem; text-align: center; transition: transform 0.25s ease; }
.timeline-item:hover { transform: translateY(-6px); box-shadow: 0 8px 20px rgba(0,0,0,0.4); border-color: var(--accent); }
.t-icon { font-size: 2.8rem; display: block; margin-bottom: 0.5rem; }
.founder-photo { width: 180px; height: 220px; border-radius: 50% / 60%; object-fit: cover; border: 3px solid var(--accent); filter: grayscale(100%) contrast(1.1); }

/* CORRECTIF : Grille principale des Entreprises forçée à 2 colonnes sur PC */
#team-main-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.carrier-main-card { 
  background: var(--card); border-radius: var(--border-radius); border: 1px solid #333; overflow: hidden; transition: var(--transition); display: flex; flex-direction: column;
}
.carrier-main-card:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.carrier-header { display: flex; align-items: center; gap: 1rem; padding: 1.5rem; cursor: pointer; }
.carrier-logo { width: 80px; height: 80px; object-fit: contain; border-radius: 8px; background: transparent; flex-shrink: 0; }

.operators-container { display: none; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; padding: 0 1.5rem 1.5rem; }
.operator-card {
  background: var(--card); border: 1px solid #333; border-radius: var(--border-radius); padding: 1.2rem;
  display: flex; align-items: center; gap: 1.5rem; text-align: left; transition: var(--transition);
}
.operator-card:hover { border-color: rgba(255, 140, 0, 0.5); }
.operator-photo {
  width: 90px; height: 90px; object-fit: contain; background: transparent; border-radius: 12px; border: 2px solid var(--accent); filter: grayscale(100%) contrast(1.1); flex-shrink: 0; transition: var(--transition);
}
.operator-card:hover .operator-photo { filter: grayscale(0%); }
.operator-card a {
  display: inline-block; margin-top: 0.5rem; background: rgba(255, 140, 0, 0.1); border: 2px solid var(--accent); color: #fff; padding: 0.5rem 1.5rem; border-radius: var(--btn-pill); font-weight: bold; font-size: 0.85rem; transition: var(--transition); text-align: center;
}
.operator-card a:hover { background: var(--accent); color: #000; transform: translateY(-2px); }

/* ================================================= */
/* CORRECTIFS CRITIQUES MENU MOBILE                  */
/* ================================================= */
@media (max-width: 850px) {
  .burger { display: flex !important; z-index: 3000; }

	.nav-links {
		display: flex !important;
		position: fixed;
		top: 0;
		right: -100%;
		width: 80%; /* Utilise un pourcentage pour éviter de sortir de l'écran */
		max-width: 300px;
		height: 100vh;
		background: #0d0d0d;
		flex-direction: column;
		padding: 80px 20px 20px 20px; /* Espace pour le bouton fermer */
		transition: 0.4s ease;
		z-index: 2050;
		overflow-y: auto;
		box-sizing: border-box; /* IMPORTANT : inclut le padding dans la largeur */
	  }
	.nav-links.open { right: 0 !important; }
  
  .nav-links a, .dropdown-trigger { 
    width: 100%; font-size: 1.1rem; padding: 1.2rem 0; border-bottom: 1px solid #222; background: none !important; 
    white-space: normal; /* Autorise le texte à revenir à la ligne si besoin */
  }
  
  .has-dropdown { flex-direction: column; width: 100%; align-items: flex-start; height: auto; }
  
  /* CORRECTIF : Sous-menu mobile aligné, sans débordement gauche */
  /* Le sous-menu (Accordéon) */
  .dropdown-menu {
    position: static;
    display: none; /* Caché par défaut */
    width: 100%;
    background: #1a1a1a;
    border: none;
    transform: none;
    opacity: 1;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }
  .dropdown-menu.show {
    display: block; /* S'affiche quand on clique */
  }
  .dropdown-menu a {
    padding: 12px 20px;
    font-size: 0.95rem;
    border-bottom: 1px solid #333;
    display: block;
    width: 100%;
    box-sizing: border-box;
    white-space: normal; /* Empêche le texte de déborder horizontalement */
  }
  .dropdown-menu a:last-child { border-bottom: none; }

  /* Passage à 1 colonne pour les équipes sur mobile */
  #team-main-container { grid-template-columns: 1fr; }

  /* Viewer mobile en colonne */
  .demos-container { flex-direction: column; gap: 1.5rem; }
  .demos-sidebar { width: 100%; }
  .viewer-wrapper { width: 100%; min-height: 450px; }
  .viewer { min-height: 400px; }
}