:root{
    --lightblue: #0a88c5;
    --lightgray: #6f6f6f;
    --lightgray2: #eee;
    --darkgray: #6e6f71;
    --background: #fff;
    --darkBackground: #1b2735;
    --background2: radial-gradient(ellipse at bottom, #3c5677,  #1d2030);
    --background3: rgba(255,255,255,0.1);
    /* FONCE #090a0f #1b2735 #1d2030 #2b3e55 #3c5677 CLAIR */

    --form-control-disabled: #555;

    --pixel-000: #1d2030;
    --pixel-001: #3489eb;
    --pixel-010: #34eb7d;
    --pixel-011: #34ebe5;
    --pixel-100: #eb4034;
    --pixel-101: #eb34c0;
    --pixel-110: #ebd534;
    --pixel-111: #ffffff;
}

* {
    margin: 0px;
    padding: 0px;
    
    transition: all 0.2s;
}

html {
    overflow: hidden;
	color: white;
    overflow-x: hidden;
    font-family: Myriad Pro, Calibri, Roboto, Arial;
    background: var(--background2);
}

#page {
    height: 100vh;
    width: 100vw;

    overflow: hidden;

    display: flex;
    justify-content: space-around;
    align-items: center;

    animation: OpacityTransitionUp 6s;
}

#rightPage {
    height: 95%;
    width: 25%;

    display: flex;
    justify-content: space-around;
    flex-direction: column;
}

#leftPage {
    height: 95%;
    width: 70%;

    display: flex;
    justify-content: space-around;
    flex-direction: column;
}

.ul {
    overflow-y: auto;

    height: 85%;
    width: 100%;

    border: 1px solid var(--background3);
    border-radius: 10px;
    
    background-color: var(--background3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    position: relative;

    display: flex;
    justify-content: space-around;
    align-items: center;
}

.ul section {
    display: none;
} .ul section.active {
    display: flex;
    justify-content: space-around;
    align-items: center;

    width: 95%;
    height: 95%;

    position: relative;
}

::-webkit-scrollbar {
  width: 5px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #1d2030;
  border-radius: 5px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 0 10px 10px 0;
}

.dl {
    height: 10%;
    width: 100%;

    border: 1px solid var(--background3);
    border-radius: 10px;
    
    background-color: var(--background3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    position: relative;

    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

.dl div {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.ur {
    height: 85%;
    width: 100%;

    border: 1px solid var(--background3);
    border-radius: 10px;
    
    background-color: var(--background3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    position: relative;

    display: flex;
    justify-content: space-around;
    align-items: center;
}

.dr {
    height: 10%;
    width: 100%;

    border: 1px solid var(--background3);
    border-radius: 10px;

    background-color: var(--background3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    position: relative;

    display: flex;
    justify-content: space-around;
    align-items: center;
}

.ur {
    overflow-y: auto;
}

.ur section {
    display: none;
    width: 90%;
    height: 90%;
} .ur section.active {
    display: block;
}

.ur section h1 {
    margin-bottom: 10px;
    padding: 10px;
    text-align: center;
    font-size: 2rem;
}

.ur section h2 {
    margin-bottom: 10px;
    padding: 10px;
    text-align: left;
}

.ur section > div {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.ur section div label {
    font-weight: bolder;
    width: 79%;
}

.ur section div input {
    padding: 5px;
    margin-bottom: 5px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid white;
    border-radius: 10px;
    width: 20%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
} .ur section div input:focus {
    box-shadow: 0 4px 30px rgba(255, 255, 255, 0.3);
}

.blankSpace {
    height: 25px;
}

/* ************************************************ */ 

#networkDiv {
    display: flex;
    justify-content: space-around;
    align-items: center;

    width: 95%;
    height: 95%;

    position: relative;
}

.column {
    display: flex;
    justify-content: space-around;
    flex-direction: column;
    
    width: 5%;
    height: 90%;
}

.neuron {
    display: flex;
    justify-content: space-around;
    align-items: center;

    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
 
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid white;
    border-radius: 100%;

    width: 40px;
    aspect-ratio: 1/1;

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}.neuron:hover {
    cursor: pointer;
    box-shadow: 0 4px 30px rgba(255,255,255, 0.3);
}.neuron.active {
    box-shadow: 0 4px 30px rgba(255,255,255, 0.6);
    background-color: rgba(255, 255, 255, 0.9);
}.neuron.selected {
    background-color: rgba(60,86,119, 0.8)
}

.neuron p {
    color: #1d2030;
    font-weight: bolder;
    font-size: 0.7rem;
}

#neuronVisualDiv {
    display: none;
}

#neuronVisualDiv div {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

#neuronVisualDiv div label {
    font-weight: bolder;
    width: 59%;
}

#neuronVisualDiv div p {
    padding: 5px;
    margin-bottom: 5px;
    width: 40%;
    text-align: right;
}

#neuronCurve {
    padding-bottom: 25px;
}

#neuronCurve svg rect {
    background-color: #1d2030;
    border-radius: 5px;
}

.connection {
    position: absolute;
    background-color: rgba(255,255,255, 1);
    height: 2px;
    transform-origin: 0 0;
    z-index: -1;
}

/* ************************************************ */ 

#cmdInput {
    padding: 7px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid white;
    border-radius: 10px;
    width: 70%;
    margin: 0 5%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    font-weight: bolder;
} #cmdInput:focus {
    box-shadow: 0 4px 30px rgba(255,255,255, 0.3);
}

#cmdSendBtn {
    padding: 7px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid white;
    border-radius: 10px;
    min-width: 100px;
    margin: 0 5%;
    width: 10%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
} #cmdSendBtn:hover {
    cursor: pointer;
    box-shadow: 0 4px 30px rgba(255,255,255, 0.3);
}

#cmdBtn {
    width: 90%;
    margin: 0 auto;
    justify-content: left;
    gap: 20px;
}

#cmdBtn button {
    padding: 2px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid white;
    border-radius: 5px;
    font-size: 0.5rem;   
    font-weight: bolder;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
} #cmdBtn button:hover {
    cursor: pointer;
    box-shadow: 0 4px 30px rgba(255,255,255, 0.3);
}

#networkInfo {
    align-items: flex-end;
    position: absolute;
    bottom: 5px;
    right: 10px;
    display: flex;
    flex-direction: column;
}

#runningInfo {
    font-weight: bolder;
    font-size: 0.7rem;
    margin: 0; /* Supprime les marges par défaut */
}

#simulationInfo {
    font-weight: bolder;
    font-size: 0.7rem;
    color: #1d2030;
    margin: 0; /* Supprime les marges par défaut */
}

.dr button {
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid white;
    border-radius: 10px;
    box-shadow: 0 4px 30px rgba(0,0,0, 0.3);
} .dr button:hover {
    padding: 17px;
    cursor: pointer;
    box-shadow: 0 4px 30px rgba(255,255,255, 0.3);
}

#patternVisualDiv {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 10px;
    background-color: #0f121a;
    width: 50%;
    aspect-ratio: 1/1;
    border-radius: 5px;
    margin: auto; 
}

.pattern-pixel {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    box-sizing: border-box;
    transition: background-color 0.2s;
}

#imageVisualDiv .pattern-pixel {
    width: 50px;
    height: 50px;
}

#imageVisualDiv .pattern-pixel:hover {
    opacity: 0.5;
    cursor: pointer;
}

.pixel-000, .memory-pixel-000 { background-color: var(--pixel-000); }
.pixel-001, .memory-pixel-001 { background-color: var(--pixel-001); }
.pixel-010, .memory-pixel-010 { background-color: var(--pixel-010); }
.pixel-011, .memory-pixel-011 { background-color: var(--pixel-011); }
.pixel-100, .memory-pixel-100 { background-color: var(--pixel-100); }
.pixel-101, .memory-pixel-101 { background-color: var(--pixel-101); }
.pixel-110, .memory-pixel-110 { background-color: var(--pixel-110); }
.pixel-111, .memory-pixel-111 { background-color: var(--pixel-111); }

.pattern-line-break {
    clear: both;
}

.pattern-pixel-0 {
    background-color: #1d2030;
}

.pattern-pixel-1 {
    background-color: white;
}

.pattern-line-break {
    flex-basis: 100%;
    height: 0;
}

/* ************************************************ */ 

#memoryContainer {
    width: 95%;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

#memoryContainer > div {
    display: block;
}

.mainMemoryInfo > div {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.memoryBlock {
    width: 100%;
    padding: 5px;
    color: #1d2030;

    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid white;
    border-radius: 5px;
    box-shadow: 0 4px 30px rgba(0,0,0, 0.3);
}

.memoryBlock > div:last-child {
    padding: 5px 0;
    margin-top: 10px;
    font-weight: bold;
    font-size: 0.7rem;
}

.mainMemoryInfo {
    display: flex;
    justify-content: space-around; 
    align-items: stretch;
    gap: 0.5rem;
}

.mainMemoryInfo .dayMemoryDiv {
    flex-grow: 1;
}

.mainMemoryInfo .patternMemoryDiv {
    aspect-ratio: 1;
    display: flex;
    max-width: 75px;
    width: 20%;
    justify-content: space-around;
    flex-wrap: wrap;
    background-color: #0f121a;
    aspect-ratio: 1/1;
    border-radius: 5px;
    margin: auto; 
}

.mainMemoryInfo .graphMemoryDiv {
    flex-grow: 8;
    border-radius: 5px;
    border: 1px dashed #1d2030;

}

.memory-pixel {
    width: 5px;
    height: 5px;
    border-radius: 2px;
}

.memory-pixel-0 {
    background-color: #1d2030;
}

.memory-pixel-1 {
    background-color: white;
}

.memory-line-break {
    flex-basis: 100%;
    height: 0;
}

/* ************************************************ */ 

#patternPicturePreview {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  margin-top: 10px;
}

.pattern-preview-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  aspect-ratio:  1/1;
}

.pattern-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* ajusté dynamiquement par JS si besoin */
  gap: 1px;
  width: 100px;
  height: 100px;
  align-items: center;
}

.pattern-preview-grid .preview-cell {
  width: 100%;
  aspect-ratio: 1; /* carré */
  background-color: #000;
}

.pattern-preview-grid .preview-cell.active {
  background-color: #fff;
}

#imageVisualContainer {
    position: relative;
}

#visionFrame {
    position: absolute;
    border: 2px solid white;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 10;
}

.pattern-pixel.in-vision {
    border: 1px solid white;
    box-sizing: border-box;
}

#imageVisualDiv {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    padding: 10px;
    background-color: #0f121a;
    width: 90%;
    aspect-ratio: 1/1;
    border-radius: 5px;
    margin: auto; 
}

#imageColorInputDiv, #useGeneticInputDiv {
    margin: 0;
    font: inherit;
    border-radius: 0.15em;
    transform: translateY(-0.075em);
}

#imageColorInputDiv input, #useGeneticInputDiv input {
    width: 1.15em;
    margin: auto;
}

input[type="checkbox"] {
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 0.15em solid currentColor;
    border-radius: 0.15em;
    transform: translateY(-0.075em);
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    aspect-ratio: 1/1;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em #1d2030;
    background-color: CanvasText;
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.ur section div input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.ur section div input[type="checkbox"]:focus {
    outline: max(2px, 0.15em) solid currentColor;
    outline-offset: max(2px, 0.15em);
}

.form-control--disabled {
    color: var(--form-control-disabled);
    opacity: 0.5;
    cursor: not-allowed;
}

#patternPicturePreview {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

#patternPicturePreview > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#patternPicturePreview label {
  margin-bottom: 8px;
  color: white;
  font-size: 14px;
}

.preview-pattern {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background-color: #0f121a;
  border-radius: 5px;
  aspect-ratio: 1 / 1;
  width: 120px;
}

.previewPattern {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    padding: 10px;
    background-color: #0f121a;
    width: 90%;
    aspect-ratio: 1/1;
    border-radius: 5px;
    margin: auto; 
}

.pattern-preview-block p {
    font-weight: bolder;
    font-size: 0.7rem;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

/* ************************************************ */ 

#pictureSimMenu {
    position: absolute;
    bottom: 0;
    
    transform: translateY(95%);

    width: 100%;
    
    display: flex;
    justify-content: center;
}

#pictureSimMenu button {
    padding: 3px 15px;
    margin: 0 3px;
    background-color: #0f121a;
    border: none;
    color: white;
    font-weight: bolder;
    font-size: 0.5rem;
    border-radius: 0 0 15px 15px;
} #pictureSimMenu button:hover {
    padding: 3px 20px;
    cursor: pointer;
}

#populationDiv {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    background-color: #1d2030;
    border-radius: 5px;
}

.individual-box {
    padding: 8px;
    border-radius: 3px;
    border: 1px solid #444;
    font-family: monospace;
    font-size: 12px;
    color: #000;
    transition: all 0.3s ease;
    min-width: 10px;
    font-size: 0.5rem;
    aspect-ratio:  1/1;
    text-align: center;
    position: relative;
}

.individual-box:hover {
    box-shadow: 0 0px 15px rgba(255, 255, 255, 0.7);
    cursor: pointer;
}

.individual-box:hover::after {
    content: attr(data-score);
    position: absolute;
    top: -15px;
    left: -100%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

/* ************************************************ */ 

#startOverlay {
    display: none;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-around;

    z-index: 999999;

    animation: StartLogo 3s forwards;
}

#startOverlay img {
    width: 30vw;
}

.label-tooltip {
    display: none;
}

/* ************************************************ */ 

@keyframes StartLogo {
    0% {
        opacity: 0;
        visibility: hidden;
    }
    1% {
        opacity: 0;
        visibility: visible;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    99% {
        opacity: 0;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes OpacityTransitionUp {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0;
        transform: translateY(5%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}