/* ============================================================
   Upload18 Desktop OS — Core Stylesheet
   ============================================================ */

/* ── CSS Custom Properties ──────────────────────────────── */
:root {
  color-scheme: dark;

  /* ─ Core Colors ─ */
  --desktop-bg: #0b0e17;
  --accent: #7c5cfc;
  --accent-hover: #9b7fff;
  --accent-alt: #6d4de8;
  --accent-purple: #a855f7;
  --accent-blue: #38bdf8;
  --text: #e2e0f0;
  --text-dim: #8a89a8;
  --text-muted: #5c5b78;
  --text-label: #d0cde8;
  --danger: #f5426c;
  --success: #34d399;
  --warning: #fbbf24;

  /* ─ Accent Opacity Scale ─ */
  --accent-3:  rgba(124, 92, 252, 0.03);
  --accent-8:  rgba(124, 92, 252, 0.08);
  --accent-10: rgba(124, 92, 252, 0.10);
  --accent-12: rgba(124, 92, 252, 0.12);
  --accent-15: rgba(124, 92, 252, 0.15);
  --accent-18: rgba(124, 92, 252, 0.18);
  --accent-20: rgba(124, 92, 252, 0.20);
  --accent-25: rgba(124, 92, 252, 0.25);
  --accent-30: rgba(124, 92, 252, 0.30);
  --accent-35: rgba(124, 92, 252, 0.35);
  --accent-glow: rgba(124, 92, 252, 0.35);

  /* ─ Glass / White Overlay Scale ─ */
  --glass-3:  rgba(255, 255, 255, 0.03);
  --glass-4:  rgba(255, 255, 255, 0.04);
  --glass-5:  rgba(255, 255, 255, 0.05);
  --glass-6:  rgba(255, 255, 255, 0.06);
  --glass-8:  rgba(255, 255, 255, 0.08);
  --glass-10: rgba(255, 255, 255, 0.10);
  --glass:    rgba(255, 255, 255, 0.04);

  /* ─ Shadow / Black Scale ─ */
  --shadow-20: rgba(0, 0, 0, 0.20);
  --shadow-40: rgba(0, 0, 0, 0.40);
  --shadow-50: rgba(0, 0, 0, 0.50);
  --shadow-55: rgba(0, 0, 0, 0.55);
  --shadow-60: rgba(0, 0, 0, 0.60);
  --shadow-80: rgba(0, 0, 0, 0.80);

  /* ─ Danger Scale ─ */
  --danger-12: rgba(245, 66, 108, 0.12);

  /* ─ Surface Colors (Liquid Glass) ─ */
  --taskbar-bg: rgba(15, 18, 30, 0.78);
  --taskbar-h: 52px;
  --win-title-bg: rgba(20, 24, 40, 0.88);
  --win-body-bg: rgba(16, 19, 32, 0.95);
  --win-border: rgba(100, 80, 200, 0.25);
  --win-shadow: 0 12px 48px var(--shadow-55), 0 0 0 1px rgba(100, 80, 200, 0.15);
  --popup-bg: rgba(15, 18, 30, 0.88);
  --popup-shadow: 0 16px 48px var(--shadow-50);
  --lock-card-bg: rgba(20, 24, 40, 0.65);
  --input-bg: rgba(10, 12, 24, 0.6);

  /* ─ Border Radius Scale ─ */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  20px;
  --radius-full: 9999px;
  --win-radius:  var(--radius-lg);

  /* ─ Type Scale ─ */
  --text-xs:   10px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   13px;
  --text-lg:   16px;
  --text-xl:   20px;
  --text-2xl:  32px;
  --text-hero: 64px;

  /* ─ Motion Tokens ─ */
  --ease-fast:   150ms ease;
  --ease-normal: 200ms ease;
  --ease-slow:   250ms ease;
  --ease-spring: 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ─ Z-Index Layers ─ */
  --z-desktop:  0;
  --z-icons:    1;
  --z-resize:   10;
  --z-window:   100;
  --z-taskbar:  9000;
  --z-popup:    9500;
  --z-lock:     10000;

  /* ─ Dimensions ─ */
  --icon-size: 64px;
  --sidebar-w: 80px;  /* width of the desktop icon column */

  /* ─ Blur / Backdrop ─ */
  --blur-sm:  blur(16px);
  --blur-md:  blur(24px) saturate(1.4);
  --blur-lg:  blur(40px) saturate(1.8);
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Focus Accessibility ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ── Global Scrollbar Styling ───────────────────────────── */
/* Webkit (Chrome, Edge, Safari) — vertical + horizontal */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(11, 14, 23, 0.6);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 92, 252, 0.38);
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 252, 0.12);
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 92, 252, 0.65);
}
::-webkit-scrollbar-corner {
  background: transparent;
}
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 252, 0.38) rgba(11, 14, 23, 0.6);
}

/* ── Desktop Wallpaper ──────────────────────────────────── */
#desktop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(124, 92, 252, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 50%),
    linear-gradient(160deg, #0b0e17 0%, #111630 40%, #0d1020 100%);
  z-index: var(--z-desktop);
}

/* Subtle animated grid overlay */
#desktop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--accent-3) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent-3) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridShift 30s linear infinite;
  pointer-events: none;
}

@keyframes gridShift {
  0% { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* ── Desktop Icons ──────────────────────────────────────── */
#desktop-icons {
  position: absolute;
  top: 8px;
  left: 4px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;           /* never wrap to 2nd column */
  gap: 2px;
  max-height: calc(100vh - var(--taskbar-h) - 16px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;       /* hide scrollbar */
  z-index: var(--z-icons);
  padding: 4px;
}

#desktop-icons::-webkit-scrollbar { display: none; }

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 84px;           /* wider — fits longer labels like "My Account" */
  padding: 6px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--ease-normal);
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}

.desktop-icon:hover {
  background: var(--accent-12);
  transform: translateY(-2px);
}

.desktop-icon:active {
  transform: scale(0.95);
  background: var(--accent-20);
}

.desktop-icon .icon-img {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 5px;
  border-radius: var(--radius-xl);
  background: var(--accent-10);
  border: 1px solid var(--accent-15);
  transition: all var(--ease-slow);
  box-shadow: 0 4px 12px var(--shadow-20);
}

.desktop-icon:hover .icon-img {
  background: var(--accent-20);
  border-color: var(--accent-35);
  box-shadow: 0 6px 24px var(--accent-20);
  transform: scale(1.05);
}

.desktop-icon .icon-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-label);
  text-align: center;
  width: 100%;             /* use full icon width */
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 4px var(--shadow-80);
  line-height: 1.2;
  padding: 0 2px;
}

/* Shrink icons on short viewports (e.g. tablets, small laptops) */
@media (max-height: 750px) {
  .desktop-icon { width: 76px; padding: 4px 3px; }
  .desktop-icon .icon-img { width: 40px; height: 40px; font-size: 20px; }
  .desktop-icon .icon-label { font-size: 9.5px; max-width: 72px; }
  #desktop-icons { gap: 0; }
}

/* Very tight height (phones landscape / small tablets) */
@media (max-height: 560px) {
  .desktop-icon { width: 72px; padding: 3px 2px; }
  .desktop-icon .icon-img { width: 34px; height: 34px; font-size: 17px; }
  .desktop-icon .icon-label { font-size: 9px; max-width: 68px; }
}

/* Narrow width but still desktop-mode (768–900px wide) */
@media (min-width: 769px) and (max-width: 900px) {
  .desktop-icon { width: 72px; padding: 5px 3px; }
  .desktop-icon .icon-label { font-size: 9.5px; max-width: 68px; }
}

/* Hide sidebar icons on mobile — windows are full-screen */
@media (max-width: 768px) {
  #desktop-icons { display: none; }
}


/* ── Taskbar ────────────────────────────────────────────── */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--taskbar-h);
  background: var(--taskbar-bg);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-top: 1px solid var(--accent-15);
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: var(--z-taskbar);
  box-shadow: 0 -4px 20px var(--shadow-40), inset 0 1px 0 var(--glass-6);
}

/* Start button */
#start-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease-normal);
  flex-shrink: 0;
  box-shadow: 0 2px 10px var(--accent-glow);
}

#start-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 18px var(--accent-glow);
}

#start-btn:active {
  transform: scale(0.95);
}

/* Taskbar window buttons */
#taskbar-windows {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

#taskbar-windows::-webkit-scrollbar { display: none; }

.taskbar-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--glass-4);
  color: var(--text-dim);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all var(--ease-normal);
  flex-shrink: 0;
}

.taskbar-btn:hover {
  background: var(--accent-12);
  color: var(--text);
}

.taskbar-btn.active {
  background: var(--accent-18);
  border-color: var(--accent-30);
  color: #fff;
  box-shadow: 0 0 8px var(--accent-glow);
}

.taskbar-btn .tb-icon {
  font-size: 14px;
}

/* System tray */
#system-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  flex-shrink: 0;
}

#system-tray .tray-item {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease-normal);
  position: relative;
}

#system-tray .tray-item:hover {
  background: var(--glass-6);
  color: var(--text);
}

#system-tray .tray-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}

#taskbar-clock {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}

#taskbar-clock .clock-time {
  font-size: 13px;
  font-weight: 600;
}

#taskbar-clock .clock-date {
  font-size: 10px;
  color: var(--text-dim);
}

/* ── Windows ────────────────────────────────────────────── */
.os-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 400px;
  min-height: 300px;
  border-radius: var(--win-radius);
  border: 1px solid var(--win-border);
  box-shadow: var(--win-shadow);
  overflow: hidden;
  transition: box-shadow var(--ease-normal);
  z-index: var(--z-window);
  will-change: transform, opacity;
}

.os-window.focused {
  box-shadow: var(--win-shadow), 0 0 0 1px var(--accent-30);
  border-color: var(--accent-35);
  will-change: box-shadow;
}

/* Window Title Bar */
.win-titlebar {
  height: 42px;
  background: var(--win-title-bg);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  display: flex;
  align-items: center;
  padding: 0 12px;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  border-bottom: 1px solid var(--glass-4);
  box-shadow: inset 0 1px 0 var(--glass-6);
}

.win-titlebar .win-icon {
  font-size: 14px;
  margin-right: 8px;
  opacity: 0.8;
}

.win-titlebar .win-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: move;
}

.win-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.win-controls button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--glass-5);
  color: var(--text-dim);
  font-size: var(--text-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease-fast);
}

.win-controls button:hover { 
  background: var(--glass-10);
  color: #fff;
}

.win-controls .win-close:hover {
  background: var(--danger);
  color: #fff;
}

.win-controls .win-refresh {
  font-size: 15px;
  font-weight: 700;
}

.win-controls .win-refresh:hover {
  background: rgba(52, 211, 153, 0.2);
  color: var(--success);
}

.win-controls .win-refresh:active {
  animation: refreshSpin 0.5s ease;
}

@keyframes refreshSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Window Body */
.win-body {
  flex: 1;
  background: var(--win-body-bg);
  overflow: auto;
  position: relative;
  container-type: inline-size;
  container-name: window;
  /* Firefox scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--accent-20) transparent;
}

/* Scrollbar in windows (Webkit) */
.win-body::-webkit-scrollbar { width: 6px; }
.win-body::-webkit-scrollbar-track { background: transparent; }
.win-body::-webkit-scrollbar-thumb {
  background: var(--accent-20);
  border-radius: var(--radius-sm);
}
.win-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-35);
}

/* Resize handles */
.win-resize {
  position: absolute;
  z-index: var(--z-resize);
}
.win-resize-n { top: -4px; left: 8px; right: 8px; height: 8px; cursor: n-resize; }
.win-resize-s { bottom: -4px; left: 8px; right: 8px; height: 8px; cursor: s-resize; }
.win-resize-e { right: -4px; top: 8px; bottom: 8px; width: 8px; cursor: e-resize; }
.win-resize-w { left: -4px; top: 8px; bottom: 8px; width: 8px; cursor: w-resize; }
.win-resize-ne { top: -4px; right: -4px; width: 16px; height: 16px; cursor: ne-resize; }
.win-resize-nw { top: -4px; left: -4px; width: 16px; height: 16px; cursor: nw-resize; }
.win-resize-se { bottom: -4px; right: -4px; width: 16px; height: 16px; cursor: se-resize; }
.win-resize-sw { bottom: -4px; left: -4px; width: 16px; height: 16px; cursor: sw-resize; }

/* ── Window States ──────────────────────────────────────── */

/* Maximized — positioning is handled by JS (window-manager.js) */
.os-window.maximized {
  border-radius: 0;
  border: none;
  transition: all var(--ease-smooth);
}

.os-window.maximized .win-resize { display: none; }

/* Minimized (hidden) */
.os-window.minimized {
  transform: scale(0.7) translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--ease-smooth);
}

/* ── Window Animations ──────────────────────────────────── */
@keyframes windowOpen {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes windowClose {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.85);
    opacity: 0;
  }
}

.os-window.opening {
  animation: windowOpen var(--ease-spring) forwards;
}

.os-window.closing {
  animation: windowClose 200ms ease-in forwards;
  pointer-events: none;
}

/* ── Start Menu ─────────────────────────────────────────── */
#start-menu {
  position: fixed;
  bottom: calc(var(--taskbar-h) + 8px);
  left: 8px;
  width: 320px;
  max-height: 480px;
  background: var(--popup-bg);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--accent-20);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px var(--shadow-60), inset 0 1px 0 var(--glass-8);
  z-index: var(--z-popup);
  display: none;
  overflow: hidden;
  animation: startMenuIn 0.2s ease forwards;
}

@keyframes startMenuIn {
  0% { transform: translateY(10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

#start-menu.visible { display: block; }

#start-menu .menu-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-5);
  display: flex;
  align-items: center;
  gap: 12px;
}

#start-menu .menu-header .menu-avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  font-weight: 700;
}

#start-menu .menu-header .menu-username {
  font-weight: 600;
  font-size: 14px;
}

#start-menu .menu-header .menu-role {
  font-size: 11px;
  color: var(--text-dim);
}

#start-menu .menu-apps {
  padding: 8px;
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-20) transparent;
}

#start-menu .menu-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--ease-fast);
  text-decoration: none;
  color: var(--text);
}

#start-menu .menu-app:hover {
  background: var(--accent-12);
  color: #fff;
}

#start-menu .menu-app .app-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
}

#start-menu .menu-app .app-name {
  font-weight: 500;
  font-size: 13px;
}

#start-menu .menu-app-child {
  padding-left: 56px;
}

#start-menu .app-icon-sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-md);
}

#start-menu .app-name-sm {
  font-size: var(--text-sm);
}

#start-menu .menu-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--glass-5);
  display: flex;
  justify-content: flex-end;
}

#start-menu .menu-footer a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--danger);
  text-decoration: none;
  transition: all var(--ease-fast);
}

#start-menu .menu-footer a:hover {
  background: var(--danger-12);
}

/* ── User Dropdown (tray) ───────────────────────────────── */
#user-dropdown {
  position: fixed;
  bottom: calc(var(--taskbar-h) + 8px);
  right: 8px;
  width: 220px;
  background: var(--popup-bg);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--accent-20);
  border-radius: var(--radius-lg);
  box-shadow: var(--popup-shadow), inset 0 1px 0 var(--glass-8);
  z-index: var(--z-popup);
  display: none;
  overflow: hidden;
  padding: 6px;
}

#user-dropdown.visible { display: block; }

#user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  color: var(--text);
  text-decoration: none;
  transition: all var(--ease-fast);
}

#user-dropdown a:hover {
  background: var(--accent-12);
  color: #fff;
}

#user-dropdown a.logout {
  color: var(--danger);
}

#user-dropdown a.logout:hover {
  background: var(--danger-12);
}

/* ── Page Content Inside Window ─────────────────────────── */
.win-body .page-content {
  padding: 20px;
  min-height: 100%;
}

/* Override existing template styles for the desktop context */
.win-body .manager {
  padding: 0;
}

.win-body .container-fluid {
  padding-left: 16px;
  padding-right: 16px;
}

/* ── Lock Screen (Login) ────────────────────────────────── */
#lock-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-lock);
  background:
    radial-gradient(ellipse at 20% 50%, var(--accent-12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, var(--accent-8) 0%, transparent 50%),
    linear-gradient(160deg, #0b0e17 0%, #111630 40%, #0d1020 100%);
}

#lock-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--accent-3) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent-3) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

/* ── SweetAlert2: always render above lock screen ────────── */
.swal2-container {
  z-index: 100001 !important;
}

#lock-screen .lock-clock {
  font-size: var(--text-hero);
  font-weight: 200;
  letter-spacing: -2px;
  color: #fff;
  margin-bottom: 4px;
  text-shadow: 0 2px 20px var(--accent-30);
}

#lock-screen .lock-date {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 40px;
  font-weight: 400;
}

#lock-screen .lock-card {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  background: var(--lock-card-bg);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--accent-15);
  border-radius: var(--radius-2xl);
  box-shadow: 0 24px 64px var(--shadow-50), inset 0 1px 0 var(--glass-8);
}

#lock-screen .lock-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

#lock-screen .lock-logo img {
  height: 40px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 12px var(--accent-30));
}

#lock-screen .lock-logo h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 4px;
}

#lock-screen .lock-logo p {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
}

.lock-field {
  margin-bottom: 18px;
}

.lock-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.lock-field .field-wrap {
  position: relative;
}

.lock-field .field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.lock-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  background: var(--input-bg);
  border: 1px solid var(--accent-15);
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: var(--text-base);
  transition: all var(--ease-normal);
  outline: none;
}

.lock-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.lock-field input::placeholder {
  color: var(--text-muted);
}

.lock-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 12px;
}

.lock-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  cursor: pointer;
}

.lock-options a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.lock-options a:hover { color: var(--accent-hover); }

.lock-submit {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), var(--accent-alt));
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ease-slow);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.lock-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.lock-submit:active {
  transform: translateY(0);
}

.lock-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.lock-register {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-dim);
}

.lock-register a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.lock-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.lock-footer a {
  color: var(--text-dim);
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.2s ease;
}

.lock-footer a:hover { color: var(--text); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --taskbar-h: 48px; }

  #desktop-icons {
    top: 10px;
    left: 10px;
    gap: 4px;
  }

  .desktop-icon {
    width: 72px;
    padding: 8px 2px;
  }

  .desktop-icon .icon-img {
    width: 48px;
    height: 48px;
    font-size: 24px;
    border-radius: var(--radius-lg);
  }

  .desktop-icon .icon-label {
    font-size: var(--text-xs);
    max-width: 68px;
  }

  .os-window {
    min-width: 100% !important;
    min-height: calc(100% - var(--taskbar-h)) !important;
    width: 100% !important;
    height: calc(100% - var(--taskbar-h)) !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0;
    border: none;
  }

  .os-window .win-resize { display: none; }

  #start-menu {
    width: calc(100% - 16px);
    left: 8px;
    right: 8px;
  }

  #lock-screen .lock-clock {
    font-size: 48px;
  }

  #lock-screen .lock-card {
    margin: 0 16px;
    padding: 24px;
  }
}

/* Tablet / small laptop */
@media (max-width: 1024px) and (min-width: 769px) {
  .desktop-icon {
    width: 80px;
  }

  .desktop-icon .icon-img {
    width: 52px;
    height: 52px;
  }

  #start-menu {
    width: 300px;
  }
}

/* ── Notification popup ─────────────────────────────────── */
#notif-popup {
  position: fixed;
  bottom: calc(var(--taskbar-h) + 8px);
  right: 56px;
  width: 300px;
  max-height: 360px;
  background: var(--popup-bg);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--accent-20);
  border-radius: var(--radius-lg);
  box-shadow: var(--popup-shadow), inset 0 1px 0 var(--glass-8);
  z-index: var(--z-popup);
  display: none;
  overflow: hidden;
}

#notif-popup.visible { display: block; }

#notif-popup .notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-5);
  font-weight: 600;
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#notif-popup .notif-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-20) transparent;
}

#notif-popup .notif-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
  transition: background var(--ease-fast);
  border-bottom: 1px solid var(--glass-3);
}

#notif-popup .notif-item:hover {
  background: var(--accent-10);
}

#notif-popup .notif-item.unread {
  color: #fff;
  font-weight: 600;
}

#notif-popup .notif-footer {
  padding: 8px;
  border-top: 1px solid var(--glass-5);
}

#notif-popup .notif-footer button {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-15);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease-fast);
}

#notif-popup .notif-footer button:hover {
  background: var(--accent-25);
}

/* ── Container Queries (responsive windows) ────────────── */
@container window (max-width: 500px) {
  .win-body .page-content {
    padding: 12px;
  }
  .win-body .container-fluid {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* ── Accessibility ─────────────────────────────────────── */
@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;
  }
}

/* ── Utility ────────────────────────────────────────────── */
.hidden { display: none !important; }
.no-select { user-select: none; -webkit-user-select: none; }
