 :root {
    --lab-bg: #0a0a0c;
    --lab-panel-bg: rgba(30, 30, 30, 0.7);
    --lab-border: 1px solid #333;
    --lab-header-color: var(--primary-color);
}

body {
    background-color: var(--lab-bg);
    background-image:
        linear-gradient(rgba(0, 170, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 170, 255, 0.03) 1px, transparent 1px);
    background-size: 25px 25px;
}

.lab-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.lab-header {
    text-align: center;
    margin-bottom: 4rem;
}
.lab-header .back-to-hub {
  display: inline-block;
  color: #00AAFF;      /* bleu primaire */
  text-decoration: none;
  margin-bottom: 2rem;
}
.lab-header h1 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--lab-header-color);
    margin-bottom: 0.5rem;
}

/* --- Grille de sélection des modules --- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.module-card {
    background: var(--lab-panel-bg);
    border: var(--lab-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}
.module-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}
.module-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}
.module-card h3 {
    font-family: var(--font-title);
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}
.module-card .module-cta {
    display: inline-block;
    margin-top: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Module désactivé */
.module-card.is-disabled {
    cursor: not-allowed;
    filter: grayscale(80%) opacity(0.5);
}
.module-card.is-disabled:hover {
    transform: none;
    border-color: #333;
}
.module-card.is-disabled .module-cta {
    color: #888;
}


/* --- Banc de Test (Simulateur) --- */
.test-bench {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--dark-bg);
    padding: 2rem;
    border: var(--lab-border);
    border-radius: 8px;
}

/* Style pour le nouveau lien "Retour" */
.back-link {
    grid-column: 1 / -1; /* Fait en sorte que le lien prenne toute la largeur de la grille */
    text-decoration: none;
    color: #888;
    margin-bottom: -1rem; /* Le remonte un peu pour un meilleur espacement */
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary-color);
}

.back-link i {
    margin-right: 0.5rem;
}

.bench-column h3 {
    font-family: var(--font-tech);
    color: var(--fpv-green);
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 1.2rem;
}
.input-group label {
    display: block;
    color: #ccc;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.input-group input, .input-group select {
    width: 100%;
    padding: 0.8rem;
    background: var(--dark-bg);
    border: var(--lab-border);
    border-radius: 5px;
    color: white;
    font-size: 1rem;
}
.checkbox-group { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-group input { width: auto; }

.tooltip {
    display: inline-block;
    background: #555;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    text-align: center;
    line-height: 18px;
    cursor: help;
    font-size: 0.8rem;
}

.test-bench .cta-button {
    width: 100%;
    margin-top: 2rem;
    padding: 1rem;
    font-size: 1.2rem;
}

/* Écran de résultats */
.results-screen {
    background: #0a0a0c;
    border: var(--lab-border);
    border-radius: 8px;
    
    /* --- MODIFICATION CI-DESSOUS --- */
    /* On supprime la hauteur fixe qui causait le débordement */
    /* height: 100%; */ 
    /* On ajoute une hauteur minimale pour que le panneau garde une belle taille même vide */
    min-height: 350px; 
    
    padding: 1.5rem;
    font-family: var(--font-tech);
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}
.results-screen .placeholder {
    color: #555;
    font-style: italic;
    text-align: center;
    margin-top: 40%;
}
.results-screen h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.results-screen p { line-height: 1.8; }
.results-screen .main-result {
    font-size: 2.5rem;
    font-family: var(--font-title);
    color: var(--fpv-green);
    text-align: center;
    margin: 2rem 0;
}
.results-screen .result-label {
    text-align: center;
    color: #888;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

/* Classe utilitaire */
.hidden {
    display: none !important;
}

/* --- AMÉLIORATIONS RESPONSIVE & CORRECTIONS --- */

@media (max-width: 992px) {
    /* Fait passer les colonnes du banc de test l'une sous l'autre */
    .test-bench {
        grid-template-columns: 1fr; /* Une seule colonne au lieu de deux */
    }

    .lab-header h1 {
        font-size: 2rem;
    }
}

/* --- CORRECTION DE LA SUPERPOSITION DES RÉSULTATS --- */

.results-screen {
    /* On ajuste le positionnement flex */
    justify-content: space-around; /* Espace joliment les blocs au lieu de les écraser au centre */
}

/* Style pour le bloc de détails du rapport */
.result-details {
    width: 100%; /* Prend toute la largeur */
    text-align: left; /* Texte aligné à gauche */
}

.result-details ul {
    list-style-type: none;
    padding-left: 0.5rem;
}

/* Style pour le bloc du résultat final */
.result-summary {
    width: 100%;
    text-align: center;
    margin-top: 2.5rem;
}

/* ============================================= */
/* ==   STYLES POUR LE SIMULATEUR DE CHARGE     == */
/* ============================================= */

.charge-bay {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--dark-bg);
    padding: 2rem;
    border: var(--lab-border);
    border-radius: 8px;
}

.charge-column h3 {
    font-family: var(--font-tech);
    color: var(--fpv-green);
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

/* --- Colonne de gauche : Animation et Rapport --- */
.charge-station {
    text-align: center;
}

.battery-animation {
    margin: 2rem auto;
    width: 100px;
}
.battery-body {
    height: 200px;
    border: 3px solid #888;
    border-radius: 10px;
    position: relative;
    background: #333;
    overflow: hidden;
}
.battery-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20%; /* Départ à 20% (tension de stockage) */
    background: linear-gradient(to top, var(--primary-color), var(--fpv-blue));
    transition: height 1s ease-out;
}
.battery-label {
    position: relative;
    top: 45%;
    color: white;
    font-family: var(--font-title);
    text-shadow: 1px 1px 2px black;
}
.battery-cap {
    width: 40px;
    height: 10px;
    background: #888;
    margin: 0 auto;
    border-radius: 0 0 5px 5px;
}

.charge-report-screen {
    background: #0a0a0c;
    border: var(--lab-border);
    border-radius: 8px;
    padding: 1rem;
    font-family: var(--font-tech);
    min-height: 150px;
    text-align: left;
}
.charge-report-screen .main-result {
    font-size: 2rem;
    text-align: center;
}

/* --- Colonne de droite : Contrôles --- */

/* Groupe de boutons C-Rate / Ampères */
.toggle-group div {
    display: flex;
}
.toggle-group .toggle-btn {
    flex-grow: 1;
    padding: 0.8rem;
    font-family: var(--font-tech);
    border: 1px solid #444;
    background: var(--light-bg);
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}
.toggle-group .toggle-btn:first-child { border-radius: 5px 0 0 5px; }
.toggle-group .toggle-btn:last-child { border-radius: 0 5px 5px 0; }

.toggle-group .toggle-btn.active {
    background: var(--primary-color);
    color: var(--dark-bg);
    border-color: var(--primary-color);
}

/* Slider de taux de charge */
.slider-output {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Responsive pour la baie de charge */
@media (max-width: 992px) {
    .charge-bay {
        grid-template-columns: 1fr;
    }
}:root {
    --lab-bg: #0a0a0c;
    --lab-panel-bg: rgba(30, 30, 30, 0.7);
    --lab-border: 1px solid #333;
    --lab-header-color: var(--primary-color);
}

body {
    background-color: var(--lab-bg);
    background-image:
        linear-gradient(rgba(0, 170, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 170, 255, 0.03) 1px, transparent 1px);
    background-size: 25px 25px;
}

.lab-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.lab-header {
    text-align: center;
    margin-bottom: 4rem;
}
.lab-header h1 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--lab-header-color);
    margin-bottom: 0.5rem;
}

/* --- Grille de sélection des modules --- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.module-card {
    background: var(--lab-panel-bg);
    border: var(--lab-border);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}
.module-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
}
.module-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}
.module-card h3 {
    font-family: var(--font-title);
    color: white;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}
.module-card .module-cta {
    display: inline-block;
    margin-top: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Module désactivé */
.module-card.is-disabled {
    cursor: not-allowed;
    filter: grayscale(80%) opacity(0.5);
}
.module-card.is-disabled:hover {
    transform: none;
    border-color: #333;
}
.module-card.is-disabled .module-cta {
    color: #888;
}


/* --- Banc de Test (Simulateur) --- */
.test-bench {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--dark-bg);
    padding: 2rem;
    border: var(--lab-border);
    border-radius: 8px;
}

/* Style pour le nouveau lien "Retour" */
.back-link {
    grid-column: 1 / -1; /* Fait en sorte que le lien prenne toute la largeur de la grille */
    text-decoration: none;
    color: #888;
    margin-bottom: -1rem; /* Le remonte un peu pour un meilleur espacement */
    transition: color 0.3s;
}

.back-link:hover {
    color: var(--primary-color);
}

.back-link i {
    margin-right: 0.5rem;
}

.bench-column h3 {
    font-family: var(--font-tech);
    color: var(--fpv-green);
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 1.2rem;
}
.input-group label {
    display: block;
    color: #ccc;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.input-group input, .input-group select {
    width: 100%;
    padding: 0.8rem;
    background: var(--dark-bg);
    border: var(--lab-border);
    border-radius: 5px;
    color: white;
    font-size: 1rem;
}
.checkbox-group { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-group input { width: auto; }

.tooltip {
    display: inline-block;
    background: #555;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    text-align: center;
    line-height: 18px;
    cursor: help;
    font-size: 0.8rem;
}

.test-bench .cta-button {
    width: 100%;
    margin-top: 2rem;
    padding: 1rem;
    font-size: 1.2rem;
}

/* Écran de résultats */
.results-screen {
    background: #0a0a0c;
    border: var(--lab-border);
    border-radius: 8px;
    
    /* --- MODIFICATION CI-DESSOUS --- */
    /* On supprime la hauteur fixe qui causait le débordement */
    /* height: 100%; */ 
    /* On ajoute une hauteur minimale pour que le panneau garde une belle taille même vide */
    min-height: 350px; 
    
    padding: 1.5rem;
    font-family: var(--font-tech);
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}
.results-screen .placeholder {
    color: #555;
    font-style: italic;
    text-align: center;
    margin-top: 40%;
}
.results-screen h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.results-screen p { line-height: 1.8; }
.results-screen .main-result {
    font-size: 2.5rem;
    font-family: var(--font-title);
    color: var(--fpv-green);
    text-align: center;
    margin: 2rem 0;
}
.results-screen .result-label {
    text-align: center;
    color: #888;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

/* Classe utilitaire */
.hidden {
    display: none !important;
}

/* --- AMÉLIORATIONS RESPONSIVE & CORRECTIONS --- */

@media (max-width: 992px) {
    /* Fait passer les colonnes du banc de test l'une sous l'autre */
    .test-bench {
        grid-template-columns: 1fr; /* Une seule colonne au lieu de deux */
    }

    .lab-header h1 {
        font-size: 2rem;
    }
}

/* --- CORRECTION DE LA SUPERPOSITION DES RÉSULTATS --- */

.results-screen {
    /* On ajuste le positionnement flex */
    justify-content: space-around; /* Espace joliment les blocs au lieu de les écraser au centre */
}

/* Style pour le bloc de détails du rapport */
.result-details {
    width: 100%; /* Prend toute la largeur */
    text-align: left; /* Texte aligné à gauche */
}

.result-details ul {
    list-style-type: none;
    padding-left: 0.5rem;
}

/* Style pour le bloc du résultat final */
.result-summary {
    width: 100%;
    text-align: center;
    margin-top: 2.5rem;
}

/* ============================================= */
/* ==   STYLES POUR LE SIMULATEUR DE CHARGE     == */
/* ============================================= */

.charge-bay {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--dark-bg);
    padding: 2rem;
    border: var(--lab-border);
    border-radius: 8px;
}

.charge-column h3 {
    font-family: var(--font-tech);
    color: var(--fpv-green);
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

/* --- Colonne de gauche : Animation et Rapport --- */
.charge-station {
    text-align: center;
}

.battery-animation {
    margin: 2rem auto;
    width: 100px;
}
.battery-body {
    height: 200px;
    border: 3px solid #888;
    border-radius: 10px;
    position: relative;
    background: #333;
    overflow: hidden;
}
.battery-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20%; /* Départ à 20% (tension de stockage) */
    background: linear-gradient(to top, var(--primary-color), var(--fpv-blue));
    transition: height 1s ease-out;
}
.battery-label {
    position: relative;
    top: 45%;
    color: white;
    font-family: var(--font-title);
    text-shadow: 1px 1px 2px black;
}
.battery-cap {
    width: 40px;
    height: 10px;
    background: #888;
    margin: 0 auto;
    border-radius: 0 0 5px 5px;
}

.charge-report-screen {
    background: #0a0a0c;
    border: var(--lab-border);
    border-radius: 8px;
    padding: 1rem;
    font-family: var(--font-tech);
    min-height: 150px;
    text-align: left;
}
.charge-report-screen .main-result {
    font-size: 2rem;
    text-align: center;
}

/* --- Colonne de droite : Contrôles --- */

/* Groupe de boutons C-Rate / Ampères */
.toggle-group div {
    display: flex;
}
.toggle-group .toggle-btn {
    flex-grow: 1;
    padding: 0.8rem;
    font-family: var(--font-tech);
    border: 1px solid #444;
    background: var(--light-bg);
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}
.toggle-group .toggle-btn:first-child { border-radius: 5px 0 0 5px; }
.toggle-group .toggle-btn:last-child { border-radius: 0 5px 5px 0; }

.toggle-group .toggle-btn.active {
    background: var(--primary-color);
    color: var(--dark-bg);
    border-color: var(--primary-color);
}

/* Slider de taux de charge */
.slider-output {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    color: var(--primary-color);
    font-weight: bold;
}

/* Responsive pour la baie de charge */
@media (max-width: 992px) {
    .charge-bay {
        grid-template-columns: 1fr;
    }
}

/* ============================================= */
/* == STYLES POUR L'ANALYSEUR DE CONFLITS VTX   == */
/* ============================================= */

.vtx-analyzer-bay {
    display: grid;
    grid-template-columns: 400px 1fr; /* Colonne de contrôle fixe, grille flexible */
    gap: 2rem;
    background: var(--dark-bg);
    padding: 2rem;
    border: var(--lab-border);
    border-radius: 8px;
}

.vtx-column h3 {
    font-family: var(--font-tech);
    color: var(--fpv-green);
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

/* --- Colonne de gauche : Contrôles --- */
#pilot-selection-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.pilot-selector {
    background: var(--lab-panel-bg);
    border: var(--lab-border);
    border-left: 3px solid #555; /* Bordure de statut initiale */
    border-radius: 5px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.pilot-selector.is-active {
    border-left-color: var(--primary-color);
}
.pilot-selector.in-conflict {
    border-left-color: #ff4757; /* Rouge conflit */
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.2);
}

.pilot-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.pilot-selector-header label {
    font-family: var(--font-title);
    font-size: 1.1rem;
}

.pilot-selector-header .pilot-active-toggle {
    width: 40px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

.pilot-selector-header .pilot-active-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #888;
    border-radius: 50%;
    transition: all 0.3s;
}

.pilot-selector-header input[type="checkbox"] {
    display: none;
}

.pilot-selector-header input:checked + .pilot-active-toggle {
    background: var(--fpv-green);
}
.pilot-selector-header input:checked + .pilot-active-toggle::after {
    left: 22px;
    background: white;
}

.pilot-selector-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    opacity: 0.5; /* Grisé par défaut */
    transition: opacity 0.3s;
}

.pilot-selector.is-active .pilot-selector-controls {
    opacity: 1;
}

/* --- Colonne de droite : Grille et Rapport --- */
.vtx-table-container {
    overflow-x: auto; /* Pour la responsivité sur petits écrans */
    border: var(--lab-border);
    border-radius: 5px;
    background-color: #0a0a0c;
}

#vtx-freq-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-tech);
    font-size: 0.9rem;
    white-space: nowrap;
}

#vtx-freq-table th, #vtx-freq-table td {
    padding: 0.8rem;
    text-align: center;
    border: 1px solid #2a2a2a;
}

#vtx-freq-table thead th {
    background-color: #1a1a1a;
    color: var(--primary-color);
}

#vtx-freq-table .band-name {
    font-weight: bold;
    color: #ccc;
    background-color: #1a1a1a;
}

.vtx-cell {
    cursor: default;
    transition: all 0.2s ease-in-out;
}

.vtx-cell.is-selected {
    background-color: var(--primary-color);
    color: var(--dark-bg);
    font-weight: bold;
    box-shadow: 0 0 15px var(--primary-color);
    transform: scale(1.1);
    z-index: 2;
    position: relative;
    border-radius: 5px;
}
.vtx-cell.is-conflict {
    background-color: #ff4757;
    color: white;
    box-shadow: 0 0 10px #ff4757;
}

/* Style combiné pour une cellule sélectionnée en conflit */
.vtx-cell.is-selected.is-conflict {
    background: repeating-linear-gradient(
      45deg,
      #ff4757,
      #ff4757 10px,
      var(--primary-color) 10px,
      var(--primary-color) 20px
    );
}

/* --- Légende et rapport --- */
.vtx-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 1.5rem 0;
    font-family: var(--font-tech);
}
.legend-item {
    padding: 0.3rem 1rem;
    border-radius: 5px;
    font-weight: bold;
}
.legend-item.legend-selected { background-color: var(--primary-color); color: var(--dark-bg); }
.legend-item.legend-conflict { background-color: #ff4757; color: white; }
.legend-item.legend-safe { border: 1px solid #444; color: #888; }

.vtx-summary {
    background: #0a0a0c;
    border: var(--lab-border);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 100px;
}

.vtx-summary-list {
    list-style: none;
    padding: 0;
    font-family: var(--font-tech);
}

.vtx-summary-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid #2a2a2a;
}
.vtx-summary-list li:last-child { border: none; }

.summary-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.summary-status-dot.ok { background-color: var(--fpv-green); }
.summary-status-dot.conflict { background-color: #ff4757; }


/* Responsive pour la baie VTX */
@media (max-width: 992px) {
    .vtx-analyzer-bay {
        grid-template-columns: 1fr;
    }
}

/* ... (début du fichier inchangé) ... */

.pilot-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* --- AJOUT DE CETTE NOUVELLE RÈGLE --- */
/* On s'assure que le label prend toute la place et aligne correctement le texte et le toggle */
.pilot-selector-header label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
}

.pilot-selector-header label > div {
    display: flex;
    align-items: center;
}