* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  background-image: url('Icons/Windows-Xp-Bakground.png');
  background-size: cover;
  background-attachment: fixed;
  background-color: #0066cc;
  overflow: hidden;
}

/* Desktop */
.desktop {
  width: 100%;
  height: calc(100% - 28px);
  padding: 20px;
  overflow: auto;
  position: relative;
}

.desktop::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

.desktop::-webkit-scrollbar-track {
  background: #c0c0c0;
}

.desktop::-webkit-scrollbar-thumb {
  background-color: #dfdfdf;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

/* Desktop Icons */
.desktop-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  gap: 20px;
  padding: 10px;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  width: 80px;
  padding: 5px;
  border-radius: 2px;
  transition: all 0.1s;
}

.desktop-icon:hover {
  background-color: rgba(0, 0, 128, 0.3);
  border: 1px dotted #ffffff;
}

.desktop-icon:active {
  background-color: rgba(0, 0, 128, 0.5);
}

.desktop-icon img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.desktop-icon p {
  color: white;
  font-size: 12px;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  word-break: break-word;
  width: 100%;
}

/* Windows */
.windows-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 28px);
  pointer-events: none;
  z-index: 1000;
}

.window {
  position: fixed;
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #0a0e27;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  z-index: 1000;
  min-width: 300px;
  min-height: 200px;
}

.window.active {
  z-index: 2000;
}

.window-titlebar {
  background: linear-gradient(90deg, #000080 0%, #1084d7 100%);
  color: white;
  padding: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 20px;
  font-weight: bold;
  font-size: 11px;
  cursor: move;
  user-select: none;
}

.window-title {
  padding: 0 4px;
  flex: 1;
}

.window-buttons {
  display: flex;
  gap: 2px;
  margin-right: 2px;
}

.window-btn {
  width: 16px;
  height: 14px;
  padding: 0;
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background-color: #c0c0c0;
  color: black;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

.window-btn:active {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.window-btn.close:hover {
  background-color: #ff0000;
  color: white;
}

.window-content {
  flex: 1;
  padding: 8px;
  overflow: auto;
  background-color: #c0c0c0;
  font-size: 11px;
  color: #000;
  line-height: 1.6;
}

.window-content h1 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #000080;
}

.window-content p {
  margin-bottom: 10px;
  text-align: justify;
}

/* Taskbar */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(180deg, #c0c0c0, #dfdfdf);
  border-top: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  z-index: 3000;
}

.taskbar-start {
  margin-right: 5px;
}

.start-button {
  padding: 2px 8px;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background: linear-gradient(135deg, #dfdfdf, #c0c0c0);
  color: black;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-button:active {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.taskbar-apps {
  flex: 1;
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.taskbar-app-btn {
  padding: 2px 8px;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background: linear-gradient(135deg, #dfdfdf, #c0c0c0);
  color: black;
  font-family: 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  max-width: 200px;
  text-overflow: ellipsis;
  overflow: hidden;
}

.taskbar-app-btn:active {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.taskbar-tray {
  margin-left: auto;
  display: flex;
  align-items: center;
  padding: 0 5px;
  gap: 5px;
  border-left: 2px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  padding-left: 5px;
}

.system-time {
  font-size: 11px;
  color: #000;
  font-weight: bold;
}

/* Scrollbar for window content */
.window-content::-webkit-scrollbar {
  width: 16px;
}

.window-content::-webkit-scrollbar-track {
  background: #c0c0c0;
}

.window-content::-webkit-scrollbar-thumb {
  background-color: #dfdfdf;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

/* Responsive */
@media (max-width: 768px) {
  .desktop {
    height: calc(100% - 32px);
    padding: 10px;
  }

  .desktop-icons {
    grid-template-columns: repeat(auto-fill, 70px);
    gap: 12px;
    padding: 5px;
  }

  .desktop-icon {
    width: 70px;
    padding: 3px;
  }

  .desktop-icon img {
    width: 40px;
    height: 40px;
  }

  .desktop-icon p {
    font-size: 10px;
  }

  .window {
    min-width: 200px;
    min-height: 150px;
    font-size: 10px;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 60px) !important;
    width: calc(100vw - 20px) !important;
    height: 350px !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  .window-titlebar {
    height: 18px;
    font-size: 10px;
  }

  .window-content {
    font-size: 10px;
    padding: 6px;
  }

  .window-content h1 {
    font-size: 14px;
  }

  .window-content p {
    margin-bottom: 8px;
  }

  .taskbar {
    height: 32px;
  }

  .start-button {
    padding: 2px 6px;
    font-size: 10px;
    height: 24px;
  }

  .taskbar-app-btn {
    padding: 2px 6px;
    font-size: 9px;
    max-width: 120px;
  }

  .system-time {
    font-size: 10px;
  }

  .window-btn {
    width: 14px;
    height: 12px;
    font-size: 8px;
  }
}

@media (max-width: 480px) {
  .desktop {
    padding: 5px;
    height: calc(100% - 36px);
  }

  .desktop-icons {
    grid-template-columns: repeat(auto-fill, 60px);
    gap: 10px;
  }

  .desktop-icon {
    width: 60px;
  }

  .desktop-icon img {
    width: 32px;
    height: 32px;
  }

  .desktop-icon p {
    font-size: 9px;
  }

  .window {
    min-width: 160px !important;
    min-height: 120px !important;
    max-width: calc(100vw - 10px) !important;
    max-height: calc(100vh - 50px) !important;
    width: calc(100vw - 10px) !important;
    height: 300px !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  .window-titlebar {
    height: 16px;
    font-size: 9px;
    padding: 1px;
  }

  .window-content {
    font-size: 9px;
    padding: 4px;
  }

  .window-content h1 {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .taskbar {
    height: 36px;
  }

  .start-button {
    padding: 2px 4px;
    font-size: 9px;
    height: 24px;
  }

  .taskbar-app-btn {
    padding: 2px 4px;
    font-size: 8px;
    max-width: 80px;
  }

  .system-time {
    font-size: 8px;
  }

  .window-btn {
    width: 12px;
    height: 10px;
    font-size: 7px;
  }

  .window-title {
    font-size: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
