/* Sidebar */
.neptune-sidebar {
  flex: 0 0 260px;
  height: 100%;
  overflow-y: auto;
}

/* Main scrollable */
.neptune-details {
  flex: 1;
  height: 100%;
  overflow-y: auto;
}

/* Le layout principal occupe tout l’espace restant */
.neptune-layout {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  width: 100%;
  height: calc(100dvh - 280px);
  margin: 40px auto;
  padding: 0 24px;
  padding-bottom: 50px;
  box-sizing: border-box;
}

/* Sidebar collée à gauche */
.neptune-sidebar {
  flex: 0 0 260px; /* largeur fixe */
  margin-left: 0; /* supprime tout centrage */
  position: sticky;
  top: 24px;
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 12px;
}

/* Panneau principal qui prend le reste */
.neptune-details {
  flex: 1; /* occupe tout l’espace restant */
  min-height: 400px;
  overflow-y: auto;
  padding-bottom: 40px;
}

.neptune-details img {
    width: 100%;
    border-radius: 10px;
    margin-top: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.neptune-details img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(77,163,255,0.45);
    transition: 0.25s ease;
}

/* Scrollbar Neptune */
.neptune-details::-webkit-scrollbar {
    width: 8px;
}

.neptune-details::-webkit-scrollbar-thumb {
  background: rgba(77,163,255,0.4);
  border-radius: 8px;
}

.neptune-details::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6BB4FF, #2F7EF0);
}

.neptune-sidebar::-webkit-scrollbar {
  width: 8px;
}

.neptune-sidebar::-webkit-scrollbar-thumb {
  background: rgba(77,163,255,0.4);
  border-radius: 8px;
}

.neptune-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #6BB4FF, #2F7EF0);
}

/* Alignement des titres sidebar et panneau central */
.neptune-sidebar h3,
.neptune-details h3 {
  margin-top: 0;
  margin-bottom: 12px;
  padding-left: 4px; /* ajuste selon ton goût */
}

/* Harmonisation du padding vertical */
.neptune-sidebar,
.neptune-details {
  padding-top: 24px;
}

.neptune-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Module dans la sidebar */
.neptune-module {
    background: rgba(255,255,255,0.55);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

body.theme-dark .neptune-module {
    background: rgba(10,25,45,0.65);
}

.neptune-module img {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 6px rgba(77,163,255,0.55));
}

.neptune-module span {
    font-weight: 500;
    color: var(--accent);
}

/* Hover */
.neptune-module:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(77,163,255,0.35);
}

/* Active module */
.neptune-module.active {
    border-left: 4px solid var(--accent);
    background: rgba(77,163,255,0.15);
}

/* Miniature */
.neptune-diagram-thumb {
    width: 20% !important;
	min-width: 180px;
    height: auto;
    border-radius: 12px;
    cursor: zoom-in;
    transition: transform 0.25s ease;
    display: inline-block;
}

.neptune-diagram-thumb:hover {
    transform: scale(1.03);
}

/* Modal Neptune */
.neptune-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(8px);
    z-index: 999;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.neptune-modal-img {
    width: 50%;              /* taille d’affichage dans la fenêtre */
    max-width: 900px;        /* limite pour les grands écrans */
    height: auto;            /* conserve les proportions */
    border-radius: 16px;
    box-shadow: 0 0 25px rgba(77,163,255,0.45);
    animation: neptuneZoom 0.25s ease;
}

@keyframes neptuneZoom {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Tableaux Neptune */
.neptune-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95em;
    color: var(--text);
	background: rgba(255,255,255,0.03);
    backdrop-filter: blur(8px);
    border-radius: 12px;
}

.neptune-table th,
.neptune-table td {
    padding: 10px 16px;
    text-align: left;
    vertical-align: top;
}

/* ============================
   Équilibrage des tableaux à 3 colonnes
   ============================ */
.neptune-table th:nth-child(1),
.neptune-table td:nth-child(1),
.neptune-table th:nth-child(2),
.neptune-table td:nth-child(2),
.neptune-table th:nth-child(3),
.neptune-table td:nth-child(3) {
    width: auto;
}

/* Spécifique aux tableaux à 3 colonnes */
.neptune-table tr > *:nth-child(3) {
    width: 33%;
}

/* Spécifique aux tableaux à 2 colonnes */
.neptune-table tr > *:nth-child(2):last-child {
    width: 65%;
}

/* En-tête subtile */
.neptune-table thead th {
    border-bottom: 1px solid rgba(77,163,255,0.35);
    color: var(--accent);
}

/* Lignes alternées */
.neptune-table tbody tr:nth-child(even) {
    background-color: rgba(255,255,255,0.03);
}

/* Effet hover */
.neptune-table tbody tr:hover {
    background-color: rgba(77,163,255,0.08);
    transition: background-color 0.2s ease;
}

/* Bouton flottant Neptune */
.sidebar-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: rgba(77,163,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(77,163,255,0.4);
  color: var(--text);
  font-size: 1.2rem;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: background 0.3s ease, transform 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(77,163,255,0.25);
  transform: scale(1.05);
}

/* ============================
   Adaptation responsive
   ============================ */

/* Tablettes (≤ 1024px) */
@media (max-width: 1024px) {
    .neptune-diagram-thumb {
        width: 35%;
    }
    .neptune-modal-img {
        width: 65%;
    }
}

/* Tablettes (≤ 900px) */
@media (max-width: 900px) {
  .neptune-layout {
	grid-template-columns: 1fr;
    flex-direction: column;
  	height: calc(100dvh - 40px); /* 40px ≈ hauteur du footer */
    overflow-y: auto;
  }

  .neptune-sidebar {
    position: static;
    width: 100%;
    margin-bottom: 20px;
	top: 0; /* distance depuis le haut */
    z-index: 998;
    background: rgba(10,25,45,0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    border-radius: 0 0 12px 12px;
    transition: transform 0.3s ease;
  }

  .neptune-details {
    width: 100%;
    height: 100%;
    overflow-y: auto;
	transition: transform 0.3s ease;
  }
}

/* Mobiles (≤ 768px) */
@media (max-width: 768px) {
    .neptune-diagram-thumb {
        width: 50%;
    }
    .neptune-modal-img {
        width: 80%;
    }
}

/* Petits écrans (≤ 480px) */
@media (max-width: 480px) {
    .neptune-diagram-thumb {
        width: 70%;
    }
    .neptune-modal-img {
        width: 90%;
    }
}