* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Tahoma', 'Segoe UI', sans-serif;
  user-select: none;
}

#desktop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 30px;
  background: url('../wallpapers/bliss.jpg') no-repeat center center fixed;
  background-size: cover;
  overflow: hidden;
}

/* Desktop Icon Grid */
.desktop-icons {
  position: absolute;
  top: 10px;
  left: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 14px;
  z-index: 5;
}

.desktop-icon {
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.1s;
}

.desktop-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.desktop-icon.selected {
  background: rgba(11, 97, 255, 0.45);
  border: 1px dotted rgba(255, 255, 255, 0.8);
}

.desktop-icon img {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  filter: drop-shadow(1px 2px 3px rgba(0,0,0,0.7));
}

.desktop-icon span {
  color: #fff;
  font-size: 11px;
  text-shadow: 1px 1px 2px #000, -1px -1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000;
  word-break: break-word;
  line-height: 1.2;
}

/* Taskbar */
#taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, #1f2f86 0%, #316ac5 3%, #245edb 10%, #2054c6 90%, #1941a5 100%);
  display: flex;
  align-items: center;
  z-index: 99999;
  box-shadow: 0 -1px 3px rgba(0,0,0,0.5);
}

#start-btn {
  height: 30px;
  background: linear-gradient(to bottom, #388e3c 0%, #4caf50 15%, #2e7d32 85%, #1b5e20 100%);
  border: none;
  border-radius: 0 10px 10px 0;
  display: flex;
  align-items: center;
  padding: 0 16px 0 8px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 2px 0 4px rgba(0,0,0,0.4);
  font-family: 'Tahoma', sans-serif;
  font-size: 14px;
  font-weight: bold;
  font-style: italic;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  gap: 6px;
}

#start-btn:hover {
  background: linear-gradient(to bottom, #43a047 0%, #66bb6a 15%, #388e3c 85%, #2e7d32 100%);
}

#start-btn:active, #start-btn.active {
  background: linear-gradient(to bottom, #1b5e20 0%, #2e7d32 85%, #388e3c 100%);
}

.quick-launch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-right: 1px solid rgba(255,255,255,0.2);
}

.quick-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 2px;
}

.quick-btn:hover {
  background: rgba(255,255,255,0.2);
}

.quick-btn img {
  width: 16px;
  height: 16px;
}

/* Taskbar Windows list */
#task-list {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  overflow-x: auto;
  height: 100%;
}

.task-item {
  height: 24px;
  width: 160px;
  background: linear-gradient(to bottom, #3c81f3 0%, #245edb 50%, #1a4fc0 100%);
  border: 1px solid #14358a;
  border-radius: 3px;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 6px;
  cursor: pointer;
  font-size: 11px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item:hover {
  background: linear-gradient(to bottom, #53a3ff 0%, #3576f3 50%, #205cd6 100%);
}

.task-item.active {
  background: linear-gradient(to bottom, #1941a5 0%, #15378c 50%, #1e4bb5 100%);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5);
  border-color: #0b1f54;
}

.task-item img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* System Tray */
#system-tray {
  height: 100%;
  background: linear-gradient(to bottom, #0c59b8 0%, #106ad8 10%, #0c59b8 90%, #084391 100%);
  border-left: 1px solid #15378c;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  color: #fff;
  font-size: 11px;
  box-shadow: inset 1px 0 2px rgba(0,0,0,0.3);
}

.tray-icon {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Start Menu */
#start-menu {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 380px;
  background: #fff;
  border-radius: 6px 6px 0 0;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
  display: none;
  flex-direction: column;
  z-index: 100000;
  border: 1px solid #002e82;
  overflow: visible;
}

.start-header {
  height: 52px;
  background: linear-gradient(to bottom, #0055ea 0%, #2073ff 20%, #0055ea 100%);
  border-radius: 5px 5px 0 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  box-shadow: inset 0 -1px 0 #ff9900;
}

.start-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 2px solid #fff;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.start-body {
  display: flex;
  height: 380px;
}

.start-left {
  flex: 1.1;
  background: #fff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #95bdee;
  overflow-y: auto;
}

.start-right {
  flex: 0.9;
  background: #d3e5fa;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.start-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  color: #333;
}

.start-item:hover {
  background: #2f71cd;
  color: #fff !important;
}

.start-item img {
  width: 24px;
  height: 24px;
}

.start-item-right {
  font-weight: bold;
  color: #00136b;
  padding: 6px 8px;
}

.start-item-right:hover {
  background: #2f71cd;
  color: #fff;
}

.start-item-right img {
  width: 20px;
  height: 20px;
}

.start-all-programs {
  margin-top: auto;
  border-top: 1px solid #d3d3d3;
  padding-top: 6px;
  font-weight: bold;
  position: relative;
}

.start-footer {
  height: 44px;
  background: linear-gradient(to bottom, #1e52b7 0%, #2f71cd 20%, #1e52b7 100%);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
}

.footer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
}

.footer-btn:hover {
  background: rgba(255,255,255,0.2);
}

.footer-btn img {
  width: 22px;
  height: 22px;
}

/* Submenu */
.submenu {
  display: none;
  position: absolute;
  left: 100%;
  bottom: 0;
  width: 240px;
  background: #fff;
  border: 1px solid #002e82;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
  padding: 4px;
  z-index: 100001;
  max-height: 400px;
  overflow-y: auto;
}

.has-submenu:hover > .submenu {
  display: block;
}

/* Window Manager Styles */
.xp-window {
  position: absolute;
  background: #ece9d8;
  border: 3px solid #0055ea;
  border-radius: 6px 6px 0 0;
  box-shadow: 2px 4px 14px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 300px;
  min-height: 200px;
}

.xp-window.inactive {
  border-color: #7697d7;
}

.window-titlebar {
  height: 28px;
  background: linear-gradient(to bottom, #0058ee 0%, #3593ff 10%, #288eff 30%, #0055ea 50%, #0045c4 90%, #0030a8 100%);
  border-radius: 3px 3px 0 0;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 6px;
  cursor: move;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  text-shadow: 1px 1px 1px #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.xp-window.inactive .window-titlebar {
  background: linear-gradient(to bottom, #7697d7 0%, #8ba6df 30%, #6582f5 50%, #5171e5 100%);
}

.window-title-icon {
  width: 16px;
  height: 16px;
}

.window-title-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.w-btn {
  width: 21px;
  height: 21px;
  border-radius: 3px;
  border: 1px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.w-min {
  background: linear-gradient(to bottom, #3b88e8 0%, #1555c4 100%);
}
.w-max {
  background: linear-gradient(to bottom, #3b88e8 0%, #1555c4 100%);
}
.w-full {
  background: linear-gradient(to bottom, #e67e22 0%, #d35400 100%);
  font-size: 10px;
}
.w-close {
  background: linear-gradient(to bottom, #e04343 0%, #c41818 100%);
}

.w-btn:hover {
  filter: brightness(1.2);
}
.w-btn:active {
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.6);
}

.window-content {
  flex: 1;
  background: #fff;
  position: relative;
  overflow: hidden;
}

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

/* Resize Handles */
.resizer {
  position: absolute;
  z-index: 10;
}
.resizer-r { right: 0; top: 0; width: 6px; height: 100%; cursor: e-resize; }
.resizer-b { bottom: 0; left: 0; width: 100%; height: 6px; cursor: s-resize; }
.resizer-rb { right: 0; bottom: 0; width: 10px; height: 10px; cursor: se-resize; }

/* Right click context menu */
#context-menu {
  position: absolute;
  width: 160px;
  background: #fff;
  border: 1px solid #808080;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
  display: none;
  flex-direction: column;
  padding: 2px;
  z-index: 1000000;
  font-size: 11px;
}

.ctx-item {
  padding: 4px 10px;
  cursor: pointer;
}
.ctx-item:hover {
  background: #2f71cd;
  color: #fff;
}
.ctx-sep {
  height: 1px;
  background: #d4d0c8;
  margin: 2px 0;
}
