/* CSS reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #3a73ed;
}

a {
  text-decoration: none;
}

a:visited {
  color: inherit;
}

/* Scanlines */
.scanlines {
  position: relative;
  overflow: hidden;
}

.scanlines:before,
.scanlines:after {
  display: block;
  pointer-events: none;
  content: "";
  position: absolute;
}

.scanlines:before {
  width: 100%;
  height: 2px;
  z-index: 2147483649;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0.75;
  animation: scanline 6s linear infinite;
}

.scanlines:after {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483648;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 0, 0, 0.3) 51%
  );
  background-size: 100% 4px;
  animation: scanlines 1s steps(60) infinite;
}

@keyframes scanline {
  0% {
    transform: translate3d(0, 200000%, 0);
  }
}

@keyframes scanlines {
  0% {
    background-position: 0 50%;
  }
}

/* Body */
body {
  margin: 0;
  overflow: hidden;
  font-family: "Figtree", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.05em;
  background-color: #0078d7;
}

#desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#desktop-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  z-index: -1;
}

#icons {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  grid-auto-flow: column;
  grid-gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  grid-template-rows: repeat(var(--icon-rows, 7), auto);
  color: white;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 1);
  font-size: 0.75rem;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-align: center;
  border: 1px solid transparent;
  padding: 10px;
  text-decoration: none;
  color: inherit;
}

.icon:hover {
  background-color: rgba(60, 118, 237, 0.5);
}

.icon:active {
  border: 1px dashed black;
}

.icon img {
  width: 48px;
  height: 48px;
}

#recycle-bin {
  position: absolute;
  bottom: 50px;
  right: 10px;
  text-align: center;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 10px;
  font-size: 0.875rem;
  color: white;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 1);
}

#recycle-bin:hover {
  background-color: rgba(60, 118, 237, 0.5);
}

#recycle-bin:active {
  border: 1px dashed black;
}

#recycle-bin img {
  width: 48px;
  height: 48px;
}

#taskbar {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 40px;
  /* background: linear-gradient(180deg, #c53737, #a32020); */
  background: linear-gradient(180deg, #3745c5, #2072ee);
  display: flex;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.5),
    /* Inner shadow for slight inset look */ 0 -2px 4px rgba(0, 0, 0, 0.3); /* Outer shadow for depth */
  z-index: 1000;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#peeking-meerkat {
  position: absolute;
  bottom: 28px;
  right: 25%;
  z-index: 1002;
  object-fit: contain;
  cursor: pointer;
  display: none;
}

#peeking-meerkat img {
  width: 128px;
  height: auto;
}

#start-button {
  background: linear-gradient(180deg, #2fd326, #05a315);
  color: #ffffff;
  padding: 5px 20px;
  cursor: pointer;
  font-weight: 700;
  border-radius: 0px 8px 8px 0px;
  height: 100%;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 0 10px rgba(178, 34, 34, 0.5); /* Inner glow */
  transition: all 0.3s ease-in-out;
}

#start-button:hover {
  color: black;

  background: linear-gradient(180deg, #ffffff, #f6f6f6);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4),
    inset 0 0 15px rgba(255, 0, 0, 0.7); /* Increased and brightened inner glow */
}

#start-button:active {
  background: linear-gradient(180deg, #e0e0e0, #d0d0d0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 0 8px rgba(178, 34, 34, 0.8); /* Deeper inner glow */
}

#start-button img {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

#taskbar-clock {
  margin-left: auto;
  font-weight: 700;
  color: white;
  /* background: linear-gradient(180deg, #d95a5a, #b22222); */
  background: linear-gradient(180deg, #2095ee, #3762c5);
  /* background: linear-gradient(180deg, #3745c5, #2072ee); */

  padding: 2px 30px;
  height: 100%;
  display: flex;
  align-items: center;
  border-radius: 4px 0px 0px 4px;
  cursor: default;
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.5),
    /* Inner shadow for depth */ 0 2px 4px rgba(0, 0, 0, 0.3); /* Outer shadow for depth */
}

/* Start menu */

#start-menu {
  position: absolute;
  bottom: 40px;
  left: 0;
  width: 320px;
  background-color: #fff;
  border: 1px solid #0a246a;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  border-radius: 0px 8px 0px 0px;
  display: none;
  z-index: 1000;
  overflow: hidden;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.start-menu-top {
  background: linear-gradient(180deg, #2095ee, #3762c5);
  padding: 10px;
  color: white;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 5px;
  margin-right: 10px;
}

.username {
  font-weight: bold;
}

.start-menu-programs {
  background-color: white;
  padding: 5px 0;
}

.program-item {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  cursor: pointer;
}

.program-item:hover {
  background-color: #316ac5;
  color: white;
}

.program-item img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.start-menu-bottom {
  background: linear-gradient(180deg, #2095ee, #3762c5);
  padding: 10px;
}

.shut-down {
  display: flex;
  align-items: center;
  color: white;
  cursor: pointer;
}

.shut-down img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

/* Popup windows */
.popup-window {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50vw;
  height: 50vh;
  background-color: #ffffff;
  border: 2px solid #1169cd;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  resize: both;
  overflow: auto;
  min-width: 400px;
  min-height: 300px;
  transform: translate(-50%, -50%);
  overflow: hidden;
  display: none;
}

.popup-window.maximized {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  resize: none;
  border-radius: 0px;
}

.popup-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  font-size: 13px;
  padding: 3px 5px 3px 3px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
  /* background: linear-gradient(180deg, #c53737, #a32020); */
  background: linear-gradient(180deg, #3745c5, #2072ee);

  color: white;
}

.popup-header {
  display: flex;
  align-items: center;
  overflow: hidden;
  flex-grow: 1;
  min-width: 0;
}

.popup-icon {
  height: 20px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  flex-shrink: 0;
}

.popup-icon img {
  height: 100%;
  width: auto;
}

.popup-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  min-width: 0;
}

.popup-buttons {
  margin-left: auto;
  display: flex;
}

.popup-button {
  width: 20px;
  height: 20px;
  margin-left: 5px;
  background-size: cover;
  cursor: pointer;
}

.popup-button.maximize {
  background-image: url("../images/Icon-Maximize.webp"); /* Normal state */
}

.popup-button.maximize:hover {
  background-image: url("../images/Icon-Maximize-Hover.webp"); /* Hover state */
}

.popup-button.maximize:active {
  background-image: url("../images/Icon-Maximize-Active.webp"); /* Active state */
}

.popup-button.close {
  background-image: url("../images/Icon-Close.webp"); /* Normal state */
}

.popup-button.close:hover {
  background-image: url("../images/Icon-Close-Hover.webp"); /* Hover state */
}

.popup-button.close:active {
  background-image: url("../images/Icon-Close-Active.webp"); /* Active state */
}

.popup-content {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: auto;
  z-index: 1;

  padding: 0px;
}

/* Image Viewer */
.popup-content-image-viewer {
  overflow: auto;
  max-height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
}

.popup-content img.full-width-image {
  width: 100%;
  height: auto;
  display: block;
}

.popup-window.maximized .popup-content-image-viewer img {
  height: 50vw;
  width: 50vw;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

/* Notepad */
.popup-content-notepad {
  display: flex;
  flex-direction: column;
  height: calc(100% - 24px);
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: #2997d7 #ece9d8;
}

.notepad-ui {
  position: sticky;
  top: 0;
  background-color: #ece9d8;
  border: 1px solid #c0c0c0;
  padding: 0px;
  width: 100%;
}

.notepad-ui-button {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 0px;
  border: 1px dashed transparent;
  cursor: pointer;
  font-size: 13px;
}

.notepad-ui-button:hover {
  background-color: rgba(60, 118, 237, 0.5);
}

.notepad-ui-button:active {
  border: 1px dashed black;
}

.notepad-content {
  margin: 0px;
  padding: 10px;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
}

.notepad-content::-webkit-scrollbar {
  width: 16px;
}

.notepad-content::-webkit-scrollbar-thumb {
  background-color: #b62d2d;
  border-radius: 5px;
}

.notepad-content::-webkit-scrollbar-thumb:hover {
  background-color: #dd3737;
}

.notepad-content::-webkit-scrollbar-thumb:active {
  background-color: #a02626;
}
.notepad-content::-webkit-scrollbar-track {
  background-color: #ece9d8;
  border-radius: 5px;
}

/* Command prompt */
.popup-window-command-prompt {
  background-color: black;
}

.popup-content-command-prompt {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%; /* Ensure the container fills the available vertical space */
}

.popup-content-command-prompt video {
  max-width: 100%; /* Ensure video doesn't overflow horizontally */
  max-height: 100%; /* Ensure video doesn't overflow vertically */
  width: auto;
  height: auto;
  object-fit: contain; /* Maintain aspect ratio without overflowing */
}

/* Video viewer */
.popup-window-video-viewer {
  background-color: black;
}

.popup-content-video-viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%; /* Ensure the container fills the available vertical space */
}

.popup-content-video-viewer video {
  max-width: 100%; /* Ensure video doesn't overflow horizontally */
  max-height: 100%; /* Ensure video doesn't overflow vertically */
  width: auto;
  height: auto;
  object-fit: contain; /* Maintain aspect ratio without overflowing */
}

/* Paint */
.popup-content-paint {
  width: 100%;
  height: 100%;
}

.popup-content-paint iframe {
  object-fit: contain; /* Maintain aspect ratio without overflowing */
}

/* Game */
.popup-content-game {
  width: 100%;
  height: calc(100% - 24px);
  object-fit: contain;
}

#emulator-game {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Recycle bin */
.popup-content-recycle-bin {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: left;
  height: 100%;
  padding: 0px 10px;
}

#recycle-bin-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, max-content));
  grid-gap: 10px;
  justify-content: start;
  align-items: start;
}

.popup-content-terminal {
  background-color: #000;
  color: #ff0000;
  font-family: "Courier New", monospace;
  padding: 10px;
  height: calc(100% - 24px);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
}

/* Terminal */
#terminal-output {
  white-space: pre-wrap;
  word-wrap: break-word;
}

#terminal-input-line {
  display: flex;
  align-items: center;
}

#terminal-prompt {
  margin-right: 5px;
}

#terminal-input {
  background-color: transparent;
  border: none;
  color: #ff0000;
  font-family: "Courier New", monospace;
  font-size: inherit;
  outline: none;
}

#terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: #ff0000;
  animation: blink 0.7s infinite;
  display: none;
}

@keyframes blink {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Chat window */
.chat-popup {
  width: 400px;
  height: 500px;
}

.popup-content-chat {
  display: flex;
  flex-direction: column;
  height: calc(100% - 24px);
}

#chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px;
}

#chat-input-area {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ccc;
}

#chat-input {
  flex-grow: 1;
  resize: none;
  padding: 5px;
  margin-right: 10px;
}

#chat-send {
  padding: 5px 10px;
}

.chat-message {
  display: flex;
  margin-bottom: 10px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
}

.chat-bubble {
  background-color: #f1f0f0;
  border-radius: 18px;
  padding: 10px 15px;
  max-width: 70%;
}

.chat-message.user .chat-bubble {
  background-color: #dcf8c6;
  margin-left: auto;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-message.user .chat-avatar {
  margin-right: 0;
  margin-left: 10px;
}

/* Error message popup */
.popup-window.error-popup {
  width: 300px;
  height: auto;
  min-height: 150px;
  max-height: 200px;
  resize: none;
}

.error-popup {
  width: 300px;
  height: auto;
  min-height: 150px;
  max-height: 200px;
  resize: none;
}

.error-popup .popup-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-message {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.error-icon {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.error-buttons {
  text-align: center;
}

.error-buttons button {
  padding: 5px 20px;
  background: #f0f0f0;
  border: 1px solid #999;
  border-radius: 3px;
  cursor: pointer;
}

.error-buttons button:hover {
  background: #e0e0e0;
}

/* Cipher decoder popup */
.decoder-popup {
  width: 600px;
  height: 400px;
}

.decoder-content {
  background-color: #000;
  color: #00ff00;
  font-family: "Courier New", monospace;
  padding: 10px;
  height: calc(100% - 24px);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
}

.decoder-content:focus {
  outline: none;
}

#decoder-output {
  white-space: pre-wrap;
  word-wrap: break-word;
}

#decoder-input-line {
  display: flex;
  align-items: center;
}

#decoder-prompt {
  margin-right: 5px;
}

#decoder-input {
  background-color: transparent;
  border: none;
  color: #00ff00;
  font-family: "Courier New", monospace;
  font-size: inherit;
  outline: none;
}

#decoder-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: #00ff00;
  animation: blink 0.7s infinite;
}

/* Gif viewer */
.popup-window.gif-popup {
  width: 300px;
  height: 250px;
}

.popup-content-gif-viewer {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  overflow: hidden;
}

.centered-gif {
  width: 70%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  padding-bottom: 24px;
}

/* Style the scrollbar */
.popup-content::-webkit-scrollbar {
  width: 16px;
}

.popup-content::-webkit-scrollbar-thumb {
  background-color: #b62d2d;
  border-radius: 5px;
}

.popup-content::-webkit-scrollbar-thumb:hover {
  background-color: #dd3737;
}

.popup-content::-webkit-scrollbar-thumb:active {
  background-color: #a02626;
}

.popup-content::-webkit-scrollbar-track {
  background-color: #ece9d8;
  border-radius: 5px;
}

/* Winamp UI */
#winampapp {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

/* Loading screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#loading-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Shutdown screen */
#shutdown-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Unity game */
.popup-content-unity-game {
  width: 100%;
  height: calc(100% - 24px);
  overflow: hidden;
}

.popup-content-unity-game iframe {
  width: 100%;
  height: 100%;
  border: none;
}
