/* Shell chrome: boot, lock, desktop, topbar, dock, activities, windows, notifications, menus */

#boot-screen, #lock-screen, #shutoff-screen { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; background: #000; color: #fff; }
#boot-screen { background: radial-gradient(circle at 50% 40%, #5e2750 0%, #2c001e 60%, #111 100%); flex-direction: column; }
#boot-screen .ubuntu-logo { width: 100px; height: 100px; margin-bottom: 24px; }
#boot-screen .spinner { width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.2); border-top-color: #e95420; border-radius: 50%; animation: spin 1s linear infinite; }
#boot-screen .boot-msg { margin-top: 16px; font-size: 13px; opacity: .8; }

#lock-screen { background: var(--wallpaper); background-size: cover; flex-direction: column; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
#lock-screen .lock-time { font-size: 76px; font-weight: 300; letter-spacing: -2px; }
#lock-screen .lock-date { font-size: 18px; margin-top: 4px; }
#lock-screen .lock-user { margin-top: 40px; display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,.35); padding: 12px 20px; border-radius: 999px; cursor: pointer; backdrop-filter: blur(8px); }
#lock-screen .unlock-hint { margin-top: 14px; font-size: 13px; opacity: .85; }

#shutoff-screen { background: #000; flex-direction: column; gap: 12px; font-family: monospace; }
#shutoff-screen .power-msg { color: #e95420; }

#desktop { position: fixed; inset: 0; overflow: hidden; background: var(--wallpaper); background-size: cover; }

#desktop-icons { position: absolute; top: var(--yaru-topbar-h); left: var(--yaru-dock-w); right: 0; bottom: 0; padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, 88px); grid-template-rows: repeat(auto-fill, 96px); gap: 4px; align-content: start; pointer-events: none; }
#desktop-icons .desk-icon { pointer-events: auto; width: 88px; height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-radius: 8px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); cursor: pointer; transition: background .12s; }
#desktop-icons .desk-icon:hover { background: rgba(255,255,255,.12); }
#desktop-icons .desk-icon.selected { background: rgba(233,84,32,.45); }
#desktop-icons .desk-icon svg { width: 44px; height: 44px; margin-bottom: 6px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
#desktop-icons .desk-icon span { font-size: 12px; line-height: 1.1; max-width: 84px; word-break: break-word; }

#top-bar { position: fixed; top: 0; left: 0; right: 0; height: var(--yaru-topbar-h); background: rgba(45,40,45,.92); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 14px; z-index: 9000; backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.06); }
#top-bar .activities-label { font-weight: 700; padding: 2px 10px; border-radius: 6px; cursor: pointer; }
#top-bar .activities-label:hover { background: rgba(255,255,255,.12); }
#top-bar .clock { cursor: pointer; padding: 2px 10px; border-radius: 6px; }
#top-bar .clock:hover { background: rgba(255,255,255,.12); }
#top-bar .tray { display: flex; align-items: center; gap: 8px; }
#top-bar .tray-item { cursor: pointer; padding: 2px 6px; border-radius: 6px; display: flex; align-items: center; gap: 4px; }
#top-bar .tray-item:hover { background: rgba(255,255,255,.12); }
#top-bar .tray-item svg { width: 18px; height: 18px; }

.popover { position: absolute; z-index: 10000; background: rgba(45,40,45,.96); border: 1px solid var(--yaru-border); border-radius: var(--yaru-radius-lg); box-shadow: var(--yaru-shadow); padding: 10px; color: #fff; min-width: 220px; animation: scaleIn .15s ease; backdrop-filter: blur(20px); }
.popover.hidden { display: none; }

#calendar-popover { top: 32px; right: 130px; width: 300px; }
#calendar-popover .cal-header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 8px; }
#calendar-popover .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; gap: 2px; }
#calendar-popover .cal-cell { padding: 6px 0; border-radius: 6px; cursor: default; }
#calendar-popover .cal-cell.today { background: var(--accent-color); color: #fff; font-weight: 700; }
#calendar-popover .cal-cell.dim { opacity: .45; }

#system-menu { top: 32px; right: 10px; width: 280px; }
#system-menu .sm-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
#system-menu .sm-row:hover { background: rgba(255,255,255,.1); }
#system-menu .sm-row svg { width: 20px; height: 20px; }
#system-menu .sm-section { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.1); }
#system-menu .sm-slider { -webkit-appearance: none; width: 100%; height: 4px; background: rgba(255,255,255,.2); border-radius: 2px; outline: none; margin: 8px 0; }
#system-menu .sm-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: #fff; border-radius: 50%; cursor: pointer; }

#notifications { position: fixed; top: 42px; right: 14px; width: 340px; z-index: 11000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
#notifications .toast { pointer-events: auto; background: rgba(45,40,45,.96); border-left: 4px solid var(--accent-color); border-radius: var(--yaru-radius); box-shadow: var(--yaru-shadow); padding: 12px; animation: slideInUp .25s ease; backdrop-filter: blur(16px); }
#notifications .toast .toast-title { font-weight: 700; font-size: 13px; }
#notifications .toast .toast-body { font-size: 12px; opacity: .85; margin-top: 3px; }
#notifications .toast .toast-close { float: right; opacity: .6; cursor: pointer; font-size: 16px; line-height: 1; }
#notifications .toast .toast-close:hover { opacity: 1; }

#dock { position: fixed; left: 0; top: var(--yaru-topbar-h); bottom: 0; width: var(--yaru-dock-w); background: rgba(40,38,40,.92); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 8px; z-index: 8000; backdrop-filter: blur(18px); border-right: 1px solid rgba(255,255,255,.06); }
#dock .dock-item { position: relative; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px; cursor: pointer; transition: transform .12s, background .12s; }
#dock .dock-item:hover { background: rgba(255,255,255,.12); }
#dock .dock-item svg { width: 34px; height: 34px; }
#dock .dock-item .dot { position: absolute; bottom: 4px; width: 6px; height: 6px; background: var(--accent-color); border-radius: 50%; }
#dock .dock-item .dot.urgent { background: var(--yaru-red); }
#dock .dock-item .dot.own-window { background: #fff; }
#dock .trash { margin-top: auto; margin-bottom: 10px; }

#activities-overlay { position: fixed; inset: 0; z-index: 7000; background: rgba(0,0,0,.65); opacity: 0; pointer-events: none; transition: opacity .22s ease; display: flex; flex-direction: column; padding: 50px 80px 30px 80px; backdrop-filter: blur(2px); }
#activities-overlay.active { opacity: 1; pointer-events: auto; }
#activities-overlay .overview-search { width: 600px; max-width: 80%; margin: 0 auto 20px; padding: 12px 18px; border-radius: 999px; border: none; background: rgba(255,255,255,.12); color: #fff; font-size: 16px; outline: none; backdrop-filter: blur(12px); }
#activities-overlay .overview-search::placeholder { color: rgba(255,255,255,.55); }
#activities-overlay .overview-top { display: flex; justify-content: space-between; align-items: center; }
#activities-overlay .workspaces { display: flex; gap: 14px; justify-content: center; margin-bottom: 20px; }
#activities-overlay .workspace-thumb { width: 220px; height: 130px; background: rgba(255,255,255,.08); border-radius: 10px; border: 2px solid transparent; position: relative; overflow: hidden; transition: transform .15s; }
#activities-overlay .workspace-thumb.active { border-color: var(--accent-color); }
#activities-overlay .workspace-thumb:hover { transform: scale(1.03); }
#activities-overlay .spread { flex: 1; display: flex; gap: 24px; align-items: center; justify-content: center; flex-wrap: wrap; overflow-y: auto; }
#activities-overlay .spread .spread-win { width: 260px; height: 160px; background: rgba(30,30,30,.85); border-radius: var(--yaru-radius); box-shadow: var(--yaru-shadow); display: flex; flex-direction: column; overflow: hidden; cursor: pointer; transition: transform .18s; border: 2px solid transparent; }
#activities-overlay .spread .spread-win:hover { transform: scale(1.04); border-color: var(--accent-color); }
#activities-overlay .spread .spread-win .stitle { padding: 8px 10px; font-size: 12px; background: rgba(0,0,0,.35); }
#activities-overlay .spread .spread-win .sbody { flex: 1; background-size: cover; }
#activities-overlay .app-grid { display: none; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 16px; padding: 20px; overflow-y: auto; }
#activities-overlay .app-grid.active { display: grid; }
#activities-overlay .app-grid .ag-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 8px; border-radius: var(--yaru-radius); cursor: pointer; transition: background .12s, transform .12s; color: #fff; }
#activities-overlay .app-grid .ag-item:hover { background: rgba(255,255,255,.12); transform: scale(1.05); }
#activities-overlay .app-grid .ag-item svg { width: 56px; height: 56px; }
#activities-overlay .app-grid .ag-item span { font-size: 13px; text-align: center; }
#activities-overlay .app-grid .ag-folder { background: rgba(255,255,255,.06); }
#activities-overlay .app-grid .ag-paginator { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 12px; opacity: .6; }

.window { position: absolute; background: #2d2d2d; border-radius: var(--yaru-radius-lg); box-shadow: var(--yaru-shadow); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.1); min-width: 180px; min-height: 120px; animation: scaleIn .13s ease; z-index: 100; }
.window.minimized { display: none; }
.window.focused { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color), var(--yaru-shadow); }
.window.maximized { border-radius: 0; border: none; inset: var(--yaru-topbar-h) 0 0 var(--yaru-dock-w) !important; width: auto !important; height: auto !important; }
.window.tiled-left { border-radius: 0; left: var(--yaru-dock-w) !important; top: var(--yaru-topbar-h) !important; width: calc(50% - var(--yaru-dock-w) / 2) !important; height: calc(100% - var(--yaru-topbar-h)) !important; }
.window.tiled-right { border-radius: 0; left: calc(50% + var(--yaru-dock-w) / 2) !important; top: var(--yaru-topbar-h) !important; width: calc(50% - var(--yaru-dock-w) / 2) !important; height: calc(100% - var(--yaru-topbar-h)) !important; }

.window-titlebar { height: var(--yaru-window-titlebar-h); background: linear-gradient(180deg, rgba(255,255,255,.06), transparent); display: flex; align-items: center; justify-content: space-between; padding: 0 10px; user-select: none; cursor: default; }
.window.focused .window-titlebar { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-color) 20%, transparent), transparent); }
.window-titlebar .title { font-size: 13px; font-weight: 600; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.window-titlebar .window-controls { display: flex; gap: 8px; }
.window-titlebar .wbtn { width: 15px; height: 15px; border-radius: 50%; border: none; cursor: pointer; display: grid; place-items: center; transition: filter .1s; }
.window-titlebar .wbtn:hover { filter: brightness(1.15); }
.window-titlebar .wbtn.close { background: var(--yaru-red); }
.window-titlebar .wbtn.min { background: var(--yaru-yellow); }
.window-titlebar .wbtn.max { background: var(--yaru-green); }
.window-titlebar .wbtn svg { width: 7px; height: 7px; fill: #000; opacity: .8; }

.window-content { flex: 1; overflow: auto; position: relative; background: #2b2929; color: #f7f7f7; }

.resize-handle { position: absolute; z-index: 5; }
.resize-handle.n { top: 0; left: 8px; right: 8px; height: 6px; cursor: n-resize; }
.resize-handle.e { top: 8px; right: 0; bottom: 8px; width: 6px; cursor: e-resize; }
.resize-handle.s { bottom: 0; left: 8px; right: 8px; height: 6px; cursor: s-resize; }
.resize-handle.w { top: 8px; left: 0; bottom: 8px; width: 6px; cursor: w-resize; }
.resize-handle.ne { top: 0; right: 0; width: 12px; height: 12px; cursor: ne-resize; }
.resize-handle.nw { top: 0; left: 0; width: 12px; height: 12px; cursor: nw-resize; }
.resize-handle.se { bottom: 0; right: 0; width: 12px; height: 12px; cursor: se-resize; }
.resize-handle.sw { bottom: 0; left: 0; width: 12px; height: 12px; cursor: sw-resize; }

#context-menu, .context-menu { position: fixed; z-index: 12000; background: rgba(45,40,45,.98); border: 1px solid var(--yaru-border); border-radius: var(--yaru-radius); box-shadow: var(--yaru-shadow); padding: 6px 0; min-width: 180px; animation: scaleIn .1s ease; }
#context-menu .cm-item, .context-menu .cm-item { padding: 8px 14px; font-size: 13px; display: flex; align-items: center; gap: 10px; cursor: pointer; color: #fff; }
#context-menu .cm-item:hover, .context-menu .cm-item:hover { background: var(--accent-color); }
#context-menu .cm-item.disabled, .context-menu .cm-item.disabled { opacity: .4; pointer-events: none; }
#context-menu .cm-sep, .context-menu .cm-sep { height: 1px; background: rgba(255,255,255,.12); margin: 5px 0; }

#modal-overlay { position: fixed; inset: 0; z-index: 15000; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
#modal-overlay.active { display: flex; }
.modal { background: #333; border-radius: var(--yaru-radius-lg); box-shadow: var(--yaru-shadow); width: 420px; max-width: 90%; padding: 20px; color: #fff; animation: scaleIn .15s ease; }
.modal .modal-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.modal .modal-body { font-size: 13px; line-height: 1.4; margin-bottom: 20px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal .btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; }
.modal .btn.primary { background: var(--accent-color); color: #fff; }
.modal .btn.default { background: rgba(255,255,255,.12); color: #fff; }
.modal .btn:hover { filter: brightness(1.1); }

#tooltip { position: fixed; z-index: 13000; background: rgba(0,0,0,.85); color: #fff; padding: 5px 9px; border-radius: 6px; font-size: 12px; pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity .12s; }
#tooltip.visible { opacity: 1; }
