/* ================================================================
   NEXUS OS — Desktop Environment Stylesheet
   Theme: Dark neon glassmorphism — old futuristic machine portal
   ================================================================ */

/* ================================================================
   TABLE OF CONTENTS
   ----------------------------------------------------------------
   1.  CSS Custom Properties (Design Tokens)
   2.  Base / Reset
   3.  Boot Screen
   4.  Lock Screen
   5.  Desktop Background
   6.  Desktop Icons
   7.  Window Chrome
   8.  Taskbar
   9.  System Tray
   10. Start Menu
   11. Context Menus
   12. Notification Center
   13. Volume Popup
   14. Search Overlay
   15. Workspace Switcher
   16. Dialog System
   17. Toast Notifications
   18. Scrollbars
   19. Selection & Focus
   20. Accessibility
   21. Print Styles
   ================================================================ */


/* ================================================================
   1. CSS CUSTOM PROPERTIES — Design Tokens
   ================================================================ */
:root {
  /* ---- Neon palette ---- */
  --nx-red:            #ff003c;
  --nx-red-light:      #ff2d6b;
  --nx-red-dim:        #cc0030;
  --nx-pink:           #ff4488;
  --nx-pink-light:     #ff6699;
  --nx-magenta:        #e6006e;
  --nx-crimson:        #b3002d;

  /* ---- Glass surfaces ---- */
  --nx-glass-bg:       rgba(10, 0, 0, 0.72);
  --nx-glass-bg-light: rgba(20, 5, 10, 0.55);
  --nx-glass-bg-heavy: rgba(5, 0, 0, 0.88);
  --nx-glass-border:   rgba(255, 0, 60, 0.28);
  --nx-glass-border-hover: rgba(255, 0, 60, 0.55);
  --nx-glass-border-focus: rgba(255, 45, 107, 0.75);

  /* ---- Neons / glows ---- */
  --nx-glow-sm:        0 0 6px rgba(255, 0, 60, 0.35);
  --nx-glow-md:        0 0 14px rgba(255, 0, 60, 0.4), 0 0 28px rgba(255, 0, 60, 0.15);
  --nx-glow-lg:        0 0 20px rgba(255, 0, 60, 0.5), 0 0 60px rgba(255, 0, 60, 0.2);
  --nx-glow-xl:        0 0 30px rgba(255, 0, 60, 0.6), 0 0 80px rgba(255, 0, 60, 0.25), 0 0 120px rgba(255, 0, 60, 0.1);
  --nx-glow-text:      0 0 8px rgba(255, 0, 60, 0.6), 0 0 20px rgba(255, 0, 60, 0.3);
  --nx-glow-inset:     inset 0 0 20px rgba(255, 0, 60, 0.08);

  /* ---- Blur ---- */
  --nx-blur:           blur(20px);
  --nx-blur-heavy:     blur(40px);
  --nx-blur-light:     blur(10px);

  /* ---- Typography ---- */
  --nx-font-mono:      'Courier New', 'Consolas', 'Liberation Mono', monospace;
  --nx-font-sans:      'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --nx-font-display:   'Courier New', monospace;
  --nx-fs-xs:          0.6875rem;   /* 11px */
  --nx-fs-sm:          0.75rem;     /* 12px */
  --nx-fs-base:        0.8125rem;   /* 13px */
  --nx-fs-md:          0.875rem;    /* 14px */
  --nx-fs-lg:          1rem;        /* 16px */
  --nx-fs-xl:          1.25rem;     /* 20px */
  --nx-fs-2xl:         1.5rem;      /* 24px */
  --nx-fs-3xl:         2rem;        /* 32px */
  --nx-fs-4xl:         3rem;        /* 48px */
  --nx-fs-clock:       5rem;        /* 80px */

  /* ---- Spacing ---- */
  --nx-sp-1:   4px;
  --nx-sp-2:   8px;
  --nx-sp-3:   12px;
  --nx-sp-4:   16px;
  --nx-sp-5:   20px;
  --nx-sp-6:   24px;
  --nx-sp-8:   32px;
  --nx-sp-10:  40px;
  --nx-sp-12:  48px;
  --nx-sp-16:  64px;

  /* ---- Radii ---- */
  --nx-radius-sm:  4px;
  --nx-radius-md:  8px;
  --nx-radius-lg:  12px;
  --nx-radius-xl:  16px;
  --nx-radius-pill: 999px;

  /* ---- Z-index layers ---- */
  --nx-z-desktop:    1;
  --nx-z-window:     100;
  --nx-z-window-focus: 200;
  --nx-z-taskbar:    500;
  --nx-z-start:      600;
  --nx-z-context:    700;
  --nx-z-notif:      800;
  --nx-z-search:     900;
  --nx-z-dialog:     1000;
  --nx-z-toast:      1100;
  --nx-z-workspace:  550;
  --nx-z-boot:       9999;
  --nx-z-lock:       9998;

  /* ---- Timing ---- */
  --nx-ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --nx-ease-out:     cubic-bezier(0, 0, 0.2, 1);
  --nx-ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --nx-ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --nx-dur-fast:     150ms;
  --nx-dur-normal:   250ms;
  --nx-dur-slow:     400ms;
  --nx-dur-xslow:    600ms;

  /* ---- Taskbar height ---- */
  --nx-taskbar-h:    48px;

  /* ---- Window controls ---- */
  --nx-win-btn-size: 14px;
  --nx-win-titlebar-h: 34px;
}


/* ================================================================
   2. BASE / RESET
   ================================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--nx-font-sans);
  font-size: var(--nx-fs-base);
  color: #e0d0d5;
  background: #050000;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  cursor: default;
}

body.nexus-body {
  position: relative;
}

a { color: var(--nx-red-light); text-decoration: none; }
a:hover { color: var(--nx-pink); text-shadow: var(--nx-glow-text); }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* Glass panel base class */
.glass-panel {
  background: var(--nx-glass-bg);
  backdrop-filter: var(--nx-blur);
  -webkit-backdrop-filter: var(--nx-blur);
  border: 1px solid var(--nx-glass-border);
  border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-glow-md), var(--nx-glow-inset);
}

/* Glass input base class */
.glass-input {
  background: rgba(10, 0, 0, 0.5);
  border: 1px solid var(--nx-glass-border);
  border-radius: var(--nx-radius-md);
  padding: var(--nx-sp-2) var(--nx-sp-3);
  color: #e0d0d5;
  transition: border-color var(--nx-dur-fast) var(--nx-ease),
              box-shadow var(--nx-dur-fast) var(--nx-ease);
}

.glass-input:focus {
  border-color: var(--nx-glass-border-focus);
  box-shadow: var(--nx-glow-sm);
}

.glass-input::placeholder {
  color: rgba(224, 208, 213, 0.35);
}

/* Glass button base class */
.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nx-sp-1);
  padding: var(--nx-sp-1) var(--nx-sp-3);
  background: rgba(255, 0, 60, 0.08);
  border: 1px solid rgba(255, 0, 60, 0.2);
  border-radius: var(--nx-radius-md);
  color: #e0d0d5;
  font-size: var(--nx-fs-sm);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  white-space: nowrap;
}

.glass-btn:hover {
  background: rgba(255, 0, 60, 0.18);
  border-color: var(--nx-glass-border-hover);
  box-shadow: var(--nx-glow-sm);
  color: #fff;
}

.glass-btn:active {
  transform: scale(0.96);
}

.glass-btn.active {
  background: rgba(255, 0, 60, 0.25);
  border-color: var(--nx-red);
  box-shadow: var(--nx-glow-sm);
}


/* ================================================================
   3. BOOT SCREEN
   ================================================================ */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: var(--nx-z-boot);
  background: #020000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s var(--nx-ease);
}

.boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Scanlines overlay */
.boot-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  animation: scanlines 8s linear infinite;
  opacity: 0.6;
}

/* CRT curvature overlay */
.boot-crt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

/* BIOS text area */
.boot-bios {
  position: relative;
  z-index: 1;
  font-family: var(--nx-font-mono);
  font-size: var(--nx-fs-sm);
  color: var(--nx-red);
  text-shadow: var(--nx-glow-text);
  max-width: 600px;
  width: 90%;
  text-align: left;
  padding: var(--nx-sp-4);
  animation: bootFlicker 3s ease-in-out infinite;
}

.bios-line {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--nx-ease), transform 0.3s var(--nx-ease);
  line-height: 1.8;
  white-space: pre;
}

.bios-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.bios-line .ok {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

/* NEXUS Logo */
.boot-logo {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s var(--nx-ease), transform 0.8s var(--nx-ease-bounce);
  margin-bottom: var(--nx-sp-8);
}

.boot-logo.visible {
  opacity: 1;
  transform: scale(1);
}

.nexus-logo-svg {
  width: 320px;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(255, 0, 60, 0.6));
  animation: plasmaGlow 3s ease-in-out infinite;
}

/* Progress bar */
.boot-progress {
  position: relative;
  z-index: 1;
  width: 300px;
  height: 3px;
  background: rgba(255, 0, 60, 0.1);
  border-radius: var(--nx-radius-pill);
  overflow: hidden;
  margin-top: var(--nx-sp-6);
  border: 1px solid rgba(255, 0, 60, 0.15);
}

.boot-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--nx-red), var(--nx-pink), var(--nx-red));
  background-size: 200% 100%;
  border-radius: var(--nx-radius-pill);
  box-shadow: var(--nx-glow-md);
  transition: width 1.5s var(--nx-ease);
  animation: liquidLight 2s linear infinite;
}

.boot-progress-bar.filling {
  width: 100%;
}


/* ================================================================
   4. LOCK SCREEN
   ================================================================ */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: var(--nx-z-lock);
  background: #030000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity var(--nx-dur-xslow) var(--nx-ease),
              transform var(--nx-dur-xslow) var(--nx-ease);
}

.lock-screen.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

/* Grid background for lock screen */
.lock-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 0, 60, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 60, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: float 20s ease-in-out infinite;
}

/* Particles container */
.lock-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.lock-particles .particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--nx-red);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--nx-red);
  animation: particleFloat var(--duration, 12s) linear infinite;
  opacity: 0.5;
}

/* Lock card */
.lock-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--nx-sp-4);
  padding: var(--nx-sp-10) var(--nx-sp-12);
  min-width: 360px;
  animation: scaleIn 0.5s var(--nx-ease-bounce);
}

/* Avatar */
.lock-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  animation: pulse 3s ease-in-out infinite;
}

.lock-avatar svg {
  width: 100%;
  height: 100%;
}

/* Username */
.lock-username {
  font-family: var(--nx-font-display);
  font-size: var(--nx-fs-lg);
  letter-spacing: 4px;
  color: var(--nx-red-light);
  text-shadow: var(--nx-glow-text);
  text-transform: uppercase;
}

/* Clock on lock screen */
.lock-clock {
  text-align: center;
}

.lock-time {
  font-family: var(--nx-font-display);
  font-size: var(--nx-fs-clock);
  font-weight: 700;
  color: #fff;
  text-shadow: var(--nx-glow-lg);
  letter-spacing: 4px;
  line-height: 1;
}

.lock-date {
  font-size: var(--nx-fs-md);
  color: rgba(224, 208, 213, 0.6);
  margin-top: var(--nx-sp-2);
}

/* Lock input */
.lock-input-group {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-2);
  width: 100%;
  max-width: 280px;
}

.lock-input {
  flex: 1;
  padding: var(--nx-sp-3) var(--nx-sp-4);
  text-align: center;
  font-family: var(--nx-font-mono);
  letter-spacing: 2px;
}

.lock-unlock-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  flex-shrink: 0;
}

.lock-hint {
  font-size: var(--nx-fs-xs);
  color: rgba(224, 208, 213, 0.3);
  letter-spacing: 1px;
}

/* Glitch text effect for clock */
.glitch-text {
  position: relative;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text, "");
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.glitch-text:hover::before {
  animation: glitch 0.3s ease-in-out;
  color: var(--nx-red);
  opacity: 0.8;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  transform: translate(-2px, 1px);
}

.glitch-text:hover::after {
  animation: glitch 0.3s ease-in-out reverse;
  color: var(--nx-pink);
  opacity: 0.8;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  transform: translate(2px, -1px);
}


/* ================================================================
   5. DESKTOP BACKGROUND
   ================================================================ */
.desktop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #050000;
}

.desktop-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Grid pattern */
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 0, 60, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 60, 0.035) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: float 30s ease-in-out infinite;
}

/* Floating particles */
.bg-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.bg-particles .bg-particle {
  position: absolute;
  border-radius: 50%;
  background: var(--nx-red);
  box-shadow: 0 0 6px var(--nx-red), 0 0 12px rgba(255, 0, 60, 0.3);
  animation: particleFloat var(--duration, 15s) linear infinite;
  opacity: 0.3;
}

/* Vignette overlay */
.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.5) 100%
  );
  pointer-events: none;
}


/* ================================================================
   6. DESKTOP ICONS
   ================================================================ */
.desktop-icons {
  position: absolute;
  top: var(--nx-sp-4);
  left: var(--nx-sp-4);
  z-index: var(--nx-z-desktop);
  display: grid;
  grid-template-columns: repeat(auto-fill, 80px);
  grid-auto-rows: 90px;
  gap: var(--nx-sp-2);
  max-height: calc(100vh - var(--nx-taskbar-h) - var(--nx-sp-8));
  overflow-y: auto;
  padding: var(--nx-sp-2);
  align-content: start;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--nx-sp-1);
  width: 80px;
  height: 86px;
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  padding: var(--nx-sp-2);
  text-align: center;
}

.desktop-icon:hover {
  background: rgba(255, 0, 60, 0.08);
  box-shadow: var(--nx-glow-sm);
}

.desktop-icon:active {
  transform: scale(0.95);
}

.desktop-icon.selected {
  background: rgba(255, 0, 60, 0.15);
  border: 1px solid rgba(255, 0, 60, 0.3);
  box-shadow: var(--nx-glow-sm);
}

.desktop-icon-img {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nx-red-light);
  filter: drop-shadow(0 0 4px rgba(255, 0, 60, 0.4));
  transition: filter var(--nx-dur-fast) var(--nx-ease);
}

.desktop-icon:hover .desktop-icon-img {
  filter: drop-shadow(0 0 8px rgba(255, 0, 60, 0.7));
}

.desktop-icon-img svg {
  width: 100%;
  height: 100%;
}

.desktop-icon-label {
  font-size: var(--nx-fs-xs);
  color: #e0d0d5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ================================================================
   7. WINDOW CHROME
   ================================================================ */

/* Window container (holds all windows) */
.window-container {
  position: absolute;
  inset: 0;
  bottom: var(--nx-taskbar-h);
  z-index: var(--nx-z-window);
  pointer-events: none;
}

.window-container > * {
  pointer-events: auto;
}

/* Individual window */
.nx-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--nx-glass-bg);
  backdrop-filter: var(--nx-blur);
  -webkit-backdrop-filter: var(--nx-blur);
  border: 1px solid var(--nx-glass-border);
  border-radius: var(--nx-radius-lg);
  box-shadow: var(--nx-glow-md), var(--nx-glow-inset),
              0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  min-width: 320px;
  min-height: 200px;
  transition: box-shadow var(--nx-dur-fast) var(--nx-ease);
  animation: scaleIn 0.25s var(--nx-ease-bounce);
}

/* Focused window */
.nx-window.focused {
  z-index: var(--nx-z-window-focus);
  border-color: var(--nx-glass-border-hover);
  box-shadow: var(--nx-glow-lg), var(--nx-glow-inset),
              0 12px 48px rgba(0, 0, 0, 0.6);
}

/* Window closing */
.nx-window.closing {
  animation: windowClose 0.2s var(--nx-ease-in) forwards;
}

/* Window minimizing */
.nx-window.minimizing {
  animation: windowMinimize 0.3s var(--nx-ease) forwards;
}

/* Window maximizing */
.nx-window.maximizing {
  animation: windowMaximize 0.3s var(--nx-ease) forwards;
}

/* Window restoring */
.nx-window.restoring {
  animation: windowRestore 0.3s var(--nx-ease) forwards;
}

/* Maximized state */
.nx-window.maximized {
  border-radius: 0;
  border: none;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100vh - var(--nx-taskbar-h)) !important;
}

/* Snapped windows */
.nx-window.snap-left {
  top: 0 !important;
  left: 0 !important;
  width: 50% !important;
  height: calc(100vh - var(--nx-taskbar-h)) !important;
  border-radius: 0;
  border-right: 1px solid var(--nx-glass-border);
}

.nx-window.snap-right {
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  width: 50% !important;
  height: calc(100vh - var(--nx-taskbar-h)) !important;
  border-radius: 0;
  border-left: 1px solid var(--nx-glass-border);
}

/* Title bar */
.nx-window-titlebar {
  display: flex;
  align-items: center;
  height: var(--nx-win-titlebar-h);
  padding: 0 var(--nx-sp-3);
  background: rgba(10, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 0, 60, 0.1);
  cursor: default;
  flex-shrink: 0;
  gap: var(--nx-sp-2);
  user-select: none;
}

.nx-window.focused .nx-window-titlebar {
  background: rgba(20, 0, 5, 0.6);
  border-bottom-color: rgba(255, 0, 60, 0.2);
}

/* Window icon */
.nx-window-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--nx-red-light);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nx-window.focused .nx-window-icon {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(255, 0, 60, 0.5));
}

/* Window title text */
.nx-window-title {
  flex: 1;
  font-size: var(--nx-fs-sm);
  color: rgba(224, 208, 213, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.nx-window.focused .nx-window-title {
  color: #e0d0d5;
  text-shadow: 0 0 8px rgba(255, 0, 60, 0.2);
}

/* Window control buttons */
.nx-window-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: var(--nx-sp-2);
}

.nx-win-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  color: rgba(224, 208, 213, 0.5);
  background: transparent;
  border: none;
}

.nx-win-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e0d0d5;
}

.nx-win-btn svg {
  width: 12px;
  height: 12px;
}

/* Minimize button */
.nx-win-btn-minimize:hover {
  background: rgba(255, 180, 0, 0.15);
  color: #ffb400;
}

/* Maximize button */
.nx-win-btn-maximize:hover {
  background: rgba(0, 255, 136, 0.12);
  color: #00ff88;
}

/* Close button — neon red X */
.nx-win-btn-close:hover {
  background: rgba(255, 0, 60, 0.3);
  color: var(--nx-red);
  box-shadow: 0 0 8px rgba(255, 0, 60, 0.4);
}

/* Window body / content area */
.nx-window-body {
  flex: 1;
  overflow: auto;
  padding: var(--nx-sp-3);
  position: relative;
}

/* Resize handles */
.nx-resize-handle {
  position: absolute;
  z-index: 10;
}

.nx-resize-n {
  top: -3px; left: 8px; right: 8px; height: 6px;
  cursor: n-resize;
}
.nx-resize-s {
  bottom: -3px; left: 8px; right: 8px; height: 6px;
  cursor: s-resize;
}
.nx-resize-e {
  right: -3px; top: 8px; bottom: 8px; width: 6px;
  cursor: e-resize;
}
.nx-resize-w {
  left: -3px; top: 8px; bottom: 8px; width: 6px;
  cursor: w-resize;
}
.nx-resize-ne {
  top: -3px; right: -3px; width: 12px; height: 12px;
  cursor: ne-resize;
}
.nx-resize-nw {
  top: -3px; left: -3px; width: 12px; height: 12px;
  cursor: nw-resize;
}
.nx-resize-se {
  bottom: -3px; right: -3px; width: 12px; height: 12px;
  cursor: se-resize;
}
.nx-resize-sw {
  bottom: -3px; left: -3px; width: 12px; height: 12px;
  cursor: sw-resize;
}

/* Resize handle visual indicator (only on hover) */
.nx-resize-handle:hover {
  background: rgba(255, 0, 60, 0.08);
}


/* ================================================================
   8. TASKBAR
   ================================================================ */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nx-taskbar-h);
  z-index: var(--nx-z-taskbar);
  display: flex;
  align-items: center;
  padding: 0 var(--nx-sp-2);
  gap: var(--nx-sp-1);
  background: rgba(8, 0, 2, 0.82);
  backdrop-filter: var(--nx-blur-heavy);
  -webkit-backdrop-filter: var(--nx-blur-heavy);
  border-top: 1px solid rgba(255, 0, 60, 0.2);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5),
              0 -1px 0 rgba(255, 0, 60, 0.1);
}

/* Start button */
.taskbar-start {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  flex-shrink: 0;
  color: var(--nx-red);
  background: transparent;
  border: none;
}

.taskbar-start:hover {
  background: rgba(255, 0, 60, 0.12);
  box-shadow: var(--nx-glow-sm);
}

.taskbar-start:active {
  transform: scale(0.92);
}

.taskbar-start.active {
  background: rgba(255, 0, 60, 0.2);
  box-shadow: var(--nx-glow-md);
}

.taskbar-start svg {
  filter: drop-shadow(0 0 4px rgba(255, 0, 60, 0.5));
  transition: filter var(--nx-dur-fast) var(--nx-ease);
}

.taskbar-start:hover svg {
  filter: drop-shadow(0 0 8px rgba(255, 0, 60, 0.8));
}

/* Search button in taskbar */
.taskbar-search-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  flex-shrink: 0;
  color: rgba(224, 208, 213, 0.5);
}

.taskbar-search-btn:hover {
  background: rgba(255, 0, 60, 0.1);
  color: #e0d0d5;
  box-shadow: var(--nx-glow-sm);
}

/* Taskbar apps area */
.taskbar-apps {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  height: 100%;
  padding: 0 var(--nx-sp-1);
  scrollbar-width: none;
}

.taskbar-apps::-webkit-scrollbar { display: none; }

/* Individual taskbar app button */
.taskbar-app-btn {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-1);
  height: 36px;
  padding: 0 var(--nx-sp-3);
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  flex-shrink: 0;
  color: rgba(224, 208, 213, 0.6);
  background: transparent;
  border: none;
  position: relative;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
}

.taskbar-app-btn:hover {
  background: rgba(255, 0, 60, 0.1);
  color: #e0d0d5;
}

.taskbar-app-btn.active {
  background: rgba(255, 0, 60, 0.15);
  color: #fff;
}

/* Active window indicator line */
.taskbar-app-btn::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--nx-red);
  border-radius: 1px;
  transition: width var(--nx-dur-fast) var(--nx-ease);
  box-shadow: 0 0 4px var(--nx-red);
}

.taskbar-app-btn.has-window::after {
  width: 12px;
}

.taskbar-app-btn.active::after {
  width: 20px;
}

.taskbar-app-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.taskbar-app-icon svg {
  width: 100%;
  height: 100%;
}

.taskbar-app-label {
  font-size: var(--nx-fs-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Taskbar pin indicator */
.taskbar-app-btn.pinned {
  opacity: 0.8;
}

.taskbar-app-btn.pinned::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--nx-red-dim);
  opacity: 0.5;
}


/* ================================================================
   9. SYSTEM TRAY
   ================================================================ */
.system-tray {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-1);
  flex-shrink: 0;
  margin-left: auto;
  padding-left: var(--nx-sp-2);
  border-left: 1px solid rgba(255, 0, 60, 0.1);
}

.tray-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  color: rgba(224, 208, 213, 0.55);
  position: relative;
  background: transparent;
  border: none;
}

.tray-btn:hover {
  background: rgba(255, 0, 60, 0.1);
  color: #e0d0d5;
  box-shadow: var(--nx-glow-sm);
}

.tray-btn svg {
  transition: filter var(--nx-dur-fast) var(--nx-ease);
}

.tray-btn:hover svg {
  filter: drop-shadow(0 0 3px rgba(255, 0, 60, 0.4));
}

/* Notification badge */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  background: var(--nx-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--nx-radius-pill);
  box-shadow: 0 0 6px rgba(255, 0, 60, 0.5);
  line-height: 1;
}

/* Clock */
.tray-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 var(--nx-sp-3);
  border-radius: var(--nx-radius-sm);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  line-height: 1.2;
  min-width: 60px;
  background: transparent;
  border: none;
  color: inherit;
}

.tray-clock:hover {
  background: rgba(255, 0, 60, 0.08);
}

.clock-time {
  font-size: var(--nx-fs-sm);
  font-weight: 600;
  color: #e0d0d5;
  font-variant-numeric: tabular-nums;
}

.clock-date {
  font-size: var(--nx-fs-xs);
  color: rgba(224, 208, 213, 0.5);
}

/* Show desktop button */
.tray-show-desktop {
  width: 6px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-left: 1px solid rgba(255, 0, 60, 0.15);
  transition: all var(--nx-dur-fast) var(--nx-ease);
  flex-shrink: 0;
  background: transparent;
  border-top: none;
  border-bottom: none;
  border-right: none;
}

.tray-show-desktop:hover {
  border-left-color: var(--nx-red);
  background: rgba(255, 0, 60, 0.05);
}

.show-desktop-line {
  width: 2px;
  height: 20px;
  background: rgba(255, 0, 60, 0.15);
  border-radius: 1px;
  transition: background var(--nx-dur-fast) var(--nx-ease);
}

.tray-show-desktop:hover .show-desktop-line {
  background: var(--nx-red);
  box-shadow: 0 0 6px rgba(255, 0, 60, 0.5);
}


/* ================================================================
   10. START MENU
   ================================================================ */
.start-menu {
  position: fixed;
  bottom: calc(var(--nx-taskbar-h) + 8px);
  left: 8px;
  width: min(520px, calc(100vw - 16px));
  max-height: calc(100vh - var(--nx-taskbar-h) - 24px);
  z-index: var(--nx-z-start);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInUp 0.25s var(--nx-ease-bounce);
}

.start-menu.closing {
  animation: slideOutDown 0.2s var(--nx-ease-in) forwards;
}

.start-menu-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Search bar inside start menu */
.start-search {
  position: relative;
  padding: var(--nx-sp-3) var(--nx-sp-4);
  flex-shrink: 0;
}

.start-search-icon {
  position: absolute;
  left: calc(var(--nx-sp-4) + 10px);
  top: 50%;
  transform: translateY(-50%);
  color: rgba(224, 208, 213, 0.3);
  pointer-events: none;
}

.start-search-input {
  width: 100%;
  padding: var(--nx-sp-3) var(--nx-sp-4) var(--nx-sp-3) 38px;
  font-size: var(--nx-fs-md);
  border-radius: var(--nx-radius-md);
}

/* Pinned section */
.start-section {
  padding: 0 var(--nx-sp-4);
  flex-shrink: 0;
}

.start-section-title {
  font-size: var(--nx-fs-xs);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(224, 208, 213, 0.4);
  margin-bottom: var(--nx-sp-2);
  padding-left: var(--nx-sp-1);
}

.start-pinned-row {
  display: flex;
  gap: var(--nx-sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--nx-sp-3);
}

/* Start menu app tile */
.start-app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--nx-sp-1);
  width: 68px;
  height: 68px;
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  padding: var(--nx-sp-1);
  text-align: center;
}

.start-app-tile:hover {
  background: rgba(255, 0, 60, 0.12);
  box-shadow: var(--nx-glow-sm);
  transform: translateY(-2px);
}

.start-app-tile:active {
  transform: scale(0.95);
}

.start-app-tile-icon {
  width: 28px;
  height: 28px;
  color: var(--nx-red-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-app-tile-icon svg {
  width: 100%;
  height: 100%;
}

.start-app-tile-label {
  font-size: 10px;
  color: rgba(224, 208, 213, 0.7);
  line-height: 1.1;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.start-app-tile:hover .start-app-tile-label {
  color: #fff;
}

/* Scrollable categories */
.start-categories {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--nx-sp-2) var(--nx-sp-4) var(--nx-sp-4);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 0, 60, 0.3) transparent;
}

/* Category section */
.start-category {
  margin-bottom: var(--nx-sp-4);
}

.start-category-header {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-2);
  padding: var(--nx-sp-2) 0;
  margin-bottom: var(--nx-sp-2);
  border-bottom: 1px solid rgba(255, 0, 60, 0.1);
  font-size: var(--nx-fs-sm);
  color: var(--nx-red-light);
  text-shadow: 0 0 8px rgba(255, 0, 60, 0.2);
  letter-spacing: 1px;
  font-weight: 600;
}

.start-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 68px);
  gap: var(--nx-sp-1);
}

/* Start menu footer */
.start-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nx-sp-3) var(--nx-sp-4);
  border-top: 1px solid rgba(255, 0, 60, 0.1);
  flex-shrink: 0;
  background: rgba(5, 0, 0, 0.3);
}

.start-user {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-2);
  color: rgba(224, 208, 213, 0.6);
  font-size: var(--nx-fs-sm);
}

.start-power {
  display: flex;
  gap: var(--nx-sp-1);
}

.start-power-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  color: rgba(224, 208, 213, 0.5);
  background: transparent;
  border: none;
}

.start-power-btn:hover {
  background: rgba(255, 0, 60, 0.1);
  color: #e0d0d5;
}

.start-power-shutdown:hover {
  background: rgba(255, 0, 60, 0.25);
  color: var(--nx-red);
  box-shadow: var(--nx-glow-sm);
}


/* ================================================================
   11. CONTEXT MENUS
   ================================================================ */
.context-menu {
  position: fixed;
  z-index: var(--nx-z-context);
  min-width: 200px;
  max-width: 280px;
  padding: var(--nx-sp-1) 0;
  animation: scaleIn 0.15s var(--nx-ease-bounce);
  transform-origin: top left;
}

.context-menu.closing {
  animation: fadeOut 0.1s var(--nx-ease) forwards;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-3);
  padding: var(--nx-sp-2) var(--nx-sp-4);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  font-size: var(--nx-fs-sm);
  color: rgba(224, 208, 213, 0.75);
  position: relative;
}

.context-menu-item:hover {
  background: rgba(255, 0, 60, 0.12);
  color: #fff;
  padding-left: calc(var(--nx-sp-4) + 4px);
}

.context-menu-item:hover::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--nx-red);
  border-radius: 1px;
  box-shadow: 0 0 4px var(--nx-red);
}

.context-menu-item svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.context-menu-item:hover svg {
  opacity: 1;
  color: var(--nx-red-light);
}

.context-divider {
  height: 1px;
  background: rgba(255, 0, 60, 0.1);
  margin: var(--nx-sp-1) var(--nx-sp-3);
}


/* ================================================================
   12. NOTIFICATION CENTER
   ================================================================ */
.notification-center {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--nx-taskbar-h);
  width: min(380px, 90vw);
  z-index: var(--nx-z-notif);
  display: flex;
  flex-direction: column;
  border-radius: var(--nx-radius-lg) 0 0 var(--nx-radius-lg);
  border-right: none;
  animation: slideInRight 0.3s var(--nx-ease);
}

.notification-center.closing {
  animation: slideOutRight 0.25s var(--nx-ease) forwards;
}

/* Notification header */
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nx-sp-4) var(--nx-sp-4) var(--nx-sp-2);
  flex-shrink: 0;
}

.notif-title {
  font-size: var(--nx-fs-lg);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 0, 60, 0.2);
}

.notif-clear-btn {
  font-size: var(--nx-fs-xs);
  padding: var(--nx-sp-1) var(--nx-sp-2);
}

/* Quick action buttons */
.notif-quick-actions {
  display: flex;
  gap: var(--nx-sp-2);
  padding: var(--nx-sp-2) var(--nx-sp-4) var(--nx-sp-3);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 0, 60, 0.1);
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--nx-sp-2) var(--nx-sp-3);
  min-width: 56px;
  font-size: 10px;
}

/* Notification list */
.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--nx-sp-3) var(--nx-sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--nx-sp-2);
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--nx-sp-3);
  padding: var(--nx-sp-10) 0;
  color: rgba(224, 208, 213, 0.3);
  font-size: var(--nx-fs-sm);
}

/* Notification card */
.notif-card {
  padding: var(--nx-sp-3);
  background: rgba(255, 0, 60, 0.04);
  border: 1px solid rgba(255, 0, 60, 0.1);
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  animation: slideInRight 0.3s var(--nx-ease);
}

.notif-card:hover {
  background: rgba(255, 0, 60, 0.08);
  border-color: rgba(255, 0, 60, 0.25);
  box-shadow: var(--nx-glow-sm);
}

.notif-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--nx-sp-1);
}

.notif-card-app {
  font-size: var(--nx-fs-xs);
  color: var(--nx-red-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.notif-card-time {
  font-size: var(--nx-fs-xs);
  color: rgba(224, 208, 213, 0.3);
}

.notif-card-title {
  font-size: var(--nx-fs-sm);
  font-weight: 600;
  color: #e0d0d5;
  margin-bottom: 2px;
}

.notif-card-body {
  font-size: var(--nx-fs-xs);
  color: rgba(224, 208, 213, 0.6);
  line-height: 1.4;
}

.notif-card-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--nx-dur-fast);
  color: rgba(224, 208, 213, 0.5);
}

.notif-card:hover .notif-card-close {
  opacity: 1;
}


/* ================================================================
   13. VOLUME POPUP
   ================================================================ */
.volume-popup {
  position: fixed;
  bottom: calc(var(--nx-taskbar-h) + 8px);
  right: 100px;
  z-index: var(--nx-z-notif);
  padding: var(--nx-sp-3) var(--nx-sp-4);
  min-width: 200px;
  animation: slideInUp 0.2s var(--nx-ease-bounce);
}

.volume-popup.closing {
  animation: slideOutDown 0.15s var(--nx-ease) forwards;
}

.volume-popup-inner {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-3);
}

.volume-icon {
  flex-shrink: 0;
  color: var(--nx-red-light);
  filter: drop-shadow(0 0 4px rgba(255, 0, 60, 0.3));
}

/* Custom range slider */
.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 0, 60, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--nx-red);
  box-shadow: 0 0 8px rgba(255, 0, 60, 0.5);
  cursor: pointer;
  transition: transform var(--nx-dur-fast) var(--nx-ease);
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--nx-red);
  box-shadow: 0 0 8px rgba(255, 0, 60, 0.5);
  border: none;
  cursor: pointer;
}

.volume-slider::-moz-range-track {
  height: 4px;
  background: rgba(255, 0, 60, 0.15);
  border-radius: 2px;
  border: none;
}

.volume-value {
  font-size: var(--nx-fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--nx-red-light);
  min-width: 32px;
  text-align: right;
}


/* ================================================================
   14. SEARCH OVERLAY (Ctrl+K)
   ================================================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--nx-z-search);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s var(--nx-ease);
}

.search-container {
  position: relative;
  z-index: 1;
  width: min(600px, 90vw);
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.25s var(--nx-ease-bounce);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-3);
  padding: var(--nx-sp-4) var(--nx-sp-5);
  border-bottom: 1px solid rgba(255, 0, 60, 0.1);
}

.search-icon-glow {
  flex-shrink: 0;
  color: var(--nx-red);
  filter: drop-shadow(0 0 6px rgba(255, 0, 60, 0.5));
}

.search-main-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: var(--nx-fs-xl);
  color: #fff;
  outline: none;
}

.search-main-input::placeholder {
  color: rgba(224, 208, 213, 0.3);
}

.search-kbd {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-fs-xs);
  padding: 2px 8px;
  background: rgba(255, 0, 60, 0.08);
  border: 1px solid rgba(255, 0, 60, 0.2);
  border-radius: var(--nx-radius-sm);
  color: rgba(224, 208, 213, 0.5);
}

/* Search results */
.search-results {
  flex: 1;
  overflow-y: auto;
  padding: var(--nx-sp-2);
  max-height: 45vh;
}

.search-hint {
  text-align: center;
  color: rgba(224, 208, 213, 0.3);
  padding: var(--nx-sp-8);
  font-size: var(--nx-fs-sm);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-3);
  padding: var(--nx-sp-3) var(--nx-sp-4);
  border-radius: var(--nx-radius-md);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
}

.search-result-item:hover,
.search-result-item.selected {
  background: rgba(255, 0, 60, 0.12);
}

.search-result-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nx-red-light);
  flex-shrink: 0;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: var(--nx-fs-md);
  color: #e0d0d5;
}

.search-result-desc {
  font-size: var(--nx-fs-xs);
  color: rgba(224, 208, 213, 0.4);
}

.search-result-category {
  font-size: var(--nx-fs-xs);
  color: rgba(255, 0, 60, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Search footer */
.search-footer {
  padding: var(--nx-sp-2) var(--nx-sp-4);
  border-top: 1px solid rgba(255, 0, 60, 0.1);
  flex-shrink: 0;
}

.search-footer-hint {
  font-size: var(--nx-fs-xs);
  color: rgba(224, 208, 213, 0.3);
}

.search-footer-hint kbd {
  font-family: var(--nx-font-mono);
  padding: 1px 6px;
  background: rgba(255, 0, 60, 0.06);
  border: 1px solid rgba(255, 0, 60, 0.15);
  border-radius: 3px;
  font-size: 10px;
}


/* ================================================================
   15. WORKSPACE SWITCHER
   ================================================================ */
.workspace-switcher {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--nx-z-workspace);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(8, 0, 2, 0.7);
  backdrop-filter: var(--nx-blur);
  -webkit-backdrop-filter: var(--nx-blur);
  border: 1px solid rgba(255, 0, 60, 0.15);
  border-radius: var(--nx-radius-pill);
  box-shadow: var(--nx-glow-sm);
  opacity: 0;
  transition: opacity var(--nx-dur-normal) var(--nx-ease);
}

.workspace-switcher:hover,
.workspace-switcher.visible {
  opacity: 1;
}

.workspace-pill {
  display: flex;
  align-items: center;
  gap: var(--nx-sp-1);
  padding: var(--nx-sp-1) var(--nx-sp-3);
  border-radius: var(--nx-radius-pill);
  font-size: var(--nx-fs-xs);
  color: rgba(224, 208, 213, 0.5);
  cursor: pointer;
  transition: all var(--nx-dur-fast) var(--nx-ease);
  background: transparent;
  border: none;
}

.workspace-pill:hover {
  color: #e0d0d5;
  background: rgba(255, 0, 60, 0.08);
}

.workspace-pill.active {
  color: #fff;
  background: rgba(255, 0, 60, 0.2);
  box-shadow: 0 0 8px rgba(255, 0, 60, 0.2);
}

.workspace-add {
  width: 24px;
  height: 24px;
  padding: 0;
  justify-content: center;
  color: rgba(224, 208, 213, 0.3);
}

.workspace-add:hover {
  color: var(--nx-red-light);
}


/* ================================================================
   16. DIALOG SYSTEM
   ================================================================ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--nx-z-dialog);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.15s var(--nx-ease);
}

.dialog-overlay.closing {
  animation: fadeOut 0.2s var(--nx-ease) forwards;
}

.dialog-box {
  min-width: 360px;
  max-width: 500px;
  animation: scaleIn 0.25s var(--nx-ease-bounce);
}

.dialog-header {
  padding: var(--nx-sp-4) var(--nx-sp-5) var(--nx-sp-2);
}

.dialog-title {
  font-size: var(--nx-fs-lg);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 0, 60, 0.2);
}

.dialog-body {
  padding: var(--nx-sp-2) var(--nx-sp-5) var(--nx-sp-4);
}

.dialog-message {
  font-size: var(--nx-fs-md);
  color: rgba(224, 208, 213, 0.7);
  line-height: 1.6;
}

.dialog-input {
  width: 100%;
  margin-top: var(--nx-sp-3);
  padding: var(--nx-sp-3) var(--nx-sp-4);
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--nx-sp-2);
  padding: var(--nx-sp-3) var(--nx-sp-5) var(--nx-sp-4);
}

.dialog-btn {
  padding: var(--nx-sp-2) var(--nx-sp-5);
  font-size: var(--nx-fs-sm);
  min-width: 80px;
}

.dialog-btn-primary {
  background: rgba(255, 0, 60, 0.2);
  border-color: rgba(255, 0, 60, 0.4);
  color: #fff;
}

.dialog-btn-primary:hover {
  background: rgba(255, 0, 60, 0.35);
  box-shadow: var(--nx-glow-md);
}


/* ================================================================
   17. TOAST NOTIFICATIONS
   ================================================================ */
.toast-container {
  position: fixed;
  bottom: calc(var(--nx-taskbar-h) + 12px);
  right: 12px;
  z-index: var(--nx-z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--nx-sp-2);
  pointer-events: none;
  max-width: 340px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-sp-3);
  padding: var(--nx-sp-3) var(--nx-sp-4);
  background: var(--nx-glass-bg);
  backdrop-filter: var(--nx-blur);
  -webkit-backdrop-filter: var(--nx-blur);
  border: 1px solid var(--nx-glass-border);
  border-radius: var(--nx-radius-md);
  box-shadow: var(--nx-glow-md), 0 8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: toastIn 0.35s var(--nx-ease-bounce);
  cursor: pointer;
  transition: opacity var(--nx-dur-fast) var(--nx-ease);
}

.toast:hover {
  opacity: 0.85;
}

.toast.removing {
  animation: toastOut 0.3s var(--nx-ease) forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--nx-red-light);
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: var(--nx-fs-sm);
  font-weight: 600;
  color: #e0d0d5;
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--nx-fs-xs);
  color: rgba(224, 208, 213, 0.6);
  line-height: 1.4;
}

.toast-close {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: rgba(224, 208, 213, 0.3);
  flex-shrink: 0;
  transition: color var(--nx-dur-fast);
}

.toast-close:hover {
  color: var(--nx-red);
}

/* Toast variants */
.toast.toast-success {
  border-left: 3px solid #00ff88;
}

.toast.toast-success .toast-icon {
  color: #00ff88;
}

.toast.toast-warning {
  border-left: 3px solid #ffb400;
}

.toast.toast-warning .toast-icon {
  color: #ffb400;
}

.toast.toast-error {
  border-left: 3px solid var(--nx-red);
}

.toast.toast-info {
  border-left: 3px solid #4488ff;
}

.toast.toast-info .toast-icon {
  color: #4488ff;
}


/* ================================================================
   18. SCROLLBARS
   ================================================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 0, 60, 0.3) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 0, 60, 0.25);
  border-radius: 3px;
  transition: background 0.2s;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 0, 60, 0.45);
  box-shadow: 0 0 4px rgba(255, 0, 60, 0.3);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}


/* ================================================================
   19. SELECTION & FOCUS
   ================================================================ */
::selection {
  background: rgba(255, 0, 60, 0.35);
  color: #fff;
  text-shadow: 0 0 4px rgba(255, 0, 60, 0.5);
}

::-moz-selection {
  background: rgba(255, 0, 60, 0.35);
  color: #fff;
}

/* Focus visible ring */
*:focus-visible {
  outline: 2px solid var(--nx-red-light);
  outline-offset: 2px;
  box-shadow: 0 0 8px rgba(255, 0, 60, 0.3);
}

/* Override for elements that shouldn't have outline */
button:focus-visible {
  outline: 2px solid rgba(255, 45, 107, 0.6);
  outline-offset: 1px;
}

input:focus-visible {
  outline: none;
}


/* ================================================================
   20. ACCESSIBILITY — Reduced Motion & High Contrast
   ================================================================ */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .boot-scanlines { display: none; }
  .bg-particles { display: none; }
  .lock-particles { display: none; }
  .bg-grid { animation: none; }
}

/* High contrast override */
@media (prefers-contrast: high) {
  :root {
    --nx-glass-bg: rgba(0, 0, 0, 0.95);
    --nx-glass-border: rgba(255, 0, 60, 0.6);
    --nx-glass-border-hover: rgba(255, 0, 60, 0.9);
  }

  body {
    color: #fff;
  }

  .glass-panel {
    border-width: 2px;
  }

  .nx-window {
    border-width: 2px;
  }

  .context-menu-item:hover {
    background: rgba(255, 0, 60, 0.3);
  }
}

/* Dark color scheme forced */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}


/* ================================================================
   21. PRINT STYLES
   ================================================================ */
@media print {
  body {
    background: #fff;
    color: #000;
    overflow: visible;
  }

  .taskbar,
  .boot-screen,
  .lock-screen,
  .start-menu,
  .context-menu,
  .notification-center,
  .volume-popup,
  .search-overlay,
  .workspace-switcher,
  .toast-container,
  .desktop-bg,
  .dialog-overlay {
    display: none !important;
  }

  .nx-window {
    position: static;
    box-shadow: none;
    border: 1px solid #ccc;
    backdrop-filter: none;
    page-break-inside: avoid;
  }

  .nx-window-titlebar {
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
  }

  .nx-window-title {
    color: #000;
  }

  .nx-window-body {
    color: #000;
  }

  .window-container {
    position: static;
    overflow: visible;
  }
}


/* ================================================================
   UTILITY CLASSES
   ================================================================ */

/* Text utilities */
.text-neon { color: var(--nx-red); text-shadow: var(--nx-glow-text); }
.text-neon-pink { color: var(--nx-pink); text-shadow: 0 0 8px rgba(255, 68, 136, 0.5); }
.text-dim { color: rgba(224, 208, 213, 0.4); }
.text-glow { text-shadow: var(--nx-glow-lg); }
.text-mono { font-family: var(--nx-font-mono); }
.text-center { text-align: center; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--nx-sp-1); }
.gap-2 { gap: var(--nx-sp-2); }
.gap-3 { gap: var(--nx-sp-3); }
.gap-4 { gap: var(--nx-sp-4); }

/* Spacing utilities */
.p-1 { padding: var(--nx-sp-1); }
.p-2 { padding: var(--nx-sp-2); }
.p-3 { padding: var(--nx-sp-3); }
.p-4 { padding: var(--nx-sp-4); }
.mt-2 { margin-top: var(--nx-sp-2); }
.mt-4 { margin-top: var(--nx-sp-4); }
.mb-2 { margin-bottom: var(--nx-sp-2); }
.mb-4 { margin-bottom: var(--nx-sp-4); }

/* Size utilities */
.w-full { width: 100%; }
.h-full { height: 100%; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Visibility */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.pointer-events-none { pointer-events: none; }

/* Glass modifiers */
.glass-heavy {
  background: var(--nx-glass-bg-heavy);
  backdrop-filter: var(--nx-blur-heavy);
}

.glass-light {
  background: var(--nx-glass-bg-light);
  backdrop-filter: var(--nx-blur-light);
}

/* Neon border glow */
.neon-border {
  border: 1px solid var(--nx-glass-border);
  box-shadow: var(--nx-glow-md);
}

.neon-border-hover:hover {
  border-color: var(--nx-glass-border-hover);
  box-shadow: var(--nx-glow-lg);
}

/* Divider */
.nx-divider {
  height: 1px;
  background: rgba(255, 0, 60, 0.1);
  margin: var(--nx-sp-2) 0;
}

/* Badge */
.nx-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--nx-radius-pill);
  background: rgba(255, 0, 60, 0.15);
  color: var(--nx-red-light);
  border: 1px solid rgba(255, 0, 60, 0.2);
}

/* Kbd / shortcut */
kbd {
  font-family: var(--nx-font-mono);
  font-size: var(--nx-fs-xs);
  padding: 2px 6px;
  background: rgba(255, 0, 60, 0.06);
  border: 1px solid rgba(255, 0, 60, 0.15);
  border-radius: 3px;
  color: rgba(224, 208, 213, 0.5);
}

/* Loading spinner */
.nx-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 0, 60, 0.15);
  border-top-color: var(--nx-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Skeleton loader */
.nx-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 0, 60, 0.05) 25%,
    rgba(255, 0, 60, 0.1) 50%,
    rgba(255, 0, 60, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--nx-radius-sm);
}

/* Ripple effect container */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 0, 60, 0.2);
  animation: ripple 0.6s ease-out forwards;
  pointer-events: none;
}

/* Tooltip */
.nx-tooltip {
  position: relative;
}

.nx-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(10, 0, 0, 0.9);
  border: 1px solid rgba(255, 0, 60, 0.2);
  border-radius: var(--nx-radius-sm);
  font-size: 11px;
  color: #e0d0d5;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 9999;
}

.nx-tooltip:hover::after {
  opacity: 1;
}

/* Cursor overrides for specific zones */
.cursor-grab { cursor: grab; }
.cursor-grabbing { cursor: grabbing; }
.cursor-text { cursor: text; }
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Shimmer animation for skeleton */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Toast specific animations */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Window close animation */
@keyframes windowClose {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Window minimize animation */
@keyframes windowMinimize {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.5) translateY(100px);
  }
}

/* Window maximize animation */
@keyframes windowMaximize {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* Window restore animation */
@keyframes windowRestore {
  from { opacity: 0.8; }
  to { opacity: 1; }
}


/* ================================================================
   RESPONSIVE ADJUSTMENTS
   ================================================================ */
@media (max-width: 768px) {
  :root {
    --nx-taskbar-h: 44px;
    --nx-win-titlebar-h: 30px;
  }

  .desktop-icons {
    grid-template-columns: repeat(auto-fill, 70px);
    grid-auto-rows: 80px;
  }

  .desktop-icon {
    width: 70px;
    height: 76px;
  }

  .start-menu {
    width: calc(100vw - 16px);
    left: 8px;
    bottom: calc(var(--nx-taskbar-h) + 4px);
  }

  .notification-center {
    width: 100vw;
    border-radius: 0;
  }

  .search-container {
    width: calc(100vw - 24px);
    margin-top: 10vh;
  }

  .workspace-switcher {
    top: 4px;
  }

  .nx-window {
    min-width: 280px;
    min-height: 160px;
  }

  /* Hide date in tray clock on mobile */
  .clock-date { display: none; }

  /* Simplify taskbar */
  .taskbar-app-label { display: none; }
  .taskbar-search-btn { display: none; }
}

@media (max-width: 480px) {
  .desktop-icons {
    grid-template-columns: repeat(auto-fill, 64px);
    grid-auto-rows: 74px;
  }

  .start-category { margin-bottom: var(--nx-sp-3); }

  .start-app-grid {
    grid-template-columns: repeat(auto-fill, 60px);
  }

  .start-app-tile {
    width: 60px;
    height: 60px;
  }

  .dialog-box {
    min-width: 280px;
    max-width: calc(100vw - 32px);
  }
}

@media (max-height: 500px) {
  .lock-time { font-size: 3rem; }
  .lock-card { padding: var(--nx-sp-6); }
}


/* ================================================================
   THEME VARIANTS (future extensibility)
   ================================================================ */

/* Blue variant (example) */
[data-theme="nexus-blue"] {
  --nx-red: #0088ff;
  --nx-red-light: #44aaff;
  --nx-red-dim: #0066cc;
  --nx-pink: #66bbff;
  --nx-pink-light: #88ccff;
  --nx-glass-border: rgba(0, 136, 255, 0.28);
  --nx-glass-border-hover: rgba(0, 136, 255, 0.55);
  --nx-glass-border-focus: rgba(68, 170, 255, 0.75);
}

/* Green variant (example) */
[data-theme="nexus-green"] {
  --nx-red: #00ff66;
  --nx-red-light: #44ff88;
  --nx-red-dim: #00cc52;
  --nx-pink: #66ffaa;
  --nx-pink-light: #88ffbb;
  --nx-glass-border: rgba(0, 255, 102, 0.28);
  --nx-glass-border-hover: rgba(0, 255, 102, 0.55);
  --nx-glass-border-focus: rgba(68, 255, 136, 0.75);
}

/* Purple variant (example) */
[data-theme="nexus-purple"] {
  --nx-red: #8800ff;
  --nx-red-light: #aa44ff;
  --nx-red-dim: #6600cc;
  --nx-pink: #bb66ff;
  --nx-pink-light: #cc88ff;
  --nx-glass-border: rgba(136, 0, 255, 0.28);
  --nx-glass-border-hover: rgba(136, 0, 255, 0.55);
  --nx-glass-border-focus: rgba(170, 68, 255, 0.75);
}

/* ============================================================
   App Loading & Error States
   ============================================================ */
.app-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--nx-red-light);
  font-size: 14px;
  gap: 16px;
}

.app-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 0, 60, 0.15);
  border-top-color: var(--nx-red);
  border-radius: 50%;
  animation: nx-spin 0.8s linear infinite;
}

.app-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--nx-red-light);
  padding: 24px;
  text-align: center;
}

.app-error h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--nx-red);
}

.app-error p {
  font-size: 13px;
  color: var(--nx-red-light);
  opacity: 0.8;
}

@keyframes nx-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Immersive Mode — Maximized entertainment apps
   When games, music, and media apps are maximized, they get
   a more immersive experience with minimal chrome
   ============================================================ */
.nx-window.maximized .nx-window-titlebar {
  background: rgba(10, 0, 15, 0.4);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 0, 60, 0.1);
  padding: 4px 12px;
  min-height: 32px;
  transition: opacity 0.3s ease;
}

.nx-window.maximized .nx-window-titlebar:hover {
  background: rgba(10, 0, 15, 0.7);
}

.nx-window.maximized .nx-window-title {
  font-size: 12px;
  opacity: 0.6;
  letter-spacing: 0.5px;
}

.nx-window.maximized .nx-window-icon {
  opacity: 0.5;
}

.nx-window.maximized .nx-window-body {
  padding: 0;
  background: var(--nx-bg-deep);
}

/* Entertainment apps get special immersive treatment */
.nx-window[data-app-id^="music-"].maximized .nx-window-body,
.nx-window[data-app-id^="game-"].maximized .nx-window-body,
.nx-window[data-app-id^="video-"].maximized .nx-window-body,
.nx-window[data-app-id^="audio-"].maximized .nx-window-body {
  background: radial-gradient(ellipse at center, rgba(20, 0, 30, 1) 0%, rgba(5, 0, 10, 1) 100%);
}

/* Fullscreen button for entertainment apps */
.nx-window.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10000 !important;
  border-radius: 0 !important;
  border: none !important;
}

.nx-window.fullscreen .nx-window-titlebar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
  border: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.nx-window.fullscreen:hover .nx-window-titlebar {
  opacity: 1;
}

.nx-window.fullscreen .nx-window-body {
  padding: 0;
  height: 100%;
}

/* Hide resize handles when maximized */
.nx-window.maximized .nx-resize-handle {
  display: none;
}
