* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #333;
  color: #ddd;
  display: flex;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
  font-family: sans-serif;
}

header {
  width: 100%;
  height: 60px;
  background-color: #111;
  padding: 10px 40px;
  box-shadow: 0px 3px 10px #00000070;
  z-index: 100;
}

.sort-scope {
  display: inline-block;
  height: 100%;
  padding: 6px 0;
  background: #111;
  color: #ececec;
  text-decoration: none;
  font-size: 1.3rem;
  transition: background 0.3s ease;
  cursor: pointer;
}

label,
span {
  font-size: 15px;
}

.stats-value p {
  font-size: 16px;
}

.stats-value span {
  font-size: 17px;
  font-weight: bold;
}

button {
  margin: 10px;
  padding: 5px 5px;
  background-color: #111;
  color: #bbb;
  border: none;
}

button.restart,
button.randomize {
  margin-right: 6px;
  margin-left: 45px;
}

button:hover {
  /* background-color: #ddd; */
  color: #fff;
  cursor: pointer;
}

button:active {
  /* background-color: #000; */
  color: #bbb;
}

.algorithmDropdown {
  width: 150px;
  padding: 4px 5px;
  margin-top: 20px;
  font-size: 14px;
  border: 2px solid #fff;
  background-color: #333;
  color: #fff;
  transition: border-color 0.3s ease;
  cursor: pointer;
}

.algorithmDropdown:hover {
  border: 2px solid #aa50d1;
}

.viewport {
  display: flex;
  flex: 1;
  width: 100%;
}

.stats-display,
.anim-display,
.code-display {
  margin: 30px 10px;
  background-color: #111;
  box-shadow: 0 0px 10px #000000bb;
}

.stats-display {
  flex: 0 0 18%;
  display: flex; /* Flex container for its children */
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.stats-value {
  margin-top: 30px;
}

.anim-display {
  flex: 1;
  display: flex; /* Flex container for its children */
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.code-display {
  display: flex;
  align-items: center;
  font-family: monospace;
  font-size: 15px;
  background-color: #111;
  color: #f8f8f2;
  padding: 16px;
  overflow-x: auto;
}

.code-line-wrapper {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.code-line {
  display: block; /* Ensures each line behaves like a block element */
  white-space: pre; /* Preserve spaces and newlines */
  margin: 0; /* Remove margin between lines */
  padding: 0; /* Remove padding */
  line-height: 2; /* Avoid extra space between lines */
  width: 100%; /* Ensure lines take full width */
}

.code-line.highlight {
  background-color: #484848;
  color: #50fa7b;
  font-weight: bold;
  display: block;
}

.footer-controls {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #111;
  padding: 20px 0;
  text-align: center; /* Centered text */
  box-shadow: 0 -2px 10px #00000070;
}

.btn-container {
  width: 420px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.array-controls {
  width: 420px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.play-direction {
  width: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-bar-container {
  width: 95%;
  background-color: #e0e0e0;
  border-radius: 0px;
  overflow: hidden;
}

.progress-bar {
  height: 10px;
  width: 0%;
  background-color: #50d15b;
}

.media-playback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.speed-control {
  padding: 4px 5px;
  margin: 0px 10px;
  font-size: 14px;
  border: 2px solid #fff;
  background-color: #333;
  color: #fff;
  transition: border-color 0.3s ease;
  cursor: pointer;
}

.speed-control:hover {
  border: 2px solid #aa50d1;
}

.array-size-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.size-lable {
  margin-left: 10px;
}

.n-slider {
  margin: 0px 5px;
  -webkit-appearance: none;
  appearance: none;
  width: 75px;
  height: 10px;
  background: #ffffff;
  outline: none;
  opacity: 0.7;
  -webkit-transition: 0.2s;
  transition: opacity 0.2s;
}

.n-slider:hover {
  opacity: 1;
}

.n-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #666;
  cursor: pointer;
}

.n-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #666;
  cursor: pointer;
}

.copyright {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 11px;
  padding: 5px 10px;
  color: #e5e5e5;
}
