/* === Global Defaults === */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.wallpaper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
}

/* === Desktop Icons === */
.desktop {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  position: relative;
  height: 100vh;
  box-sizing: border-box;
  overflow: hidden;
  align-content: flex-start;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  width: 64px;
  max-height: 96px;
  padding: 4px;
  cursor: pointer;
  color: white;
  text-shadow: 1px 1px 2px black;
  box-sizing: border-box;
  user-select: none;
  overflow: hidden;
}

.icon img {
  width: 48px;
  height: 48px;
  pointer-events: none;
}

.icon span {
  font-size: 0.8rem;
  text-align: center;
}

/* === Taskbar === */
.taskbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  background: rgba(255, 255, 255, 0.75);
  padding: 0 10px;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  pointer-events: none;
}

.taskbar-clock {
  font-size: 12px;
  color: black;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  padding-right: 14px; /* extra space for Chrome's overflow */
  min-width: 80px;
  height: 100%;
  white-space: pre-line;
  box-sizing: border-box;
}

.taskbar * {
  pointer-events: auto;
  user-select: none;
}

#taskbar-left {
  display: flex;
  gap: 6px;
  pointer-events: none;
}

#taskbar-left .start {
  pointer-events: auto;
}

.start img {
  height: 32px;
  margin-left: 8px;
  cursor: pointer;
}

.taskbar-apps {
  pointer-events: auto;
  display: flex;
}

.taskbar-apps img {
  pointer-events: auto;
}

.taskbar-apps img,
.taskbar-icon {
  height: 28px;
  width: 28px;
  object-fit: contain;
  margin: 0 4px;
  cursor: pointer;
  display: block;
}



/* === Windows === */
.window {
  position: absolute;
  top: 100px;
  left: 100px;
  width: 500px;
  height: 400px;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  resize: both;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 10;
}

.window.visible {
  opacity: 1;
}

.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0;
  border: none;
}

.title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  height: 32px;
  padding: 0 10px;
  font-weight: 500;
  font-size: 14px;
  user-select: none;
  cursor: grab;
  border-bottom: 1px solid #ccc;
}

.window-controls {
  display: flex;
  gap: 4px;
}

.window-controls button {
  width: 36px;
  height: 28px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.window-controls button img {
  width: 12px;
  height: 12px;
}

.window-controls button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.window-controls .close:hover {
  background-color: #e81123;
}

.window-body {
  flex: 1;
  overflow: auto;
}

.window iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.folder-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
}

/* === Modal / UAC === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-box {
  background: #f5f5f5;
  border: 2px solid #999;
  box-shadow: 0 0 10px black;
  padding: 15px;
  font-size: 14px;
  min-width: 300px;
  max-width: 90vw;
}

.modal-header {
  background: linear-gradient(to right, #2778b7, #5ab5e9);
  color: white;
  padding: 5px 10px;
  font-weight: bold;
  margin: -15px -15px 10px -15px;
}

.modal-footer {
  margin-top: 10px;
  text-align: right;
}

.modal-footer button {
  padding: 5px 10px;
  margin-left: 5px;
  font-size: 13px;
}


/* === Word-like Toolbar === */
.word-toolbar {
  display: flex;
  gap: 6px;
  background: #f3f3f3;
  border-bottom: 1px solid #ccc;
  padding: 4px 8px;
}

.word-toolbar button {
  background: white;
  border: 1px solid #ccc;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.word-toolbar button img {
  width: 16px;
  height: 16px;
}

.word-toolbar button:hover {
  background: #e6e6e6;
}
