* { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #root { width: 100%; height: 100%; overflow: hidden; font-family: 'Noto Sans', 'Segoe UI', sans-serif; }

/* Boot Screen */
.boot-screen {
  position: fixed; inset: 0; background: #000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; z-index: 99999; color: #fff;
}
.boot-logo { font-size: 72px; margin-bottom: 40px; animation: bootPulse 2s ease-in-out infinite; }
@keyframes bootPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.05); } }

.boot-dots { display: flex; gap: 8px; }
.boot-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #0078D4;
  animation: bootSpin 1.5s ease-in-out infinite;
}
.boot-dot:nth-child(1) { animation-delay: 0s; }
.boot-dot:nth-child(2) { animation-delay: 0.15s; }
.boot-dot:nth-child(3) { animation-delay: 0.3s; }
.boot-dot:nth-child(4) { animation-delay: 0.45s; }
.boot-dot:nth-child(5) { animation-delay: 0.6s; }
@keyframes bootSpin {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-12px); }
}

/* Lock Screen */
.lock-screen {
  position: fixed; inset: 0; z-index: 99998; cursor: pointer; user-select: none;
  background: linear-gradient(135deg, #0f2027 0%, #203a43 40%, #2c5364 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.5s, transform 0.5s;
}
.lock-screen.dismissing { opacity: 0; transform: translateY(-100%); }
.lock-time { font-size: 96px; font-weight: 300; color: #fff; letter-spacing: -2px; }
.lock-date { font-size: 20px; color: rgba(255,255,255,0.8); margin-top: 4px; font-weight: 300; }
.lock-hint { position: absolute; bottom: 60px; color: rgba(255,255,255,0.5); font-size: 14px; animation: lockHintPulse 2s ease-in-out infinite; }
@keyframes lockHintPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Desktop */
.desktop {
  width: 100%; height: 100%; position: relative; overflow: hidden; user-select: none;
}
.desktop-wallpaper {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1e3a5f 0%, #0a1628 20%, #0d2137 40%, #1a4a7a 60%, #0078D4 80%, #00a4ef 100%);
  transition: background 0.5s;
}
.desktop-wallpaper::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 50%, rgba(0,120,212,0.3) 0%, transparent 60%),
              radial-gradient(ellipse at 30% 70%, rgba(0,164,239,0.15) 0%, transparent 50%);
}

/* Desktop Icons */
.desktop-icons {
  position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column;
  flex-wrap: wrap; gap: 4px; max-height: calc(100% - 60px); align-content: flex-start;
}
.desktop-icon {
  width: 76px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center;
  gap: 4px; cursor: pointer; border: 1px solid transparent; border-radius: 2px; transition: background 0.1s;
}
.desktop-icon:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
.desktop-icon.selected { background: rgba(0,120,212,0.3); border-color: rgba(0,120,212,0.5); }
.desktop-icon-img { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.desktop-icon-label {
  font-size: 11px; color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  line-height: 1.2; word-wrap: break-word; max-width: 72px;
}

/* Taskbar */
.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: 40px;
  background: rgba(16,16,32,0.92); backdrop-filter: blur(20px);
  display: flex; align-items: center; z-index: 9000;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.start-btn {
  width: 48px; height: 40px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s; font-size: 16px;
}
.start-btn:hover { background: rgba(255,255,255,0.1); }
.start-btn.active { background: rgba(255,255,255,0.15); }

.search-bar {
  height: 30px; width: 220px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px; display: flex; align-items: center; padding: 0 10px; margin-left: 2px;
  cursor: text; color: rgba(255,255,255,0.5); font-size: 12px; gap: 8px;
}
.search-bar input {
  background: transparent; border: none; outline: none; color: #fff; font-size: 12px;
  font-family: inherit; width: 100%;
}
.search-bar input::placeholder { color: rgba(255,255,255,0.4); }

.taskbar-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s; color: rgba(255,255,255,0.7); font-size: 14px;
}
.taskbar-btn:hover { background: rgba(255,255,255,0.1); }

.taskbar-app-btn {
  width: 42px; height: 40px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s; font-size: 18px; position: relative;
}
.taskbar-app-btn:hover { background: rgba(255,255,255,0.1); }
.taskbar-app-btn.active { background: rgba(255,255,255,0.08); }
.taskbar-app-btn.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px; background: #0078D4; border-radius: 1px;
}

.system-tray {
  margin-left: auto; display: flex; align-items: center; height: 40px; padding-right: 4px;
}
.tray-icons { display: flex; align-items: center; gap: 2px; padding: 0 4px; }
.tray-icon {
  padding: 4px 6px; font-size: 12px; color: rgba(255,255,255,0.8); cursor: pointer;
  transition: background 0.15s; border-radius: 1px;
}
.tray-icon:hover { background: rgba(255,255,255,0.1); }
.clock-area {
  display: flex; flex-direction: column; align-items: flex-end; padding: 2px 12px;
  cursor: pointer; transition: background 0.15s; border-radius: 1px;
}
.clock-area:hover { background: rgba(255,255,255,0.1); }
.clock-time { font-size: 11px; color: #fff; line-height: 1.3; }
.clock-date { font-size: 11px; color: #fff; line-height: 1.3; }

.notif-btn {
  width: 8px; height: 40px; cursor: pointer; transition: background 0.15s;
  border-left: 1px solid rgba(255,255,255,0.05);
}
.notif-btn:hover { background: rgba(255,255,255,0.1); }

/* Start Menu */
.start-menu {
  position: fixed; bottom: 40px; left: 0; width: 560px; height: 500px;
  background: rgba(20,20,40,0.96); backdrop-filter: blur(20px);
  z-index: 9500; display: flex; flex-direction: column;
  border: 1px solid rgba(255,255,255,0.08);
  transform: translateY(10px); opacity: 0; transition: transform 0.2s, opacity 0.2s;
  pointer-events: none;
}
.start-menu.open { transform: translateY(0); opacity: 1; pointer-events: all; }

.start-menu-content { display: flex; flex: 1; overflow: hidden; }

.start-sidebar {
  width: 48px; background: rgba(0,0,0,0.2); display: flex; flex-direction: column;
  justify-content: flex-end; padding: 8px 0;
}
.start-sidebar-btn {
  width: 48px; height: 42px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,0.7); font-size: 18px; transition: background 0.15s;
}
.start-sidebar-btn:hover { background: rgba(255,255,255,0.1); }

.start-apps {
  width: 220px; padding: 8px 0; overflow-y: auto; border-right: 1px solid rgba(255,255,255,0.05);
}
.start-app-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; cursor: pointer;
  color: #fff; font-size: 13px; transition: background 0.1s;
}
.start-app-item:hover { background: rgba(255,255,255,0.08); }
.start-app-icon { font-size: 18px; width: 24px; text-align: center; }

.start-tiles {
  flex: 1; padding: 16px; overflow-y: auto;
}
.tiles-header { color: rgba(255,255,255,0.6); font-size: 12px; margin-bottom: 8px; padding-left: 2px; }
.tiles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 2px; transition: filter 0.15s, transform 0.1s; gap: 4px;
}
.tile:hover { filter: brightness(1.15); transform: scale(1.02); }
.tile-icon { font-size: 24px; }
.tile-label { font-size: 10px; color: #fff; font-weight: 500; }
.tile-wide { grid-column: span 2; aspect-ratio: 2/1; }

/* Windows */
.app-window {
  position: absolute; background: #fff; border-radius: 0; display: flex; flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
  min-width: 300px; min-height: 200px; overflow: hidden;
}
.app-window.inactive { box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

.window-titlebar {
  height: 30px; display: flex; align-items: center; padding-left: 10px;
  background: #fff; border-bottom: 1px solid #e5e5e5; flex-shrink: 0; cursor: default;
}
.window-titlebar.inactive { color: #999; }
.window-title { font-size: 12px; color: #333; flex: 1; display: flex; align-items: center; gap: 6px; }
.window-title-icon { font-size: 14px; }
.window-controls { display: flex; height: 30px; }
.window-ctrl-btn {
  width: 46px; height: 30px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.1s; font-size: 12px; color: #333; border: none;
  background: transparent; font-family: inherit;
}
.window-ctrl-btn:hover { background: #e5e5e5; }
.window-ctrl-btn.close:hover { background: #e81123; color: #fff; }

.window-body { flex: 1; overflow: auto; }

/* Context Menu */
.context-menu {
  position: fixed; background: rgba(32,32,48,0.96); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1); min-width: 200px; padding: 4px 0;
  z-index: 99000; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.context-menu-item {
  padding: 6px 24px; color: rgba(255,255,255,0.85); font-size: 12px; cursor: pointer;
  transition: background 0.1s; display: flex; align-items: center; gap: 8px;
}
.context-menu-item:hover { background: rgba(0,120,212,0.4); }
.context-menu-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0; }
.context-menu-sub { position: relative; }
.context-menu-sub::after { content: '▸'; margin-left: auto; font-size: 10px; }

/* Calendar Popup */
.calendar-popup {
  position: fixed; bottom: 44px; right: 4px; width: 300px;
  background: rgba(32,32,48,0.96); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1); z-index: 9100; padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); color: #fff;
}
.calendar-header { font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 12px; }
.calendar-day-name { color: rgba(255,255,255,0.4); font-size: 10px; padding: 4px; }
.calendar-day { padding: 6px; border-radius: 50%; cursor: pointer; transition: background 0.1s; }
.calendar-day:hover { background: rgba(255,255,255,0.1); }
.calendar-day.today { background: #0078D4; font-weight: 600; }
.calendar-day.empty { cursor: default; }

/* Search Results */
.search-results {
  position: fixed; bottom: 44px; left: 48px; width: 560px; max-height: 400px;
  background: rgba(32,32,48,0.96); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1); z-index: 9200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5); padding: 16px;
}

/* BSOD */
.bsod {
  position: fixed; inset: 0; background: #0078D4; z-index: 999999;
  display: flex; flex-direction: column; justify-content: center; padding: 10%;
  cursor: pointer; color: #fff;
}
.bsod-face { font-size: 120px; margin-bottom: 20px; }
.bsod-title { font-size: 28px; font-weight: 300; margin-bottom: 16px; }
.bsod-text { font-size: 14px; line-height: 1.6; opacity: 0.9; max-width: 600px; }
.bsod-qr { width: 80px; height: 80px; margin-top: 24px; background: #fff; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #0078D4; }

/* Notepad */
.notepad-menu { display: flex; background: #f0f0f0; border-bottom: 1px solid #ddd; padding: 0 4px; }
.notepad-menu-item { padding: 4px 10px; font-size: 12px; color: #333; cursor: pointer; }
.notepad-menu-item:hover { background: #e0e0e0; }
.notepad-textarea {
  width: 100%; height: 100%; border: none; outline: none; resize: none;
  font-family: 'Consolas', 'Courier New', monospace; font-size: 14px;
  padding: 4px 8px; line-height: 1.5;
}

/* Calculator */
.calc-display {
  background: #f2f2f2; padding: 8px 16px; text-align: right; min-height: 60px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.calc-expression { font-size: 13px; color: #888; min-height: 20px; }
.calc-value { font-size: 36px; font-weight: 300; color: #111; }
.calc-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: #e0e0e0; }
.calc-btn {
  padding: 16px; font-size: 16px; border: none; cursor: pointer;
  background: #fafafa; color: #333; font-family: inherit; transition: background 0.1s;
}
.calc-btn:hover { background: #e8e8e8; }
.calc-btn.operator { background: #f0f0f0; }
.calc-btn.operator:hover { background: #ddd; }
.calc-btn.equals { background: #0078D4; color: #fff; }
.calc-btn.equals:hover { background: #006cbd; }

/* File Explorer */
.explorer-sidebar { width: 200px; background: #f5f5f5; border-right: 1px solid #e0e0e0; padding: 8px; }
.explorer-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; cursor: pointer;
  font-size: 12px; color: #333; border-radius: 2px; transition: background 0.1s;
}
.explorer-item:hover { background: #e8e8e8; }
.explorer-item.active { background: #cde4f7; }
.explorer-content { flex: 1; padding: 8px; }
.explorer-file {
  display: inline-flex; flex-direction: column; align-items: center; width: 80px;
  padding: 8px; cursor: pointer; border-radius: 2px; transition: background 0.1s;
}
.explorer-file:hover { background: #e8e8f0; }
.explorer-file-icon { font-size: 32px; }
.explorer-file-name { font-size: 11px; color: #333; text-align: center; margin-top: 4px; word-break: break-all; }

/* Settings */
.settings-sidebar { width: 240px; background: #f3f3f3; padding: 16px 0; }
.settings-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 24px; cursor: pointer;
  font-size: 13px; color: #333; transition: background 0.1s;
}
.settings-item:hover { background: #e8e8e8; }
.settings-item.active { background: #ddd; border-left: 2px solid #0078D4; }
.settings-content { flex: 1; padding: 24px; }

/* Edge Browser */
.edge-addressbar {
  display: flex; align-items: center; background: #f0f0f0; padding: 6px 12px;
  border-bottom: 1px solid #ddd; gap: 8px;
}
.edge-url {
  flex: 1; background: #fff; border: 1px solid #ccc; border-radius: 16px;
  padding: 4px 12px; font-size: 12px; outline: none; font-family: inherit;
}
.edge-content { flex: 1; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }

/* Task Manager */
.taskmgr-header { display: flex; background: #f0f0f0; border-bottom: 1px solid #ddd; }
.taskmgr-col { padding: 6px 12px; font-size: 11px; font-weight: 600; color: #555; }
.taskmgr-row { display: flex; border-bottom: 1px solid #f0f0f0; }
.taskmgr-row:hover { background: #f5f5ff; }
.taskmgr-cell { padding: 5px 12px; font-size: 11px; color: #333; }

/* Power Menu */
.power-menu {
  position: fixed; background: rgba(32,32,48,0.96); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1); padding: 4px 0; z-index: 99500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.power-item {
  padding: 8px 24px; color: rgba(255,255,255,0.85); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; transition: background 0.1s;
}
.power-item:hover { background: rgba(255,255,255,0.1); }

/* Tooltip */
.tooltip {
  position: fixed; background: rgba(32,32,48,0.95); color: #fff; font-size: 11px;
  padding: 4px 8px; z-index: 99900; pointer-events: none; white-space: nowrap;
}

/* Maximize state */
.app-window.maximized {
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: calc(100% - 40px) !important;
  border-radius: 0;
}

/* Mobile warning */
.mobile-warning {
  display: none; position: fixed; inset: 0; background: #1a1a2e;
  z-index: 999999; color: #fff; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 32px;
}
@media (max-width: 768px) {
  .mobile-warning { display: flex; }
  .desktop { display: none; }
  .taskbar { display: none; }
  .start-menu { display: none; }
}