/* Resetar as configurações padrões da página */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
    color: #333;
    text-align: center;
}

h1 {
    margin-bottom: 20px;
}

/* Container principal */
.container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Painéis de entrada e configurações */
.process-list,
.config,
.controls {
    flex: 1;
    border: 1px solid #ccc;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: left;
}

h3 {
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
    color: #007bff;
}

label {
    display: block;
}

input,
select,
button {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background-color: #0056b3;
}

/* Botão para o controle de velocidade */
#speedRange {
    width: 100%;
}

/* Tabela de processos */
#processTable {
    max-width: 1200px;
    margin: 20px auto;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

#processTable table {
    width: 100%;
    border-collapse: collapse;
}

#processTable th,
#processTable td {
    border: 1px solid #ddd;
    padding: 2px;
    text-align: center;
    font-size: 12px;
}

#processTable th {
    background-color: #007bff;
    color: white;
    font-size: 15px;
}

/* Estilização do Gráfico de Gantt */
.gantt-container {
    display: flex;
    flex-direction: column;
    gap: 3px;

    margin: 20px auto;
    width: 100%;
    max-width: 1200px;
    border: 1px solid #ccc;
    padding: 15px;
    min-height: 120px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow-x: auto;
    white-space: nowrap;
}

.gantt-row {
    display: flex;
    align-items: center;
    width: fit-content;
}

.gantt-label {
    min-width: 50px;
    text-align: right;
    font-weight: bold;
    margin-right: 5px;
    flex-shrink: 0;
}

.gantt-blocks-container {
    display: flex;
    gap: 4px;

    /* overflow-x: auto; */
    /* white-space: nowrap; */
    /* padding-bottom: 5px; */
}

.gantt-block {
    height: 25px;
    width: 25px;
    border: 1px solid #999;
    border-radius: 5px;
    font-size: 12px;
    margin-bottom: 5px;
}

/* Cores para os estados */
.execution {
    background-color: #28a745;
}
.waiting {
    background-color: #ffc107;
}
.overhead {
    background-color: #dc3545;
}
.no-arrived {
    border: none;
    background-color: #ccc;
}
.page-fault {
    background-color: #964b00;
}
.deadline-exceeded {
    /* background-color: #000000; */
    outline: 1px solid #dc3545;
}

/* turnaround*/

.turnaround {
    display: flex;
    justify-content: center;
}
#averageTurnaround {
    align-items: center;
    background-color: hsl(0, 0%, 100%);
    border: 1px solid #999;
    border-radius: 5px;
    width: 30%;
}

/* legenda */

/* Container de legenda */
#legenda {
    display: flex;
    flex-direction: column;
    gap: 5px;

    margin-top: 15px;
}

/* Cada item da legenda: bloco + label alinhados em linha */
.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-item div {
    margin-bottom: 0;
}

.lgd-btn {
    display: flex;
    justify-content: flex-start;
    margin-left: 50px;
    padding-bottom: 20px;
}

#legenda_btn {
    align-items: center;
    border: 1px solid #999;
    border-radius: 5px;
    font-size: 10px;
    width: 5%;
}

.legenda {
    display: block;
    margin-left: 50px;
}

.gantt-time-labels {
    display: flex;
    margin-top: 10px;
    padding-left: 50px; /* Mesmo padding dos labels dos processos */
    width: fit-content;
}

.time-label {
    width: 25px; /* Largura igual aos blocos do Gantt */
    text-align: center;
    font-size: 0.8em;
}
