/* Hauteur complète de la page */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}


body {
  display: flex;
  flex-direction: column;
}

/* Container pour la page de présentation de l'ordinateur */
.ordi-presentation-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 1rem;
    margin-right: 10px;
}

.ordi-presentation-container .ordi-view {
    grid-column: 1;
    grid-row: 1 / -1;
}

.ordi-presentation-container .ordi-external-links {
    grid-column: 3;
    grid-row: 2;
    align-self: start;
}

.ordi-presentation-container .ordi-specs {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
}

/* Tableau des motherboards dans la page de présentation */
.motherboards-table {
    grid-column: 2;
    grid-row: 1 / -1;
}

.motherboards-table h3 {
    color: #0f0;
    margin-bottom: 0.5rem;
    margin-top: -0.25em;
    font-size: 1.3rem;
}

.motherboards-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--body-background2);
    border: 1px solid #444;
}

.motherboards-table th {
    background: var(--body-background3);
    color: #0f0;
    padding: 0.5rem;
    text-align: left;
    border: 1px solid #444;
    font-weight: bold;
}

.motherboards-table td {
    padding: 0.5rem;
    border: 1px solid #444;
    color: var(--header-text-color);
}

.motherboards-table a {
    color: var(--link-text-color);
    text-decoration: none;
}

.motherboards-table a:hover {
    text-decoration: underline;
}

.mobo-img-cell {
    width: 120px;
    text-align: center;
}

.mobo-thumbnail {
    max-width: 100px;
    max-height: 80px;
    object-fit: contain;
    border: 1px solid #444;
    transition: transform 0.2s;
}

.mobo-thumbnail:hover {
    transform: scale(1.1);
    border-color: #0f0;
}

.mobo-components-cell {
    vertical-align: top;
}

.mobo-components-cell[rowspan] {
    background: rgba(0, 255, 0, 0.03);
    border-left: 2px solid #2c792c;
}

.component-line {
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.component-line:last-child {
    margin-bottom: 0;
}

.comp-ref {
    font-weight: bold;
    color: var(--header-text-color);
}

.comp-mult,.comp-desc {
    color: #888;
    font-size: 0.9em;
}

.comp-mult {
    margin-right: 0.5rem;
}

.comp-desc {
    margin-left: 0.5rem;
}

.spec-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.spec-row:last-child {
    margin-bottom: 0;
}

.spec-label {
    font-weight: bold;
    color: #0f0;
    min-width: 50px;
}

.spec-value {
    color: var(--header-text-color);
}

/* Spécifications techniques de l'ordinateur */
.ordi-specs {
    flex-shrink: 0;
    background: var(--body-background);
    border: 1px solid var(--header-text-color);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    min-width: 280px;
}

/* Bloc des liens externes */
.ordi-external-links {
    background: var(--body-background);
    border: 1px solid var(--header-text-color);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    min-width: 250px;
}

.ordi-external-links h3 {
    color: #0f0;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: bold;
}

.ordi-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Chaîne de containers pour hauteur complète */
article.ordi {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.onglets-bloc {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.onglets-contenu {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.onglets-contenu .onglet {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mobo-common {
  flex: 1;
}

.mobo-center-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.mobo-center {
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  max-width: 100%;
}

.sub-onglets-contenu {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sub-onglets-contenu .sub-onglet {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.zone-edition {
  flex: 1;
}

/* Onglets du menu principal */
.onglets-menu {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  gap: 10px;
}

.onglets-menu li {
  padding: 2px 20px;
  background: #32445f;
  color: #d5c289;
  cursor: pointer;
  position: relative;
  border-radius: 10px 10px 0 0;
  height: 20px;
  font-size: larger;
}

.onglets-menu li.actif {
  background: #0073aa;
  color: #efe0d3;
}

.onglets-contenu .onglet {
  display: none;
  border-top: 1px solid #ccc;
}

.onglets-contenu .onglet.actif {
  display: flex;
}



        .button-image {
            background-color: #12172a; /* Couleur de fond */
            cursor: pointer; /* Change le curseur sur le bouton */
            border-radius: 5px; /* Bords arrondis */
        }

        .button-image:hover {
            background-color: #45a049; /* Couleur de fond au survol */
        }

.align-icon {
  margin-left: 6px;
}

.editor-icon {
  height: 38px;
}

.type-list {
  padding-left: 3px;
}

.list-title {
    text-align: center;
    padding-top: 10px;
    font-weight: bold;
    font-size: 1.2em;
    color: var(--link-text-color);
}

.ref-item:hover {
    background-color: rgb(20, 63, 37);
    cursor: pointer;
}

.ref_highlighted {
    background-color: rgb(21, 95, 55);
}

/* Styles pour la liste des IC-IDs */
.ic-list {
    padding: 10px;
}

.ic-item {
    padding: 5px 10px;
    margin: 2px 0;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.ic-item:hover {
    background-color: rgb(20, 63, 37);
    cursor: pointer;
}

/* Cache le div .list-title s'il ne contient pas d'enfant avec la classe .ref-item */
.list-title:has(+ .list-items:empty) {
    display: none;
}

/* Cache le div .type-sub-list si .list-items est vide */
.type-sub-list:has(.list-items:empty) {
    display: none;
}

/* Motherboards */

.sidebar {
  width: 140px;
}

.schema-select {
  left: 10px;
  bottom: 10px;
  position: absolute;
}

.btn-show-schematics {
  padding: 8px 12px;
  background: #32445f;
  color: #d5c289;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-show-schematics:hover {
  background: #0073aa;
  color: #efe0d3;
}

/* Modal dialog for schematics list */
.schematics-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.schematics-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.schematics-modal-content {
  background: var(--body-background);
  border: 2px solid #0073aa;
  border-radius: 8px;
  padding: 20px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.schematics-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #0073aa;
}

.schematics-modal-header h2 {
  margin: 0;
  color: #0f0;
  font-size: 1.3rem;
}

.schematics-modal-close {
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.2s;
}

.schematics-modal-close:hover {
  background: #b71c1c;
}

.schematics-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.schematics-list li {
  padding: 10px;
  margin: 5px 0;
  background: var(--body-background2);
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.schematics-list li:hover {
  background: #0073aa;
  border-color: #0f0;
  transform: translateX(5px);
}

.schematics-list li a {
  color: var(--link-text-color);
  text-decoration: none;
  display: block;
}

.schematics-list li:hover a {
  color: #efe0d3;
}

.schematics-list li.hide-schematics-option {
  background: #8b0000;
  border-color: #ff6b6b;
  font-weight: bold;
}

.schematics-list li.hide-schematics-option:hover {
  background: #a00000;
  border-color: #ff0000;
}

.mobo-common {
  display: flex;
}

/* Onglets du sous-menu */
.sub-onglets-menu {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  gap: 10px;
}

.sub-onglets-menu li {
  padding: 2px 20px;
  background: #32445f;
  cursor: pointer;
  position: relative;
  border-radius: 10px 10px 0 0;
}

.sub-onglets-menu li.actif {
  background: #0073aa;
  color: white;
}

.sub-onglets-contenu .sub-onglet {
  display: none;
 /* padding: 5px; */
  border: 1px solid #ccc;
}

.sub-onglets-contenu .sub-onglet.actif {
  display: flex;
}

#system-msg {
    position: absolute;
    right: 6px;
    top: 0px;
    color: red;
    font-size: 1.4em;
}

/* Edition */

.zone-edition {
  display: flex;
}

.comment-respond {
  display: none;
}

.zone-edition .sidebar {
  padding: 5px;
  padding-left: 2px;
  width: 130px;
}

.zone-edition .schematic-absolute-container {
  display: flex;
  flex: 1;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.zone-edition .schematic-absolute-container img {
  width: 100%;
  height: auto;
  display: block;
}

#mobo-schematic-editor img {
  width: 100%;
  height: auto;
  display: block;
}

.image {
  position: relative;
}

.box-hldr {
  position: absolute;
}

.zoom-image {
  transition: transform 0.1s ease;
  transform-origin: center center;
  display: block;
  position: relative;
}

.zone-edition .highlighted {
  /* blink */
  animation: blink 0.6s infinite !important;
}

.selection-box {
  position: absolute;
  cursor: pointer;
  border: 3px dashed #888;
}

.selection-box.selected {
  animation: blink 0.5s infinite;
}
@keyframes blink {
  0%, 100% {
    border: 4px solid #000;
  }
  80%, 90% {
    border: 4px dashed #ffaa00;
  }
}

.type-sub-list {
  border-bottom: 1px solid;
  padding-bottom: 15px;
}

.type-UNKNOWN {
  border: 2px dashed #ff0000;
  background-color: rgba(255, 0, 0, 0.3);
}

.type-CPU {
  border: 2px solid #ff0000;
  background-color: rgba(255, 0, 0, 0.5);
}

.type-RAM {
  border: 2px solid #00ffff;
  background-color: rgba(0, 255, 255, 0.5);
}

.type-ROM {
  border: 2px solid #00ff00;
  background-color: rgba(0, 255, 0, 0.5);
}

.type-VIDEO {
  border: 2px solid #ff00ff;
  background-color: rgba(255, 0, 255, 0.5);
}

.type-SOUND {
  border: 2px solid #0099ff;
  background-color: rgba(0, 153, 255, 0.5);
}

.type-ASIC {
  border: 2px solid #ffff00;
  background-color: rgba(255, 255, 0, 0.5);
}

.type-MCU {
  border: 2px solid #ff6600;
  background-color: rgba(255, 102, 0, 0.5);
}

.type-IO {
  border: 2px solid #00ff88;
  background-color: rgba(0, 255, 136, 0.5);
}

.type-LOGIC {
  border: 2px solid #ffffff;
  background-color: rgba(255, 255, 255, 0.45);
}

.type-LINEAR {
  border: 2px solid #ff9900;
  background-color: rgba(255, 153, 0, 0.5);
}

.selection-box .circle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  opacity: 70%;
  border: 1px solid black;
  pointer-events: none;
}

.selection-box.nw .circle {
  top: 8px;
  left: 4px;
}

.selection-box.ne .circle {
  top: 8px;
  right: 4px;
}

.selection-box.sw .circle {
  bottom: 8px;
  left: 4px;
}

.selection-box.se .circle {
  bottom: 8px;
  right: 4px;
}

/*
 Zone detail/informations sur la selection
 */

 input#box_id {
  display: none
 }

 .mobo-header {
    background: #2f283b;
 }
 .mobo-common .details {
  width: 275px;
  padding: 5px;
  padding-right: 2px;
  position: relative;
}

.mobo-common .schematic-absolute-container .zoom-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  flex: 1;
  transform-origin: top left;
}

.mobo-common .schematic-absolute-container .zoom-container .image {
  display: block;
  width: 100%;
  height: auto;
}

/* Styles pour les blocs indépendants */
.mobo-common .block-component-info,
.mobo-common .block-schematics,
.mobo-common .block-documentation {
  position: fixed;
  right: 6px;
  width: 247px;
  background: #bdcbe5;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
}

.mobo-common .block-component-info {
  top: 154px;
  z-index: 300;
}

.mobo-common .block-schematics {
  top: 308px;
  z-index: 200;
}

.mobo-common .block-documentation {
  top: 624px;
  z-index: 100;
}

.mobo-common .box-description {
  color: black;
  min-height: 91px;
}

.mobo-common .block-title {
  margin: 0 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 2px solid #333;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Styles spécifiques pour le bloc component-info */
.mobo-common .block-component-info .block-title {
  text-transform: none;
}

.mobo-common .component-ref-title {
  flex: 1;
}

 input#box_mobo_ic_id {
  width: 3em;
  margin-right: 8px;
  margin-left: 2px;
 }

 .component-ref-id {
  font-size: 15px;
  font-weight: bold;
 }

.mobo-common input {
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  padding: 0;
  margin: 0;
  width: 100%;
}

.mobo-common input:focus {
  outline: 1px solid #666;
  background: white;
  padding: 2px;
}

.mobo-common input[readonly] {
  cursor: default;
  color: #333;
  background: transparent;
}

.mobo-common input[readonly]:focus {
  outline: none;
  background: transparent;
  padding: 0;
}

/* État invalide pour le champ IC ID */
.mobo-common input#box_ic_id.invalid {
  outline: 2px solid #d32f2f;
  background: #ffebee;
}

.mobo-common .component-type-badge {
  background: #4a5f7f;
  color: white;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
  white-space: nowrap;
}

.mobo-common .block-component-info .block-content {
  min-height: auto;
}

.mobo-common .block-content {
  min-height: 253px;
  overflow: visible;
}

.mobo-common .block-schematics .block-content {
  position: relative;
  overflow: visible;
}

.mobo-common .box-composant-image {
  width: 220px;
  height: auto;
  max-height: 250px;
  object-fit: contain;
  cursor: pointer;
  display: block;
  border: 1px solid #88a4cb;
  background: white;
}

.mobo-common .box-composant-image:hover {
  position: fixed;
  right: 16px;
  top: 322px;
  width: auto;
  max-width: none;
  max-height: none;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border: 2px solid #333;
}

.mobo-common .details .description {
  height: 50px;
  padding: 3px;
  margin: 3px;
  border: 1px solid lightgray;
  font-family: sans-serif;
  font-weight: bold;
}

.mobo-common .details .suggestions {
  position: fixed;
  right: 20px;
  top: 100%;
  min-width: 200px;
  background: white;
  border: 1px solid #ccc;
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobo-common .details .suggestions div {
  padding: 5px;
  cursor: pointer;
}
.mobo-common .details .suggestions div.hovered {
  background-color: #eee;
  color: #111;
}

/* Icônes dans les suggestions */
.mobo-common .details .suggestions .suggestion-icon {
  display: inline-block;
  width: 20px;
  text-align: center;
  margin-right: 5px;
  font-size: 14px;
}

.mobo-common .details .suggestions .suggestion-doc-icon {
  display: inline-block;
  width: 16px;
  text-align: center;
  margin-right: 8px;
  font-size: 10px;
}

/* Styles pour le bloc Documentation */

/* Ligne Source */
.mobo-common .box-source-container {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.mobo-common .source-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.mobo-common .source-label {
  font-weight: bold;
  color: #555;
}

.mobo-common .source-text {
  flex: 1;
  color: #333;
  line-height: 1.4;
}

.mobo-common .catalog-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background-color: #757575;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
}

.mobo-common .catalog-download-button:hover {
  background-color: #616161;
  transform: scale(1.1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mobo-common .catalog-download-button svg {
  fill: white;
}

.mobo-common .box-composant-pdf-container {
  text-align: center;
}

.mobo-common .pdf-preview-link {
  display: block;
  margin-bottom: 10px;
}

.mobo-common .box-composant-pdf-thumb {
  max-width: 100%;
  height: auto;
  max-height: 200px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.mobo-common .box-composant-pdf-thumb:hover {
  transform: scale(1.02);
  border-color: #999;
}

/* Container des boutons PDF */
.mobo-common .pdf-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

/* Styles communs pour les boutons PDF */
.mobo-common .pdf-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
}

/* Bouton Ouvrir (bleu) */
.mobo-common .pdf-open-button {
  background-color: #1976d2;
}

.mobo-common .pdf-open-button:hover {
  background-color: #1565c0;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Bouton Télécharger (rouge) */
.mobo-common .pdf-download-button {
  background-color: #d32f2f;
}

.mobo-common .pdf-download-button:hover {
  background-color: #b71c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mobo-common .pdf-icon {
  flex-shrink: 0;
}

/* ============================================================================
   Onglets locaux du menu gauche (dual-left-menu)
   ============================================================================ */

.dual-left-menu .left-menu-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  padding: 0 2px;
  background: transparent;
}

.dual-left-menu .left-menu-tab {
  flex: 1;
  padding: 5px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: #888;
  background: #1a3d1a;
  border: none;
  border-radius: 8px 8px 0 0;
  transition: all 0.15s ease;
  user-select: none;
  position: relative;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,0.05);
  /* Décalage vertical des tabs */
  top: 5px;
  height: 12px;
}

.dual-left-menu .left-menu-tab:hover {
  background: #2d5a2d;
  color: #c7c7b9;
  /* Décalage vertical des tabs */
  top: 3px;
  height: 14px;
}

.dual-left-menu .left-menu-tab.active {
  color: #000;
  background: #4a9b4a;
  font-size: 13px;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    0 -1px 3px rgba(0,0,0,0.08);
  z-index: 1;
  /* Décalage vertical des tabs */
  top: 0px;
  height: 16px;
}

.dual-left-menu .left-menu-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.dual-left-menu .left-menu-panel {
  display: none;
}

.dual-left-menu .left-menu-panel.active {
  display: block;
}

/* ================================================================
   Schematic Editor Minimaliste (en bas des onglets Motherboard)
   ================================================================ */

.mobo-schematic-editor {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  z-index: 100;
  background: #fff;
  border-top: 2px solid #0073aa;
}

.mobo-schematic-editor .zoom-container {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: top left;
}

.schematic-editor-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #ccc;
  flex-shrink: 0;
}

.schematic-editor-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.schematic-selector {
  padding: 0.3rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  min-width: 150px;
}

.schematic-editor-content {
  flex: 1;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  min-height: 0;
}

.schematic-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.schematic-placeholder {
  color: #999;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.schematic-viewer-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

