* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #0d0d0d;
  color: white;
  overflow-x: hidden;
}

/* ===== PARTICLES ===== */
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: -1;
}

/* ===== MAIN CONTAINER ===== */
.app-container {
  padding: 20px 40px;
}

/* ===== HEADER ===== */
header {
  text-align: center;
  margin-bottom: 15px; /* reduced */
}

header h1 {
  color: #00ff88;
  font-size: 28px;
  margin: 0;
}

/* ===== CONTROLS ===== */
.controls {
  margin-bottom: 15px; /* reduced */
}

.top-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

button, input, select {
  padding: 7px 10px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
}

button {
  background: #00ff88;
  font-weight: bold;
  cursor: pointer;
  min-width: 85px;
  transition: 0.2s ease;
}

button:hover {
  background: #00cc6a;
}

input, select {
  background: #1a1a1a;
  color: white;
}

/* ===== MIDDLE SECTION (Compact) ===== */
.middle-section {
  display: flex;
  gap: 20px;
  margin-bottom: 15px; /* reduced */
}

/* Runtime smaller */
.runtime-summary {
  flex: 0.8;  /* reduced width */
  background: rgba(20,20,20,0.85);
  padding: 15px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}

/* Code panel slightly smaller */
.code-panel {
  flex: 1.2;
  background: rgba(20,20,20,0.9);
  padding: 15px;
  border-radius: 10px;
  max-height: 220px;  /* reduced height */
  overflow-y: auto;
}

.code-header {
  margin-bottom: 8px;
}

pre {
  background: #111;
  padding: 10px;
  border-radius: 6px;
  color: #00ff88;
  white-space: pre-wrap;
  font-size: 13px;
  margin: 0;
}

/* ===== ARRAY VISUALIZATION (MORE IMPORTANT) ===== */
.visual-area {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  padding: 30px 20px;
  background: rgba(15,15,15,0.9);
  border-radius: 12px;
  min-height: 220px; /* increased */
}

/* Bigger array boxes */
.bar {
  width: 60px;
  background: #00ff88;
  color: black;
  font-weight: bold;
  text-align: center;
  padding: 22px 0;
  border-radius: 10px;
  font-size: 16px;
  transition: 0.3s ease;
}

/* ===== STATES ===== */
.highlight { background: yellow !important; }
.low { background: blue !important; }
.high { background: red !important; }
.found { background: lime !important; }

/* ===== SPEED LABEL ===== */
#speedLabel {
  color: #00ff88;
  font-weight: bold;
}
