
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f5f7fa;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background-color: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 30px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.visualization {
  position: relative;
  height: 600px;
  border: 2px solid #e1e5eb;
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  background-color: #f9fafc;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.component {
  position: absolute;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  z-index: 2;
  text-align: center;
  font-weight: 600;
}

.component h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.component p {
  margin: 0;
  font-size: 12px;
  opacity: 0.8;
}

.keyboard {
  width: 180px;
  height: 70px;
  left: 40px;
  top: 40px;
  background-color: #e6f2ff;
  border: 2px solid #4b8bf4;
}

.key {
  position: absolute;
  width: 30px;
  height: 30px;
  background-color: #d4e6ff;
  border-radius: 5px;
  left: 75px;
  top: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 0 #aed1ff;
  cursor: pointer;
  z-index: 3;
  font-weight: bold;
  color: #2c3e50;
}

.key:active, .key.pressed {
  transform: translateY(2px);
  box-shadow: none;
}

.circuit {
  width: 140px;
  height: 50px;
  left: 60px;
  top: 160px;
  background-color: #e1f5fe;
  border: 2px solid #29b6f6;
}

.interrupt-controller {
  width: 180px;
  height: 80px;
  left: 320px;
  top: 130px;
  background-color: #e3f2fd;
  border: 2px solid #2196f3;
}

.memory {
  width: 160px;
  height: 120px;
  left: 90px;
  top: 350px;
  background-color: #f3e5f5;
  border: 2px solid #9c27b0;
}

.cpu {
  width: 220px;
  height: 140px;
  left: 600px;
  top: 110px;
  background-color: #e8f5e9;
  border: 2px solid #4caf50;
}

.process {
  width: 160px;
  height: 75px;
  left: 630px;
  top: 450px;
  background-color: #fff8e1;
  border: 2px solid #ffc107;
}

.isr {
  width: 160px;
  height: 75px;
  left: 370px;
  top: 450px;
  background-color: #ede7f6;
  border: 2px solid #673ab7;
}

.os {
  width: 200px;
  height: 100px;
  left: 490px;
  top: 290px;
  background-color: #ffebee;
  border: 2px solid #f44336;
}

.vector-table {
  width: 150px;
  height: 90px;
  left: 95px;
  top: 370px;
  background-color: #fff3e0;
  border: 2px solid #ff9800;
}

.process-stack {
  position: absolute;
  width: 100px;
  height: 50px;
  left: 510px;
  top: 370px;
  background-color: #ffecb3;
  border: 2px dashed #ffc107;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  z-index: 1;
  opacity: 0.9;
  color: #5d4037;
}

.path {
  position: absolute;
  background-color: #e0e0e0;
  z-index: 1;
}

.signal {
  position: absolute;
  width: 15px;
  height: 15px;
  background-color: #ff5252;
  border-radius: 50%;
  z-index: 3;
  display: none;
  box-shadow: 0 0 10px #ff5252;
}

.data-packet {
  position: absolute;
  width: 20px;
  height: 12px;
  background-color: #29b6f6;
  border-radius: 3px;
  z-index: 3;
  display: none;
  font-size: 9px;
  color: #fff;
  text-align: center;
  font-weight: bold;
  line-height: 12px;
}

.controls {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.button {
  padding: 12px 25px;
  background-color: #2196f3;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin: 0 10px;
  font-weight: bold;
  transition: all 0.2s ease;
  box-shadow: 0 4px 0 #1976d2;
}

.button:hover {
  background-color: #42a5f5;
}

.button:active {
  transform: translateY(4px);
  box-shadow: none;
}

.step-info {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #f5f5f5;
  text-align: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  color: #424242;
}

.status-bar {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #f5f5f5;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #e0e0e0;
  color: #424242;
}

.register-display {
  position: absolute;
  width: 180px;
  height: 60px;
  left: 620px;
  top: 140px;
  background-color: #e8f5e9;
  border-radius: 5px;
  padding: 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.register-row {
  display: flex;
  justify-content: space-between;
}

.register {
  background-color: #c8e6c9;
  border-radius: 3px;
  padding: 2px 4px;
  color: #2e7d32;
}

.interrupt-flag {
  color: #c62828;
  font-weight: bold;
}

.legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 8px;
  font-size: 12px;
  color: #424242;
}

.legend-item {
  display: flex;
  align-items: center;
}

.legend-color {
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border-radius: 3px;
  display: inline-block;
}

.pulse {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
  100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.code-snippet {
  position: absolute;
  width: 150px;
  height: 60px;
  left: 375px;
  top: 455px;
  background-color: #f5f5f5;
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.5s ease;
  padding: 5px;
  font-size: 9px;
  font-family: monospace;
  white-space: pre;
  color: #0d47a1;
  overflow: hidden;
  z-index: 4;
  border: 1px solid #e0e0e0;
}

.vector-entry {
  position: absolute;
  width: 120px;
  height: 40px;
  left: 110px;
  top: 395px;
  background-color: #fff3e0;
  border-radius: 5px;
  padding: 5px;
  font-size: 10px;
  font-family: monospace;
  white-space: pre;
  color: #e65100;
  text-align: left;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 4;
  border: 1px solid #ffe0b2;
}

.progress-bar-container {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 10px;
  background-color: #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #bdbdbd;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background-color: #2196f3;
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* Connections */
.connection {
  position: absolute;
  height: 2px;
  background-color: #bdbdbd;
  z-index: 1;
  opacity: 0.8;
}

.cpu-details {
  position: absolute;
  left: 610px;
  top: 210px;
  font-size: 12px;
  color: #388e3c;
  opacity: 0.8;
}
