html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background-color: #4d4d4d;
  font-family: 'Kode Mono', monospace;
  color: #f2f1ef;
}

.container-fluid {
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.row {
  height: 100%;
}

.col-9 {
  height: 100%;
}

.menu {
  background-color: #787878;
  font-size: 20pt;
  color: #050709;
  width: 80%;
  border-radius: 4vmin;
  border: none;
  transition: all 0.2s ease;
}

.topBtn {
  margin-bottom: 1.5vmin;
}

.menu:hover {
  background-color: #8a8a8a;
  cursor: pointer;
}

.flip-horizontal {
  transform: scaleX(-1);
}

.submenu {
  font-size: 1.7vminpt;
  background-color: #363636;
  color: #f2f1ef;
  font-size: 1.1rem;
  line-height: 1.8;
  width: 80%;
  margin-left: 16%;
  margin-top: 0;
  border-radius: 0 0 3vmin 3vmin;
  padding: 1vmin 1.2vmin;
  transition: all 0.3s ease;
  opacity: 1;
}

.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.visible {
  display: block;
  opacity: 1;
  transition: all 0.3s ease;
}

.submenu p {
  cursor: pointer;
  transition: background 0.2s;
  padding-left: 3vmin;
  margin-bottom: 0;
}

.submenu p:hover {
  background-color: #303030;
  border-radius: 6vmin;
}

.main-area {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background-color: #787878;
  border-radius: 4vmin;
  padding: 0.1vmin;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 4vmin;
    padding-right: 0.5vmin;
}

.scroll-container::-webkit-scrollbar {
    width: 10px;
    border-radius: 4vmin;
}

.scroll-container::-webkit-scrollbar-thumb {
    background-color: #5c5c5c;
    border-radius: 4vmin;
}

.scroll-container::-webkit-scrollbar-track {
    background-color: #363636;
    border-radius: 4vmin;
}

.langTabs {
  background-color: #363636;
  color: #f2f1ef;
  border-radius: 4vmin;
  margin: 2vmin;
  padding: 0.5vmin;
}

.langBtn {
  background-color: #787878;
  font-size: 2vmin;
  color: #050709;
  border-radius: 4vmin;
  border: none;
  transition: all 0.2s ease;
  margin: 1vmin;
}

.code-container {
  background-color: #5c5c5c;
  color: #f2f1ef;
  border-radius: 3vmin;
  margin-right: 2vmin;
  margin-left: 2vmin;
  padding: 1vmin;
  display: inline-block;
  max-width: 40vw;
  max-height: 60vh;
  overflow: auto;
  flex-shrink: 0;
}

.code-block {
  display: inline-block;
  margin: 0px;
  margin-right: 1vmin;
}

pre code {
    font-family: 'Kode mono', monospace; 
    font-size: 1.6vmin;                     
    line-height: 1.5;                    
}

.counter svg {
  width: 15vmin;
  height: auto;
  max-width: 20vmin;
  border-radius: 3vmin;
}

.d-flex.flex-row.justify-content-center.align-items-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4vmin;
}

.arrayText {
  font-size: 4vmin;
  color: #050709;
  font-weight: bold;
}

.arrayRow {
  background-color: #5c5c5c;
  color: #f2f1ef;
  border-radius: 3vmin;
  min-height: 6vmin;
  margin: 0 auto 1.5vmin auto;
  padding: 0.6vmin 1.2vmin;
  width: 90%;
}

#values {
  gap: 3vmin;
  align-items: center;
}

.arrayData {
  font-size: 3.5vmin;
  margin: 0;
  font-weight: bold;
}

.operations {
  background-color: #6B4E71;
  color: #050709;
}

#bottomBar {
  background-color: #4d4d4d;
  border-radius: 20px;
  color: #f2f1ef;
  font-family: 'Kode Mono', monospace;
  font-size: 1rem;
}

#stepCounter, #progressPercent {
  font-size: 2vmin;
}

.player-btn {
  cursor: pointer;
  transition: transform 0.2s ease;
  width: 5vmin;
  height: 5vmin;
  min-width: 24px;
  min-height: 24px;
}

.player-btn:hover {
  transform: scale(1.15);
}

#explanation {
  top: 2vmin;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 900px;
}

.algorithmSection {
  text-align: center;
  padding-top: 1vmin;
  margin: 2vmin auto;
  max-width: 800px;
}

.algorithmTitle {
  font-size: 3rem;
  color: #050709;
  margin-bottom: 2vmin;
}

.algorithmDescription {
  color: #050709;
  font-size: 1.5rem;
  margin-bottom: 1vmin;
  line-height: 1.6;
}

.algorithmSteps {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: #050709;
}

.algorithmExtra {
  font-size: 1.5rem;
  line-height: 1.5;
  color: #050709;
}

.backBtn {
  position: absolute;
  bottom: 2vmin;
  left: 2vmin;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.8vmin;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.backBtn:hover {
  background-color: rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

.backIcon {
  width: 5vmin;
  height: 5vmin;
  fill: #050709;
}

.flip {
  transform: scaleX(-1);
}

.flip:hover {
  transform: scaleX(-1) scale(1.15);
}

.active {
  font-weight: bold;
  font-size: 2vmin;
}

.active-btn {
  font-weight: bolder;
  font-size: 3vmin;
}

.highlight {
  display: inline-block;
  animation: smallZoom 0.5s ease-in-out;
  color: #98FB98;
  font-weight: bold;
}

.highlightArray {
  display: inline-block;
  font-size: 4vmin;
  animation: zoomPulse 0.8s ease-in-out;
}

.arrayContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arrayIndices {
    font-size: 2.5vmin;
    color: #050709;
    font-family: monospace;
    letter-spacing: 0.35em;
    margin-bottom: 0.2rem;
}

.arrayIndices p {
    margin-bottom: 0 !important;
}

.arrayText {
    margin-bottom: 0.3rem;
}

.highlightIndex {
    display: inline-block;
    font-weight: bold;
    animation: zoomPulse 0.8s ease-in-out;
}

.highlightIndex.i-index {
    color: #98fb98;
}

.highlightIndex.j-index {
    color: #00ced1;
}

.positioning {
  position: absolute;
}

.valuePulse {
  display: inline-block;
  transform-origin: center center;
  animation: centeredPulse 1s ease-in-out;
}

.smallZoomAnim {
  display: inline-block;
  animation: smallZoom 0.8s ease-in-out;
}

button:disabled,
button[disabeled] {
  pointer-events: none;
  opacity: 0.5;
}

@keyframes smallZoom {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes centeredPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  35% {
    transform: scale(1.3);
    opacity: 0.9;
  }
  70% {
    transform: scale(0.95);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes zoomPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.85;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: #787878;
  border-radius: 4vmin;
  padding: 3vmin;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-title {
  font-size: 2.5vmin;
  color: #050709;
  margin-bottom: 2vmin;
  text-align: center;
  font-weight: bold;
}

.modal-body {
  margin-bottom: 2vmin;
}

.modal-instruction {
  font-size: 1.8vmin;
  color: #f2f1ef;
  margin-bottom: 1.5vmin;
  text-align: center;
}

.array-input {
  width: 100%;
  background-color: #5c5c5c;
  color: #f2f1ef;
  border-radius: 2vmin;
  padding: 1.5vmin;
  font-size: 2vmin;
  font-family: 'Kode Mono', monospace;
  resize: none;
  min-height: 60px;
  transition: border-color 0.3s ease;
}

.array-input:focus {
  outline: none;
  border-color: #98fb98;
}

.array-input::placeholder {
  color: #a0a0a0;
}

.input-error {
  background-color: #4d1e1e;
  color: #ff6b6b;
  padding: 1vmin;
  border-radius: 1.5vmin;
  margin-top: 1vmin;
  font-size: 1.6vmin;
  text-align: center;
  border: 1px solid #ff6b6b;
}

.array-preview {
  background-color: #5c5c5c;
  border-radius: 2vmin;
  padding: 1.5vmin;
  margin-top: 2vmin;
  min-height: 80px;
}

.preview-label {
  font-size: 1.8vmin;
  color: #f2f1ef;
  margin-bottom: 1vmin;
  font-weight: bold;
}

.preview-array {
  background-color: #363636;
  border-radius: 1.5vmin;
  padding: 1vmin;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5vmin;
  color: #f2f1ef;
  font-family: 'Kode Mono', monospace;
}

.preview-placeholder {
  color: #a0a0a0;
  font-style: italic;
  font-size: 1.8vmin;
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2vmin;
  padding: 0 2vmin;
}

.modal-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 1vmin;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-btn:hover {
  background-color: rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
}

.modal-btn:active {
  transform: scale(0.95);
}

.btn-icon {
  width: 5vmin;
  height: 5vmin;
  fill: #050709;
}

.cancel-btn:hover .btn-icon {
  fill: #ff6b6b;
}

.confirm-btn:hover .btn-icon {
  fill: #98fb98;
}

.confirm-btn .btn-icon.flip-horizontal {
  transform: scaleX(-1);
}

.confirm-btn:hover .btn-icon.flip-horizontal {
  transform: scaleX(-1) scale(1.0);
}

.modal-overlay.hidden {
  display: none;
  pointer-events: none;
}

.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}
