/* ---------------- General ---------------- */
html, body {
  margin: 0;
  padding: 0;
  font-family: Tahoma, sans-serif;
  height: 100vh;
  overflow: hidden;
  background: url('assets/wallpaper.jpg') no-repeat center center fixed;
  background-size: cover;
}

/* ---------------- Desktop ---------------- */
#desktop {
  position: relative;
  height: calc(100vh - 40px); /* leaves space for taskbar */
  padding: 20px;
  display: flex;
  flex-direction: column; /* stack icons vertically */
  gap: 20px;
  align-items: flex-start; /* left-align icons */
}

/* Desktop icons */
.icon {
  width: 80px;
  text-align: center;
  cursor: pointer;
  color: white;
  text-shadow: 1px 1px 2px black;
}

.icon img {
  width: 64px;
  height: 64px;
}

/* ---------------- Taskbar ---------------- */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: #c0c0c0;
  border-top: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 5px;
  box-shadow: inset 0 2px #808080;
}

#taskbar span {
  margin-right: 10px;
  font-weight: bold;
}

#open-windows {
  display: flex;
  gap: 5px;
  flex-grow: 1;
}

.taskbar-btn {
  background: #e0e0e0;
  border: 2px outset #fff;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.taskbar-btn.active {
  border: 2px inset #808080;
  background: #d0d0d0;
}

/* ---------------- Pinned Apps ---------------- */
#pinned-apps {
  display: flex;
  gap: 5px;
  margin-left: 10px;
}

.pinned-btn {
  width: 40px;
  height: 40px;
  background: #e0e0e0;
  border: 2px outset #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.pinned-btn.active {
  border: 2px inset #808080;
  background: #d0d0d0;
}

.pinned-btn img {
  width: 24px;
  height: 24px;
}

/* ---------------- Windows ---------------- */
.window {
  display: none;
  position: absolute;
  top: 100px;
  left: 100px;
  width: 500px;   /* increased default width */
  height: 400px;  /* increased default height */
  background: #fff;
  border: 2px solid #000;
  box-shadow: 5px 5px 0 #333;
  z-index: 1;
  overflow: hidden; /* keeps resizer & titlebar neat */
}

.window.active {
  display: block;
}

/* Make content fill window under titlebar */
.window .content {
  width: 100%;
  height: calc(100% - 30px); /* leave room for titlebar */
  overflow: hidden;            /* no scrollbar here */
  padding: 10px;             /* space inside */
  box-sizing: border-box;    /* padding doesn't shrink width */
}

/* Titlebar */
.titlebar {
  background: #0055aa;
  color: #fff;
  padding: 5px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.titlebar button.close {
  background: #c0c0c0;
  border: 1px solid #808080;
  cursor: pointer;
  padding: 0 6px;
}

/* Resize handle */
.resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  bottom: 0;
  right: 0;
  cursor: se-resize;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><line x1="0" y1="16" x2="16" y2="0" stroke="black" stroke-width="2"/></svg>') no-repeat center center;
}