* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body.dark-theme {
  --window-bg: rgba(20, 20, 30, 0.4);
  --text-color: #ffffff;
}

body.light-theme {
  --window-bg: rgba(255, 255, 255, 0.4);
  --text-color: #111111;
}

#bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.desktop {
  width: 100vw;
  height: 100vh;
  position: relative;
  background-size: cover;
  background-position: center;
}


.top-bar {
  width: 100%;
  height: 35px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  color: white;
  position: absolute;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}


.bottom-taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 48px;
  background: rgba(15, 15, 20, 0.75);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding: 0 15px;
  z-index: 1000;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.taskbar-pins {
  display: flex;
  gap: 10px;
}

.taskbar-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 20px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.taskbar-icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.taskbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 15px;
}

.taskbar-apps {
  display: flex;
  gap: 8px;
  flex-grow: 1;
  overflow-x: auto;
}

.taskbar-tab {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.taskbar-tab:hover { background: rgba(255, 255, 255, 0.25); }


.desktop-icons {
  position: absolute;
  top: 55px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  z-index: 5;
}

.icon {
  width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  cursor: pointer;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
  user-select: none;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.icon:hover { background: rgba(255, 255, 255, 0.2); }

.custom-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 5px;
  object-fit: contain;
}


@keyframes windowOpenAnim {
  0% { opacity: 0; transform: scale(0.7) translateY(40px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.window {
  position: absolute;
  width: 320px;
  height: 260px;
  min-width: 250px;
  min-height: 200px;
  background: var(--window-bg);
  backdrop-filter: blur(8px); 
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  color: var(--text-color);
  z-index: 10;
  resize: both;
  overflow: hidden; 
  transform-origin: center center;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.window.dragging { transition: none; }

.window.maximized {
  top: 35px !important;
  left: 0 !important;
  width: 100vw !important;
  height: calc(100vh - 83px) !important;
  border-radius: 0 !important;
  transform: none !important;
}

.window-header {
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.15);
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  user-select: none;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.window-controls { display: flex; gap: 6px; align-items: center; }

.control-btn {
  border: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
}

.close-btn { background: rgba(255, 95, 86, 0.8); }
.close-btn:hover { background: #ff5f56; }
.max-btn { background: rgba(40, 200, 64, 0.8); }
.max-btn:hover { background: #28c840; }

.window-content {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 2; 
}

textarea {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: var(--text-color);
  padding: 10px;
  resize: none;
  outline: none;
}

input[type="file"] {
  color: var(--text-color);
  background: rgba(0,0,0,0.1);
  padding: 10px;
  border-radius: 6px;
  border: 1px dashed rgba(255,255,255,0.4);
  cursor: pointer;
  width: 100%;
}

.theme-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}
.theme-btn:hover { background: rgba(255,255,255,0.3); }

#snap-preview {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  pointer-events: none;
  display: none;
  z-index: 999;
  transition: all 0.15s ease-out;
}

.calc-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  border-radius: 4px;
  padding: 10px;
  cursor: pointer;
  font-weight: bold;
}
.calc-btn:hover { background: rgba(255, 255, 255, 0.25); }
