/* Estilos gerais (sem alteração) */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  color: #333;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
}
.container {
  max-width: 1800px; margin: 0 auto; background-color: #fff; padding: 20px;
  border-radius: 8px; box-shadow: 0 0 15px rgba(0,0,0,0.1);
}
h1, h2 { text-align: center; color: #0056b3; }
.controls {
  display: flex; justify-content: center; align-items: center; gap: 20px;
  margin-bottom: 25px; padding: 15px; background-color: #e9ecef;
  border-radius: 8px; flex-wrap: wrap;
}
.control-group { display: flex; flex-direction: column; }
.control-group label { font-weight: bold; margin-bottom: 5px; font-size: 0.9em; }
select, button { padding: 10px; border-radius: 5px; border: 1px solid #ccc; font-size: 1em; }
button {
  cursor: pointer; background-color: #007bff; color: white;
  border: none; transition: background-color 0.3s ease;
}
button:hover { background-color: #0056b3; }
#prepare-simulation { background-color: #6c757d; }
#prepare-simulation:hover { background-color: #5a6268; }
#next-step:disabled { background-color: #ccc; cursor: not-allowed; }
.simulation-area { display: flex; gap: 15px; justify-content: space-around; margin-bottom: 20px; }
.memory-column {
  flex: 1; background-color: #f8f9fa; border: 1px solid #dee2e6;
  border-radius: 5px; padding: 10px; min-width: 200px;
}
.cpu-program-column { display: flex; flex-direction: column; gap: 15px; flex: 1; }
.program-grid, .cache-grid {
  font-family: 'Courier New', Courier, monospace; font-size: 0.85em;
  background-color: #e9ecef; padding: 10px; border-radius: 4px;
  height: 480px; overflow-y: auto;
}
.program-grid { height: 280px; }
.program-line.active { background-color: #ffc107; font-weight: bold; }

/* Novos estilos e ajustes para CPU */
.cpu-display {
  display: grid;
  grid-template-columns: 40px 1fr;
    column-gap: 48px;
    row-gap: 6px;
  padding: 5px;
  align-items: center;
}
.cpu-reg span:first-child {
  font-weight: bold;
  color: #0056b3;
  text-align: right;
  padding-right: 5px;
}
.cpu-reg span:last-child {
  font-family: 'Courier New', Courier, monospace;
  background-color: #fff;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid #ddd;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cpu-divider {
  grid-column: 1 / -1;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 5px 0;
}

/* Estilos de Cache e RAM (sem alteração) */
.cache-grid { display: flex; flex-direction: column; gap: 2px; }
.cache-line, .cache-set-label {
  padding: 2px 4px; border-radius: 3px; background-color: #fff; white-space: pre;
}
.cache-line.updated-1 { background-color: #90ee90; }
.cache-line.updated-2 { background-color: #b7e7b7; }
.cache-line.updated-3 { background-color: #d7f7d7; }
.ram-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
  font-family: 'Courier New', Courier, monospace; font-size: 0.9em;
  height: 480px; overflow-y: auto; background-color: #e9ecef; padding: 5px;
}
.ram-cell {
  padding: 2px 4px; border-radius: 3px; background-color: #fff; border: 1px solid #ccc;
}
.ram-cell.highlight { background-color: #fff3cd; font-weight: bold; }

/* Estilos de Log (sem alteração) */
.log-area { margin-top: 20px; }
#log-console {
  background-color: #343a40; color: #f8f9fa; padding: 15px; border-radius: 5px;
  height: 250px; overflow-y: auto; font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}
.log-hit { color: #28a745; }
.log-miss { color: #dc3545; }
.log-ram { color: #ffc107; }
.log-info { color: #17a2b8; }
.log-op { color: #ffffff; font-weight: bold;}