body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: #0f172a; 
  color: white;
}

.header {
  display: flex;
  align-items: center;
  padding: 20px;
  background-color: #1e293b;
  border-bottom: 2px solid #334155;
}

.profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-right: 20px;
}

.intro h1 {
  margin: 0;
  font-size: 28px;
}

.intro p {
  margin: 4px 0;
  font-size: 16px;
}

.main-container {
  display: flex;
  flex-direction: row;
  padding: 20px;
  gap: 20px;
}

.controls-section {
  width: 300px;
  background-color: #1e293b;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
}

.controls-section h2 {
  margin-top: 0;
  color: #93c5fd;
}

select, button {
  width: 100%;
  margin: 10px 0;
  padding: 10px;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  background-color: #3b82f6;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

select:focus, button:focus {
  outline: none;
}

button:hover {
  background-color: #2563eb;
}

.info-box, .explanation-box {
  margin-top: 20px;
  padding: 15px;
  background-color: #334155;
  border-radius: 10px;
  font-size: 14px;
}

.visualizer-section {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  background-color: #0f172a;
  border-radius: 12px;
}

#bar-container {
  display: flex;
  align-items: flex-end;     
  justify-content: center;   
  height: 300px;
  width: 100%;
  margin: auto;
  padding: 10px 0;
  gap: 2px;
}
.visualizer-section {
  flex-direction: column;
  justify-content: center;
}

.bar {
  width: 10px;
  background: linear-gradient(to top, #00bfff, #00ffff);
  margin: 1px;
  border-radius: 4px;
  transition: height 0.3s ease, background-color 0.3s ease;
  box-shadow: 0 0 5px #00e0ff;
}

.comparing {
  background: linear-gradient(to top, #f39c12, #f1c40f);
  box-shadow: 0 0 10px #f1c40f;
}

.sorted {
  background: linear-gradient(to top, #2ecc71, #a3f7bf);
  box-shadow: 0 0 10px #2ecc71;
}

.pivot {
  background: linear-gradient(to top, #e74c3c, #ff9aa2);
  box-shadow: 0 0 10px #e74c3c;
}

.legend {
  margin-top: 20px;
  display: flex;
  gap: 20px;
  font-size: 14px;
  align-items: center;
  justify-content: center;
}

.legend-bar {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 4px;
}

@media screen and (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  .controls-section {
    width: 100%;
  }

  #bar-container {
    height: 300px;
  }
}
