:root {
  
  --bg-dark: #0a0b10;
  --bg-darker: #050608;
  --accent-silver: #c0c5ce;
  --accent-violet: #6b5b95;
  --accent-blue: #4a6fa5;
  
  --text-primary: #f0f2f5;
  --text-secondary: #a0a5b0;
  
  
  --glass-bg: rgba(20, 22, 30, 0.4);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --glass-blur: blur(16px);
  
  
  --window-bg: rgba(15, 17, 25, 0.75);
  --panel-bg: rgba(20, 22, 30, 0.65);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
  
  
  --taskbar-height: 56px;
  
  
  --transition-fast: 0.15s ease-out;
  --transition-normal: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-slow: 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  
  
  --font-main: 'Inter', sans-serif;
}


body.moon-mode {
  --accent-violet: #5a759e;
  --glass-bg: rgba(10, 15, 25, 0.5);
  --window-bg: rgba(8, 12, 20, 0.85);
  --glass-border: rgba(150, 180, 255, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-darker);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}


.hidden { display: none !important; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 9999; }
.wallpaper-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center;
  z-index: -1;
  filter: brightness(0.7);
  transition: filter var(--transition-slow);
}
body.moon-mode .wallpaper-bg {
  filter: brightness(0.4) sepia(0.2) hue-rotate(180deg);
}


.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
}


#boot-screen {
  background-color: var(--bg-darker);
  z-index: 10000;
  transition: opacity 1s ease-in-out;
}
.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.boot-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  animation: pulseLogo 3s infinite alternate;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.2));
}
.boot-title {
  font-weight: 300;
  letter-spacing: 4px;
  font-size: 28px;
  margin-bottom: 40px;
  color: var(--accent-silver);
}
.boot-ring {
  width: 60px;
  height: 60px;
  border: 2px solid transparent;
  border-top-color: var(--accent-violet);
  border-right-color: var(--accent-silver);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
  margin-bottom: 24px;
}
.boot-status {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  height: 20px;
}
.boot-progress {
  width: 240px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.boot-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-silver));
  transition: width 0.3s ease;
}


#lock-screen {
  z-index: 9000;
  transition: opacity 0.8s ease-in-out, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
#lock-screen.fade-up {
  opacity: 0;
  transform: translateY(-50px);
  pointer-events: none;
}
.lock-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}
.lock-time {
  font-size: 96px;
  font-weight: 600;
  letter-spacing: -2px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
  margin-bottom: 8px;
}
.lock-date {
  font-size: 24px;
  font-weight: 300;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  margin-bottom: 48px;
}
.lock-moon {
  font-size: 32px;
  margin-bottom: 64px;
  color: var(--accent-silver);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.3));
}
.login-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  padding: 32px 48px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.user-avatar {
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 40px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.2);
}
.user-name {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 24px;
}
.btn-primary {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 10px 32px;
  border-radius: 20px;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-primary:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}


#desktop {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}
.desktop-icons {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 96px);
  grid-template-rows: repeat(auto-fill, 120px);
  grid-auto-flow: column;
  gap: 20px;
  align-content: start;
  justify-content: start;
  height: calc(100vh - var(--taskbar-height));
  position: relative;
  z-index: 10;
}
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 96px;
  height: 120px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.desktop-icon:hover {
  background: rgba(255,255,255,0.1);
}
.desktop-icon.selected {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
}
.icon-img {
  width: 64px;
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 48px;
  margin-bottom: 12px;
}
.icon-text {
  font-size: 13px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}


#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--taskbar-height);
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0;
  border-bottom: none;
  border-left: none;
  border-right: none;
  z-index: 1000;
}
.taskbar-left, .taskbar-center, .taskbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.taskbar-center {
  margin: 0 24px;
  flex: 1;
  justify-content: flex-start;
}
.taskbar-btn {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all var(--transition-fast);
  position: relative;
}
.taskbar-btn:hover {
  background: rgba(255,255,255,0.1);
}
.taskbar-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-silver);
  border-radius: 2px;
}
.taskbar-btn.open {
  background: rgba(255,255,255,0.05);
}
.taskbar-btn.open.active {
  background: rgba(255,255,255,0.15);
}
.taskbar-btn.open::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: transparent;
}
.taskbar-btn.open.active::after {
  background: var(--accent-silver);
}
.logo-btn {
  padding: 4px;
}
.taskbar-logo {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
}
.system-tray {
  display: flex;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.system-tray:hover {
  background: rgba(255,255,255,0.1);
}
.taskbar-time {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.taskbar-time:hover {
  background: rgba(255,255,255,0.1);
}
.taskbar-notifications {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 20px;
  transition: background var(--transition-fast);
}
.taskbar-notifications:hover {
  background: rgba(255,255,255,0.1);
}


#launcher {
  position: fixed;
  bottom: calc(var(--taskbar-height) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 500px;
  height: 600px;
  padding: 24px;
  border-radius: var(--radius-lg);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}
#launcher.show {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.launcher-search {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.launcher-search input {
  background: transparent;
  border: none;
  color: white;
  width: 100%;
  outline: none;
  font-family: inherit;
  font-size: 14px;
}
.launcher-section h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 8px;
}
.launcher-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}


#windows-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - var(--taskbar-height) - 24px);
  pointer-events: none;
  z-index: 20;
}
.app-window {
  position: absolute;
  background: var(--window-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: all;
  transition: transform 0.2s, opacity 0.2s, width 0.2s, height 0.2s, top 0.2s, left 0.2s;
  will-change: transform, width, height, top, left;
}
.app-window.dragging {
  transition: none;
  opacity: 0.9;
}
.app-window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
}
.app-window.minimized {
  opacity: 0;
  transform: scale(0.8) translateY(100px);
  pointer-events: none;
}
.window-titlebar {
  height: 40px;
  background: rgba(0,0,0,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  cursor: default;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.window-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}
.window-controls {
  display: flex;
  gap: 8px;
}
.win-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.win-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.win-btn.close:hover { background: #e81123; color: white; }
.window-content {
  flex: 1;
  position: relative;
  overflow: auto;
}


#quick-settings-panel {
  position: fixed;
  bottom: calc(var(--taskbar-height) + 24px);
  right: 16px;
  width: 320px;
  padding: 20px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: all var(--transition-normal);
}
#quick-settings-panel.show {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.quick-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.qs-toggle {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.qs-toggle.active {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}
.qs-toggle i { font-size: 20px; }
.qs-toggle span { font-size: 12px; }
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.styled-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
}
.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

#notifications-panel {
  position: fixed;
  bottom: calc(var(--taskbar-height) + 24px);
  right: 16px;
  width: 350px;
  height: 500px;
  display: flex;
  flex-direction: column;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transform: translateX(400px);
  transition: all var(--transition-normal);
}
#notifications-panel.show {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.panel-header h3 { font-size: 14px; font-weight: 500; }
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
}
.notifications-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.notification-item {
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
}
.notif-icon {
  font-size: 24px;
  color: var(--accent-silver);
}
.notif-content h4 { font-size: 13px; margin-bottom: 4px; }
.notif-content p { font-size: 12px; color: var(--text-secondary); }

#context-menu {
  position: fixed;
  width: 200px;
  padding: 8px 0;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}
#context-menu.show {
  opacity: 1;
  pointer-events: all;
}
.context-item {
  padding: 8px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.context-item:hover {
  background: rgba(255,255,255,0.1);
}
.context-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 4px 0;
}


@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulseLogo { 
  0% { filter: drop-shadow(0 0 10px rgba(255,255,255,0.1)); transform: scale(1); } 
  100% { filter: drop-shadow(0 0 30px rgba(180, 200, 255, 0.4)); transform: scale(1.05); } 
}


.iframe-app { width: 100%; height: 100%; border: none; background: #fff; }
.app-content { padding: 20px; color: var(--text-primary); }


::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }
