/* Reset and base */
* {
  box-sizing: border-box;
  user-select: none;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Tahoma', Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #06121e 0%, #0e2743 100%);
  color: #fff;
  overflow: hidden;
}

/* Boot overlay */
#boot-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  color: #0f0;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  font-size: 1.2rem;
}

#progress-container {
  width: 70%;
  height: 16px;
  background: #222;
  border-radius: 8px;
  margin-top: 15px;
  overflow: hidden;
  box-shadow: 0 0 5px #0f0;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: #0f0;
  border-radius: 8px;
  transition: width 0.4s ease;
}

#bios-text {
  margin-top: 10px;
  font-family: 'Courier New', monospace;
}

/* Desktop */
#desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: none;
  background: url('https://cdn.pixabay.com/photo/2018/02/15/15/06/sky-3157163_1280.jpg') center center no-repeat;
  background-size: cover;
  overflow: hidden;
  user-select: none;
}

/* Desktop icons container */
#desktop-icons {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  width: 200px;
}

/* Icon style */
.icon {
  width: 72px;
  text-align: center;
  cursor: pointer;
  color: white;
  font-size: 0.8rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: transform 0.15s ease;
}

.icon:hover {
  transform: scale(1.1);
}

.icon .svg {
  width: 44px;
  height: 44px;
  margin: 0 auto 6px auto;
  filter: drop-shadow(0 0 1px #000);
}

/* Taskbar */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(180deg, #c0c0c0, #7a7a7a);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 2px #555;
  display: flex;
  align-items: center;
  padding: 0 6px;
  user-select: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.8rem;
  z-index: 999;
}

/* Start button */
#start-btn {
  background: linear-gradient(180deg, #e3e3e3, #a9a9a9);
  border: 1px solid #888;
  border-radius: 4px;
  padding: 3px 12px;
  cursor: pointer;
  font-weight: 700;
  color: #000;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: background 0.2s ease;
}

#start-btn:hover {
  background: linear-gradient(180deg, #f7f7f7, #b5b5b5);
}

#start-btn svg {
  fill: #000;
  width: 16px;
  height: 16px;
}

/* Start menu */
#start-menu {
  position: fixed;
  bottom: 36px;
  left: 6px;
  width: 180px;
  background: #e6e6e6;
  color: #000;
  border-radius: 6px;
  box-shadow: 2px 2px 12px rgba(0,0,0,0.5);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
  padding: 8px 10px;
  display: none;
  z-index: 1000;
}

#start-menu button {
  width: 100%;
  background: linear-gradient(180deg, #f9f9f9, #cccccc);
  border: 1px solid #888;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 6px;
  cursor: pointer;
  font-weight: 600;
  color: #000;
  transition: background 0.2s ease;
  text-align: left;
  user-select: none;
}

#start-menu button:hover {
  background: linear-gradient(180deg, #ffffff, #aaaaaa);
}

/* Show start menu */
#start-menu:not(.hidden) {
  display: block;
}

/* Task buttons */
#task-windows {
  display: flex;
  gap: 6px;
  margin-left: 12px;
}

.task-btn {
  background: linear-gradient(180deg, #d7d7d7, #8c8c8c);
  border: 1px solid #666;
  border-radius: 3px;
  padding: 3px 10px;
  cursor: pointer;
  font-weight: 600;
  color: #000;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: background 0.15s ease;
  text-transform: capitalize;
  white-space: nowrap;
}

.task-btn:hover,
.task-btn.active {
  background: linear-gradient(180deg, #f0f0f0, #a0a0a0);
  border-color: #444;
}

/* Windows container */
#windows {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

/* Window */
.window {
  position: absolute;
  width: 420px;
  height: 280px;
  background: #f0f0f0;
  border: 2px solid #555;
  border-radius: 8px;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.3);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  user-select: text;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Titlebar */
.titlebar {
  background: #01497c;
  color: white;
  height: 30px;
  padding: 4px 10px 4px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  font-weight: 700;
  font-size: 1rem;
  user-select: none;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom: 2px solid #01345c;
  box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3);
  transition: background 0.3s ease;
}

/* Titlebar per app variants */
.window.terminal .titlebar {
  background: #222;
  border-bottom-color: #111;
  color: #7fff7f;
  font-family: 'Courier New', Courier, monospace;
}

.window.paint .titlebar {
  background: #b04e00;
  border-bottom-color: #803600;
  font-family: 'Comic Sans MS', cursive, sans-serif;
}

.window.music .titlebar {
  background: #004e89;
  border-bottom-color: #00335f;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.window.browser .titlebar {
  background: #4a4a9e;
  border-bottom-color: #3a3a6e;
  font-family: 'Georgia', serif;
}

/* Title text */
.title {
  user-select: text;
}

/* Titlebar buttons */
.titlebar .btns {
  display: flex;
  gap: 6px;
}

.titlebar button {
  width: 22px;
  height: 22px;
  background: #fff;
  border: 1px solid #999;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  color: #333;
  user-select: none;
  transition: background 0.2s ease;
  padding: 0;
}

.titlebar button:hover {
  background: #ddd;
}

/* Window content */
.content {
  flex: 1;
  padding: 10px;
  background: white;
  overflow-y: auto;
  font-size: 0.9rem;
  color: #111;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Terminal style */
.window.terminal .content {
  background: #000;
  color: #7fff7f;
  font-family: 'Courier New', Courier, monospace;
  white-space: pre-wrap;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 1rem;
}

.window.terminal input#term-in {
  width: 100%;
  border: none;
  background: transparent;
  color: #7fff7f;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  outline: none;
  margin-top: 6px;
}

/* Paint app canvas placeholder */
.window.paint .content {
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  font-size: 1.1rem;
  color: #b04e00;
}

/* Music app placeholder */
.window.music .content {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #004e89;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.music-player {
  width: 100%;
  height: 50px;
  background: #004e89;
  border-radius: 6px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Browser placeholder */
.window.browser .content {
  font-family: Georgia, serif;
  color: #333;
  font-size: 1rem;
}

/* Scrollbar style */
.content::-webkit-scrollbar {
  width: 8px;
}

.content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.content::-webkit-scrollbar-thumb:hover {
  background: #555;
}
