* { box-sizing:border-box; margin:0; padding:0 }
body { font-family:"Segoe UI",sans-serif; background:#000; overflow:hidden }

/* BOOT */
#boot { position:fixed; inset:0; background:radial-gradient(circle,#1a1a3a,#000); color:#9fa; display:flex; flex-direction:column; align-items:center; justify-content:center; transition: opacity 0.6s ease; }
#boot-logo { font-size:48px; margin-bottom:15px; animation:pulse 2s infinite }
#boot-text { width:60%; height:160px; font-size:14px; opacity:.8; white-space: pre-wrap; }
#progress { width:300px; height:6px; background:#222; margin-top:20px }
#progress-bar { height:100%; width:0; background:#7c5cff }
@keyframes pulse { 0%{opacity:.5} 50%{opacity:1} 100%{opacity:.5} }

/* LOGIN */
#login.hidden { display: none; }
#login.show { display: flex; }
#login { position:fixed; inset:0; background:linear-gradient(120deg,#1b1b3a,#000); align-items:center; justify-content:center; animation:fadeIn .8s ease; }
.login-box { background:rgba(255,255,255,.05); padding:30px; border-radius:12px; text-align:center; transition: opacity 0.8s ease; }
.login-box input { margin-top:10px; padding:10px; width:200px; background:#000; color:#fff; border:1px solid #444; }
.login-box button { margin-top:15px; padding:10px 20px; background:#7c5cff; border:none; color:#fff; }

/* DESKTOP */
#desktop.hidden { display: none; }
#desktop.show { display: block; }
#desktop { position:fixed; inset:0; background:url("wallpaper.jpg") center/cover no-repeat; animation:desktopFade .8s ease forwards; }

/* ICONS — STABLE VERSION */
#icons {
  position: absolute;
  top: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 84px); /* slightly bigger than original */
  gap: 20px;
}

.icon {
  color: #fff;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s, text-shadow 0.2s;
}

.icon:hover {
  transform: scale(1.1);
  text-shadow: 0 0 6px rgba(0,0,0,.7);
}

.icon span {
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

/* WINDOWS */
.window { position: absolute; background: #1e1e2e; border-radius: 6px; box-shadow: 0 20px 40px rgba(0,0,0,.5); overflow: hidden; font-family: "Segoe UI", sans-serif; }
.titlebar { height: 34px; background: linear-gradient(to right, #2a2a3d, #242437); display: flex; align-items: center; justify-content: space-between; padding: 0 8px; cursor: move; }
.titlebar .title { color: #fff; font-size: 14px; user-select: none; }
.window-buttons { display: flex; gap: 4px; }
.window-buttons button { width: 38px; height: 28px; border: none; background: transparent; color: #fff; font-size: 14px; cursor: pointer; border-radius: 2px; transition: background 0.2s; }
.window-buttons button:hover { background: rgba(255, 255, 255, 0.1); }
.window-buttons .win-close:hover { background: #ff5f57; color: #fff; }
.window-buttons .win-max:hover { background: #28c840; color: #fff; }

/* START MENU */
#start-menu { position:fixed; bottom:70px; left:20px; width:220px; background:#1e1e2e; border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.5); display:none; flex-direction:column; padding:10px; backdrop-filter:blur(10px); z-index:9999; }
#start-menu.show { display:flex; }
.menu-item { padding:10px 12px; cursor:pointer; border-radius:6px; display:flex; align-items:center; gap:10px; transition:background 0.2s; }
.menu-item:hover { background:rgba(124,92,255,.2); }
.menu-item#shutdown { margin-top:6px; border-top:1px solid rgba(255,255,255,.1); }

/* TASKBAR */
#taskbar { position:fixed; bottom:10px; left:50%; transform:translateX(-50%); width:90%; height:56px; background:rgba(30,30,40,.85); backdrop-filter:blur(20px); border-radius:14px; display:flex; justify-content:space-between; align-items:center; padding:0 16px; }
.task-icon { width:40px; height:40px; display:grid; place-items:center; background:rgba(255,255,255,.1); border-radius:10px; cursor:pointer; transition:all .2s; }
.task-icon:hover { background:rgba(124,92,255,.3); }
#task-left { display:flex; gap:10px }
#task-right { color:#fff; display:flex; gap:12px }

/* Animations */
@keyframes windowIn { from { transform:scale(.9); opacity:0 } to { transform:scale(1); opacity:1 } }
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
@keyframes desktopFade { from { opacity:0 } to { opacity:1 } }
/* Calculator */
.calc-display {
  width: 100%;
  height: 60px;
  font-size: 24px;
  text-align: right;
  margin-bottom: 10px;
  border-radius: 8px;
  padding: 5px;
  background:#f0f0f0;
  border:1px solid #ccc;
}

.calc-buttons {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
  height: calc(100% - 70px); /* dynamically fills window */
}

.calc-btn {
  padding:12px;
  font-size:18px;
  border-radius:6px;
  background:#7c5cff;
  color:white;
  border:none;
  cursor:pointer;
  transition:all 0.2s;
}
.calc-btn:hover { background:#5a3bcc; }

/* Weather */
.weather-container {
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  font-family:sans-serif;
  color:#fff;
  background: linear-gradient(135deg, #1b1b3a, #242437);
  border-radius:8px;
  padding:10px;
}

.weather-container h2 { color:#7c5cff; margin:5px 0; }
.weather-container .weather-emoji { font-size:48px; }
.weather-container .temp { font-size:28px; margin:5px 0; }
.weather-container p { margin:2px 0; opacity:.8; font-size:14px; }

/* Make content fill maximized window */
.window.maxed .content {
  width: 100%;
  height: calc(100% - 34px);
}
#term-output {
  font-family: monospace;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  background: #000;
  color: #0f0;
  padding: 10px;
  height: calc(100% - 30px);
  overflow-y: auto;
}

#term-input {
  font-family: monospace;
  font-size: 14px;
  background: #000;
  color: #0f0;
  border: none;
  outline: none;
  flex: 1;
  padding: 2px 4px;
}

/* LOGIN USER AVATAR */
.user-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 15px;
  border-radius: 50%;
  background: #7c5cff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 36px;
  font-weight: bold;
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.6);
}

.menu-item#shutdown {
  color: #7c5cff;
}

.menu-item#shutdown:hover {
  background: rgba(124, 92, 255, 0.2);
}

