@import "./controls.css";
@import "./menu.css";

:root {
  --self-altitude: 200;
  --multiplayer-x: 0px;
  --multiplayer-y: 0px;
}

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

html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  margin: 0px;
  padding: 0px;
  overflow: hidden;
}

#canvas-container {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 0;
}

#planeCanvas {
  width: 600px;
  height: 600px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  position: absolute;
  z-index: var(--self-altitude);
  background-color: transparent;
}

#instrumentCanvases {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 15000;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: end;
}

#speedometerCanvas {
  width: 100%;
  height: 100%;
  position: absolute;
  z-index: 3;
  background-color: transparent;
}

#result {
  position: absolute;
  left: 25px;
  bottom: 50px;
  width: 300px;
  min-height: 25px; /* Changed from height to min-height */
  overflow-y: hidden; /* Prevent scroll bar */
  resize: none; /* Prevent manual resize by user */
  background: rgba(0, 0, 0, 0.6);
  border: transparent;
  opacity: 0;
  color: white;
  font-family: boxyFont;
  letter-spacing: 1px;
  font-size: 16px;
  padding: 4px; /* Add padding for better text alignment */
}

#commandBox {
  position: absolute;
  left: 25px;
  bottom: 25px;
  width: 300px;
  height: 25px;
  background: rgba(0, 0, 0, 0.6);
  border: transparent;
  color: transparent;
  opacity: 0;
}

#commandBox:focus,
#result:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
  color: white;
  font-family: boxyFont;
  letter-spacing: 1px;
  font-size: 16px;
  opacity: 1;
}

#coords {
  position: absolute;
  right: 25px;
  top: 25px;
  color: black;
  font-family: boxyFont;
  letter-spacing: 1px;
  font-size: 16px;
  text-shadow: 2px 2px #fff;
}

#altitude {
  position: absolute;
  right: 25px;
  top: 46px;
  color: black;
  font-family: boxyFont;
  letter-spacing: 1px;
  font-size: 16px;
  text-shadow: 2px 2px #fff;
}

#navigateControls {
  position: absolute;
  bottom: 25px;
  right: 25px;
  z-index: 100;
}

/* Menu UI */

#menu {
  position: absolute;
  top: 25px;
  left: 25px;
  z-index: 100;
  display: flex;
  gap: 10px;
}

#hamburger {
  width: 50px;
  height: 50px;
  background: url("../assets/menu.png") 0 0; /* Set the sprite image */
  background-size: 50px 50px;
  cursor: pointer;
}

#nav {
  background: rgba(255, 255, 255, 0.8);
  border: solid #323c39 4px;
  border-radius: 5%;
  display: none;
  margin-top: 0.5rem;
  padding: 0.2rem 0.8rem;
  font-family: boxyFont;
  letter-spacing: 1px;
  font-size: 16px;
  user-select: none;
}

#nav ul {
  list-style: none;
  padding: 0;
}

#nav li {
  cursor: pointer;
}

#nav li:hover {
  color: rgb(6, 173, 224);
}

/* Customisation UI */

#ui {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: auto;
  background: rgba(255, 255, 255, 0.7);
  border: solid #323c39 4px;
  padding: 1rem;
  font-family: boxyFont;
  letter-spacing: 1px;
  z-index: 150;
  display: none;
}

#customizeMenu {
  display: none;
  text-shadow: 1px 1px white;
}

#welcome {
  display: block;
  text-shadow: 1px 1px white;
  text-align: center;
}

#settingsMenu {
  display: none;
  text-shadow: 1px 1px white;
}

#start {
  cursor: pointer;
}

.planeColors {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#speakerphone {
  width: 50px;
  height: 50px;
  background-image: url("../assets/sound.png");
  background-size: cover;
  cursor: pointer;
}

#speakerphone:not(.muted) {
  background-position: top;
}

#speakerphone.muted {
  background-position: bottom;
}

#timeCycle {
  width: 100%;
  height: 100%;
  background: hsl(20deg 100% 50%);
  opacity: 0;
  z-index: 10;
  position: relative;
}

.mpPlaneCanvas {
  --plane-x: 400px;
  --plane-y: 400px;
  --plane-z-index: 200;
  --plane-scale: 1;
  
  width: 600px;
  height: 600px;
  top: calc(50% - var(--plane-y) + var(--multiplayer-y));
  left: calc(50% + var(--plane-x) + var(--multiplayer-x));
  transform: translate(-50%, -50%) scale(var(--plane-scale));
  opacity: max(0, calc(1.5 - (var(--plane-scale) - 1)));
  position: absolute;
  z-index: var(--plane-z-index);
  background-color: transparent;
  transition: none;
}

@font-face {
  font-family: boxyFont;
  src: url("boxyFont.otf") format("opentype");
}

