*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --highlight-color: #fe7c00;
    --highlight-bg: #fe7b0079;
  --cell-size: 50px;
    --cell-color: #266a89;
    --tape-bg: #c7c7c7;
    --cell-margin: 4px;
    --head-size: calc(var(--cell-size) + 2 * var(--cell-margin));
    --head-color: var(--highlight-color);
    --cell-anim-duration: 500ms;

    /* input box variables */
      --inputbox-font-size: 40px;
    --inputbox-width: calc(var(--inputbox-font-size) * 3);
    --inputbox-height: calc(var(--inputbox-font-size) * 1.5);
    --inputbox-btn-size: var(--inputbox-font-size);
    --inputbox-btn-img-size: 25;

    --active-color: #6928ff6a;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: monospace, "Inter", sans-serif;
  background-color: var(--color-white);
  color: var(--color-gray-200);
  overflow: hidden;
}

.separator {
    background-color: var(--color-gray-600);
}

.separator.hline {
    width: 90%;
    height: 1px;
    margin: 2px;
}



.header {
  width: 100%;
  padding: 0px 16px;
  height: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--color-gray-900);
}

.header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}



.icon-button {
  padding: 8px;
  height: min-content;
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-gray-200);
  transition: all 0.2s;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  font: inherit;
  font-weight: 500;
}

.icon-button:hover {
  opacity: 0.9;
}

.icon-button:active {
  transform: translateY(1px);
}

.icon-button svg {
  width: 24px;
  aspect-ratio: 1/1;
}

.icon-button.sm {
  font-size: 14px;
}

.icon-button.xs {
  font-size: 12px;
}

.icon-button.sm svg {
  width: 20px;
  aspect-ratio: 1/1;
}

.icon-button.xs svg {
  width: 16px;
  aspect-ratio: 1/1;
}

.header__left-dock {
  display: flex;
  align-items: center;
  gap: 4px;
}

header__left-dock-static {
  display: flex;
  align-items: center;
}

.dock-button {
  padding: 12px 14px;
  background-color: transparent;
  border: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
  transition: all 0.2s;

  color: var(--color-gray-300);
}

.dock-button:first-child {
  /* flip */
  transform: scaleX(-1);
}

.dock-button:active {
  opacity: 0.9;
}

.dock-button svg {
  width: 20px;
  aspect-ratio: 1/1;
}

.dock-button.active {
  background-color: var(--active-color);
  color: var(--color-white);
}

.menu-button {
  padding: 8px;
  background-color: transparent;
  border: 0;
  cursor: pointer;
  color: var(--color-gray-200);
  transition: all 0.2s;
  align-items: center;
  display: flex;
  gap: 2px;
  width: 100%;
  font-size: 14px;
}

.menu-button svg {
  width: 20px;
  aspect-ratio: 1/1;
  margin-right: 8px;
}

.menu-button:hover {
  background-color: var(--color-gray-800);
}

.header__mid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  position: relative;
}

.header__mid-select {
  position: relative;
}

.header__mid-select select {
  font: inherit;
  padding: 8px 28px 8px 12px;
  font-size: 14px;
  appearance: none;
  border: 0;
  background-color: var(--color-gray-800);
  outline: none;
  color: var(--color-gray-100);
  font-weight: 500;
  border-radius: 4px;
}

.header__mid-select div {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-gray-400);
}

.header__mid-select div svg {
  width: 16px;
  aspect-ratio: 1/1;
}

.menu {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  top: 48px;
  gap: 8px;
  background-color: var(--color-gray-900);
  z-index: 2;
}

#machine-options-pane {
  border-top: 1px solid var(--color-gray-800);
  width: 50%;
  padding-bottom: 16px;
}

.speed-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 8px;
  gap: 8px;
}

.speed-bar label {
  font-size: 14px;
}

.speed-bar input {
    margin-top: 4px;
    width: 100%;
    appearance: none;
    cursor: pointer;
    height: 5px;
    background-color: var(--color-gray-700);
    border-radius: 9999px;
    transition: background-color 0.2s;
}

.speed-bar input::-webkit-slider-thumb {
    appearance: none;
    width: 24px;
    height: 24px;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%2318181b" stroke="%23e4e4e7" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M15.236 22a3 3 0 0 0-2.2-5"/%3E%3Cpath d="M16 20a3 3 0 0 1 3-3h1a2 2 0 0 0 2-2v-2a4 4 0 0 0-4-4V4"/%3E%3Cpath d="M18 13h.01"/%3E%3Cpath d="M18 6a4 4 0 0 0-4 4 7 7 0 0 0-7 7c0-5 4-5 4-10.5a4.5 4.5 0 1 0-9 0 2.5 2.5 0 0 0 5 0C7 10 3 11 3 17c0 2.8 2.2 5 5 5h10"/%3E%3C/svg%3E') no-repeat center center;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.header__right {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 12px;
  position: relative;
}

.header__right-play {
  display: flex;
  align-items: center;
}

.header__right span {
  color: var(--color-gray-700);
}

.main {
  width: 100%;
  display: flex;
  height: calc(100vh - 48px);
}

.playground {
  width: 100%;
  position: relative;
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
  background-color: transparent;
}

.panel-btn-wrapper {
  position: absolute;
  top: 4px;
  left: 4px;

}



#svgdisplay {
  width: 100%;
  height: 100%;
  z-index: 0;
  background-color: transparent;
}

/* tape styles */

#tape {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: calc(var(--head-size) + var(--cell-margin));
  background-color: var(--color-gray-900);
  border-top: 1px solid var(--color-gray-800);
  border-left: 1px solid var(--color-gray-800);
  overflow: hidden;
  z-index: 100;
}

.cell {
    position: absolute;
    width: var(--cell-size);
    height: var(--cell-size);
    /* border: 2px solid var(--cell-color); */
    background-color: var(--color-gray-800);
    border-radius: 10%;
    margin: var(--cell-margin);
    transition: left var(--cell-anim-duration);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    background-color: transparent;
    text-align: center;
    font-size: 20px;
    color: var(--primary-color);
    z-index: 1;
    font-family: inherit;
}

#tape-head {
    position: absolute;
    width: var(--head-size);
    height: var(--head-size);
    border: 2px dashed var(--head-color);
    background-color: var(--highlight-bg);
    transition: left var(--cell-anim-duration);
    z-index: 9;
    pointer-events: none;
}

/* end tape styles */

.panel {
  width: 300px;
  border-top: 1px solid var(--color-gray-800);
  max-width: 300px;
  min-width: 300px;
  background-color: var(--color-gray-900);
  height: 100%;
  position: relative;
  display: none; 
  animation: none; 
}

.panel.in-view {
  display: block; 
  animation: panelSlideIn 0.1s ease forwards; 
}

@keyframes panelSlideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

#panel-button {
  position: absolute;
  left: 100%;
  background-color: var(--color-gray-800);
  margin-left: 8px;
  margin-top: 8px;
  border-radius: 20%;
  padding: 4px;
  z-index: 100;

}

#menu-pane {
  border-bottom: 1px solid var(--color-gray-800);
  width: 100%;
  top: 0;
  display: none;
}

.profile-pane {
  right: 0;
  top: 48px;
  width: 50%;
  display: none;
  border-top: 1px solid var(--color-gray-800);
}


#machine-input-box {
  width: 100%;
  padding: 8px;
}

.input-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  width: 100%;
}

.input-box label {
  font-size: 14px;
}

.input-field {
  font: inherit;
  padding: 8px;
  font-size: 14px;
  appearance: none;
  border: 0;
  background-color: var(--color-gray-800);
  outline: none;
  color: var(--color-gray-100);
  font-weight: 500;
  border-radius: 4px;
  width: 100%;
}

.stack-cell {
    width: calc(2 * var(--stack-cell-size));
    height: var(--stack-cell-size);
    border-radius: 4px;
    background-color: var(--secondary-color);
    margin: var(--stack-cell-margin);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-gray-800);
}

.overflow {
    right: 100px;
    bottom: 25%;
    overflow: auto;
    height: 50%;
    display: block;
    text-align: center;
    border: 1px solid var(--color-gray-800);
}


#stack {
    margin: 10px;
    padding: 4px;
    border-bottom: 2px solid var(--color-gray-800);
    width: calc(2 * var(--cell-size) + 2 * var(--cell-margin));
    display: flex;
    flex-direction:column-reverse;
    align-items: center;
    justify-content: center;
}   


.mach-input-box {
    position: fixed;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: max-content;
    height: max-content;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: var(--color-gray-900);
    padding: calc(var(--inputbox-width) / 5);

    
}

.inner-input-box {
    display: flex;
    margin: 4px;
    align-items: center;
}

.mach-input-box input {
    width: var(--inputbox-width);
    height: var(--inputbox-height);
    font-size: var(--inputbox-font-size);
    margin: 0 4px;
    /* padding: calc(var(--inputbox-font-size) /2) 0; */
    text-align: center;
    background-color: var(--color-gray-800);
    border: 0;
    outline: none;
    color: var(--color-gray-100)
}

.mach-input-box img {
    width: var(--inputbox-btn-img-size);
    height: var(--inputbox-btn-img-size);
    color: var(--color-gray-100)
  }
  
  .mach-input-box button {
    width: var(--inputbox-btn-size);
    height: var(--inputbox-btn-size);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    background-color: var(--color-gray-800);
    border: 0;
    
  }

  .zoom-controls {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 64px;
  border-top: 1px solid var(--color-gray-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.popup {
  position: fixed;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.popup-content {
  width: 25%;
  padding: 16px;
  background-color: var(--color-gray-950);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-content h2 {
  font-size: 20px;
  color: var(--color-gray-200);
}

.popup-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.popup-button {
  padding: 8px;
  background-color: var(--color-gray-900);
  border: 0;
  color: var(--color-gray-200);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;  
  width: 100%;
  border-radius: 4px;
}

#login-submit {
  background-color: var(--active-color);
}

#signup-submit {
  background-color: var(--active-color);
}

#change-pwd-submit {
  background-color: var(--active-color);
}

#alert-popup {
  z-index: 1000;
}

.popup-button:hover {
  background-color: var(--color-gray-700);
}


#confirm-delete-yes {
  background-color: var(--color-red);
}

.popup-button img {
  width: 20px;
  aspect-ratio: 1/1;
  margin-right: 8px;
}



.popup-footer a {
  color: var(--color-dark-blue)
}


.popup-separator {
  width: 100%;
  height: 2px;
  background-color: var(--color-gray-800);
  margin: 8px 0;
}






