* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background: #2C3E50;
  color: #ecf0f1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.visualizer-container {
  text-align: center;
  width: 100%;
  max-width: 1000px;
  padding: 20px;
}

.title {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #e74c3c;
  text-shadow: 2px 2px #34495e;
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

.btn,
.dropdown {
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
  color: white;
}

.btn {
  background: #1abc9c;
}

.btn:hover {
  background: #16a085;
}

.dropdown {
  background: #34495e;
}

.array-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 400px;
  width: 100%;
  overflow: hidden;
  padding: 0 10px;
  background: none;
}

.bar {
  flex: 1 1 auto;
  min-width: 2px;
  margin: 0 1px;
  background: #3498db;
  border-radius: 4px;
  transition: height 0.2s ease;
  /* height is set dynamically in JS as percentage */
}

.bar.active {
  background-color: #e74c3c;
}

/* Medium Devices (Tablets) */
@media screen and (max-width: 768px) {
  .title {
    font-size: 2rem;
  }
  .btn,
  .dropdown {
    font-size: 14px;
    padding: 8px 14px;
  }
  .controls {
    gap: 10px;
    flex-wrap: wrap;
  }
  .array-container {
    height: 320px;
    padding: 0 5px;
  }
}

/* Small Devices (Phones) */
@media screen and (max-width: 480px) {
  .title {
    font-size: 1.6rem;
  }
  .btn,
  .dropdown {
    font-size: 13px;
    padding: 8px 10px;
    width: 100%;
  }
  .controls {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .array-container {
    height: 200px;
    padding: 0 2px;
  }
}
