:root {
  --bg-main: #0f172a;
  --bg-panel: #1e293b;
  --color-text: #f8fafc;
  --color-highlight: #38bdf8;
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-sorted: #22c55e;
  --color-processing: #facc15;
  --color-swapping: #ef4444;
}

/* Global Page Styling */
body {
  background: var(--bg-main);
  color: var(--color-text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  padding-bottom: 280px; 
  position: relative;
}

/* Title */
.visualizer-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-highlight);
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

/* Array Container */
#array {
  height: 450px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--bg-panel);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

/* Individual Bars */
.bar {
  background-color: var(--color-primary);
  margin: 0 1px;
  border-radius: 3px 3px 0 0;
}

/* Control Section (Fixed to Bottom) */
.controls-section {
  background: var(--bg-panel);
  border-top: 1px solid #334155;
  padding: 1.5rem 1rem 0.5rem 1rem;
  border-radius: 16px 16px 0 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
  max-height: 300px;
  overflow-y: auto;
}

/* Labels & Inputs */
.labels {
  font-size: 1rem;
  font-weight: 600;
  color: #cbd5e1;
  margin: 0 10px;
  text-transform: uppercase;
}

.labels {
    .value-badge {
  display: inline-block;
  background: #2563eb;
  color: white;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-left: 8px;
  min-width: 30px;
  text-align: center;
  transition: background 0.3s ease;
}

.value-badge:hover {
  background: #1e40af;
}

}

.sliders-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

input[type="range"] {
  width: 120px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Buttons */
.btn-custom {
  background-color: var(--color-primary);
  border: none;
  color: white;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 24px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.btn-custom:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.btn-custom:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Footer inside controls */
footer {
  text-align: center;
  color: #64748b;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid #334155;
  font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .visualizer-title { font-size: 1.8rem; margin-top: 1rem; }
  #array { height: 300px; }
  .btn-custom { font-size: 0.9rem; padding: 8px 16px; margin: 5px !important; }
  body { padding-bottom: 320px; }
}
