:root {
  --primary: #42dec9;
  --text: #fff;
  --appbar: #fff;
  --red: #d65050;
  --green: #50d678;
  --blue: #50a3d6;
}

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

body {
  position: relative;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  /* background-image: url("./wallpapers/4.png"); */
  background-color: var(--primary);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text);
  /*  */
  user-select: none;
  font-family: "Courier New", Courier, monospace;
}

#loading {
  width: 100%;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: black;
  z-index: 100000000000;
  display: flex;
  justify-content: center;
  align-items: center;
}

span.primary {
  color: var(--primary);
  font-weight: 600;
}

#topbar #time, #topbar #os-name {
  font-weight: 600;
  letter-spacing: 1px;
}

#desktop {
  height: 100vh;
  width: 100vw;
}

#desktop #apps {
  padding-top: 1.2cm;
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  align-content: center;
  justify-content: center;
  grid-auto-flow: column;
}

#desktop #apps > * {
  overflow: hidden;
}

#desktop .app {
  height: calc(100% - 10px);
  width: calc(100% - 10px);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  z-index: 1000;
}

#desktop .app.clickedOnce {
  border: 1px solid var(--blue);
  background-color: #0000ff33;
}

#desktop .app .icon {
  width: 100%;
  height: 60%;
  background-image: var(--iconURL);
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

#desktop .app .name {
  font-size: calc(((100vw / 12) - (12 * 5px)) / 6 + 8px);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 3px #000;
}

#desktop #topbar {
  position: absolute;
  top: 0;
  left: 0;
  background-color: #5c5c5c85;
  backdrop-filter: blur(10px);
  width: 100vw;
  height: 1.2cm;
  padding: 8px 10px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #c7c7c75c;
}

#desktop #topbar span {
  background-color: #c7c7c75c;
  border-radius: 10px;
  padding: 5px 10px;
}

#selection-box {
  position: absolute;
  border: 1px solid var(--blue);
  background-color: #0000ff33;
  display: none;
  z-index: 100;
}

#apps-widgets .app-widget {
  overflow: hidden;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 200px;
  min-height: 150px;
  z-index: 10000;
  border-radius: 10px;
  background-color: #5c5c5c85;
  backdrop-filter: blur(10px);
  border: 2px solid #c7c7c75c;
  transition: transform 250ms;
}

#apps-widgets .app-widget .app-content {
  padding: 10px;
  user-select: text !important;
  height: calc(100% - 40px);
  overflow-y: auto;
}

#apps-widgets .app-widget .app-content:has(iframe) {
  padding: 0;
}

#apps-widgets .app-widget .app-content iframe{
  width: 100%;
  height: 98%;
  border: none;
}

#apps-widgets .app-widget.closing {
  transform: translate(-45%, -45%) scale(0.01);
}

#apps-widgets .app-widget .app-navbar {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  padding: 10px;
  background-color: #5c5c5c85;
  gap: 10px;
}

#apps-widgets .app-widget .app-navbar .close-app {
  cursor: pointer;
}

#apps-widgets .app-widget .resizer {
  position: absolute;
  width: 10px;
  height: 10px;
}

#apps-widgets .app-widget .resizer.bottom {
  bottom: 0;
  left: 0;
  cursor: s-resize;
  width: 100%;
}
#apps-widgets .app-widget .resizer.left {
  top: 38px;
  left: 0;
  cursor: e-resize;
  height: 100%;
}
#apps-widgets .app-widget .resizer.right {
  top: 38px;
  right: 0;
  cursor: w-resize;
  height: 100%;
}
