/* ==========================================================================
   dotvoid — Aero glass windows, menus bars, dialogs
   ========================================================================== */

#windows {
  position: absolute; inset: 0 0 var(--taskbar-h) 0;
  pointer-events: none;
}

.window {
  --frame: 7px;
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  padding: 0 var(--frame) var(--frame);
  border: 1px solid rgba(0, 0, 0, .62);
  border-radius: 8px 8px 6px 6px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .42) 0, rgba(255, 255, 255, .14) 30px, rgba(255, 255, 255, .06) 70%, rgba(255, 255, 255, .14) 100%),
    rgba(var(--glass-rgb), var(--glass-alpha));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .5),
    0 12px 40px rgba(0, 10, 30, .42),
    0 2px 8px rgba(0, 10, 30, .3);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  pointer-events: auto;
  user-select: none; -webkit-user-select: none;
  transition: background-color .25s, box-shadow .25s;
  contain: layout;
}
/* diagonal Aero light streaks across the glass */
.window::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(118deg, transparent 0 14%, rgba(255, 255, 255, .22) 19%, rgba(255, 255, 255, .06) 23%, transparent 26% 47%, rgba(255, 255, 255, .16) 51%, rgba(255, 255, 255, .04) 55%, transparent 58% 78%, rgba(255, 255, 255, .12) 82%, transparent 86%);
}
.window:not(.active) {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .34) 0, rgba(255, 255, 255, .12) 30px, rgba(255, 255, 255, .08)),
    rgba(var(--glass-rgb), calc(var(--glass-alpha) * .55));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 6px 22px rgba(0, 10, 30, .3);
}

.no-transparency .window,
.no-transparency #start-menu,
.no-transparency .flyout {
  -webkit-backdrop-filter: none; backdrop-filter: none;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, .42), rgba(255, 255, 255, .1) 30px, rgba(255, 255, 255, .04)),
    rgb(var(--glass-solid));
}
.no-transparency #taskbar { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: #1a2333; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .window { background-color: rgba(var(--glass-solid), .94); }
  #taskbar { background-color: rgba(14, 22, 38, .9); }
  #start-menu, .flyout { background-color: rgba(30, 44, 70, .94); }
}

/* --------------------------------------------------------------- title bar */
.win-titlebar {
  position: relative; z-index: 1; flex: none;
  height: 30px; display: flex; align-items: center; gap: 6px;
  padding: 0 112px 0 2px;
  touch-action: none;
}
.win-titlebar .win-icon { width: 16px; height: 16px; flex: none; }
.win-title {
  margin: 0; min-width: 0; flex: 1;
  font-size: 13px; font-weight: 400; color: #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 0 9px #fff, 0 0 6px #fff, 0 0 3px #fff, 0 0 1px #fff;
}
.window:not(.active) .win-title { color: #3b3b3b; }
.window.no-title .win-title { visibility: hidden; }

.win-caption {
  position: absolute; top: -1px; right: 0; z-index: 2;
  display: flex;
}
.cap-btn {
  position: relative; width: 27px; height: 20px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid rgba(0, 0, 0, .58); border-top: 0; border-left-width: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, .22) 45%, rgba(255, 255, 255, .05) 50%, rgba(255, 255, 255, .25) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
  transition: background .15s, box-shadow .15s;
}
.cap-btn:first-child { border-left-width: 1px; border-bottom-left-radius: 5px; }
.cap-btn:last-child { border-bottom-right-radius: 5px; }
.cap-btn svg { width: 13px; height: 11px; fill: #fff; filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px rgba(0, 0, 0, .7)); }
.cap-close { width: 44px; }
.window.active .cap-close {
  background: linear-gradient(to bottom, #e9a99a 0, #d97a63 45%, #c54522 50%, #d47b55 100%);
}
@media (hover: hover) {
  .cap-btn:hover {
    background: linear-gradient(to bottom, #b6e3fb 0, #6cbdea 45%, #2b8ad6 50%, #63c9f5 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 0 9px 1px rgba(110, 200, 255, .9);
    z-index: 1;
  }
  .cap-close:hover,
  .window.active .cap-close:hover {
    background: linear-gradient(to bottom, #f6bfae 0, #ec7457 45%, #d6370f 50%, #f4955a 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 0 12px 2px rgba(255, 110, 60, .85);
  }
}
.cap-btn:active { filter: brightness(.82); }
.cap-btn[hidden] + .cap-btn { border-left-width: 1px; }

/* ------------------------------------------------------------------ body */
.win-body {
  position: relative; z-index: 1;
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid rgba(0, 0, 0, .5);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .45);
  overflow: hidden;
  user-select: text; -webkit-user-select: text;
}
.win-body.glass {
  background: transparent; border: 0; box-shadow: none;
}

/* ------------------------------------------------------------- resize grips */
.win-resize { position: absolute; z-index: 3; touch-action: none; }
.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: 14px; height: 14px; cursor: ne-resize; }
.win-resize.nw { top: -4px; left: -4px; width: 14px; height: 14px; 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: 14px; height: 14px; cursor: sw-resize; }
.window.no-resize .win-resize,
.window.maximized .win-resize { display: none; }

/* ------------------------------------------------- maximized / snapped states */
.window.maximized,
.window.snap-left,
.window.snap-right {
  top: 0 !important; height: 100% !important;
}
.window.maximized { left: 0 !important; width: 100% !important; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; --frame: 4px; }
.window.snap-left { left: 0 !important; width: 50% !important; }
.window.snap-right { left: 50% !important; width: 50% !important; }
.window.maximized .win-titlebar { height: 26px; }
.window.maximized .win-caption { top: 0; }
.window.win-anim { transition: left .2s var(--ease-out), top .2s var(--ease-out), width .2s var(--ease-out), height .2s var(--ease-out), background-color .25s, box-shadow .25s; }
.window.dragging,
.window.resizing { transition: none; }
.window.minimized { visibility: hidden; pointer-events: none; }

#snap-preview {
  position: absolute; z-index: 0; display: none; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 8px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .35), rgba(var(--glass-rgb), .25));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 0 30px rgba(140, 210, 255, .5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: left .15s, top .15s, width .15s, height .15s, opacity .15s;
}
#snap-preview.show { display: block; animation: fade-in .15s; }

/* modal blocking */
.window .modal-shield { position: absolute; inset: 0; z-index: 10; display: none; border-radius: inherit; }
.window.blocked .modal-shield { display: block; }
.window.attention { animation: attention .12s linear 4 alternate; }
@keyframes attention { to { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 0 0 3px rgba(255, 255, 255, .7), 0 12px 40px rgba(0, 10, 30, .42); } }

/* ----------------------------------------------------------------- menubar */
.menubar {
  flex: none; display: flex; align-items: center; height: 24px; padding: 0 2px;
  background: linear-gradient(to bottom, #fcfdfe, #e6ecf5);
  border-bottom: 1px solid #b6c4d6;
  user-select: none; -webkit-user-select: none;
}
.menubar-item {
  height: 21px; padding: 0 8px; border: 1px solid transparent; border-radius: 3px;
  background: transparent; font-size: 12.5px;
}
@media (hover: hover) { .menubar-item:hover { border-color: var(--menu-hl-border); background: var(--menu-hl-bg); } }
.menubar-item.open { border-color: #7da2ce; background: linear-gradient(#e2eefb, #c4dbf5); }

/* ------------------------------------------------------------- toolbars */
.cmdbar {
  flex: none; display: flex; align-items: center; gap: 2px; min-height: 32px; padding: 2px 6px;
  background: linear-gradient(to bottom, #7c97b3 0%, #58779a 48%, #45648a 52%, #5c80a6 100%);
  border-bottom: 1px solid #2f4763;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  color: #fff; user-select: none; -webkit-user-select: none;
  overflow-x: auto; scrollbar-width: none;
}
.cmdbar::-webkit-scrollbar { display: none; }
.cmd-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; flex: none;
  border: 1px solid transparent; border-radius: 3px; background: transparent;
  color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .45); white-space: nowrap;
}
.cmd-btn img,
.cmd-btn > svg { width: 16px; height: 16px; flex: none; }
.cmd-btn .caret { width: 7px; height: 7px; opacity: .9; }
@media (hover: hover) {
  .cmd-btn:hover {
    border-color: rgba(255, 255, 255, .45);
    background: linear-gradient(to bottom, rgba(255, 255, 255, .38), rgba(255, 255, 255, .12) 50%, rgba(255, 255, 255, .02) 50%, rgba(255, 255, 255, .2));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
  }
}
.cmd-btn:active,
.cmd-btn.on { background: rgba(0, 0, 0, .22); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); }
.cmd-btn:disabled { opacity: .5; pointer-events: none; }
.cmd-sep { width: 1px; height: 20px; margin: 0 4px; background: rgba(0, 0, 0, .3); box-shadow: 1px 0 0 rgba(255, 255, 255, .25); flex: none; }
.cmdbar .spacer { flex: 1; }

.toolbar-light {
  flex: none; display: flex; align-items: center; gap: 4px; padding: 4px 6px;
  background: linear-gradient(to bottom, #fbfcfd, #e9eef5);
  border-bottom: 1px solid #c3cfdd;
  user-select: none; -webkit-user-select: none;
}

.statusbar {
  flex: none; display: flex; align-items: center; gap: 12px; height: 23px; padding: 0 10px;
  background: linear-gradient(to bottom, #f4f6f9, #e3e8ef);
  border-top: 1px solid #c2cbd7;
  font-size: 12px; color: #333;
  user-select: none; -webkit-user-select: none;
}
.statusbar .grow { flex: 1; }
.statusbar .sb-cell { padding-left: 12px; border-left: 1px solid #c8d0db; white-space: nowrap; }

/* ----------------------------------------------------------- message boxes */
.msgbox { display: flex; flex-direction: column; min-height: 100%; }
.msgbox-main { flex: 1; display: flex; gap: 14px; align-items: flex-start; padding: 18px 18px 22px; background: #fff; }
.msgbox-main .mb-icon { width: 32px; height: 32px; flex: none; }
.msgbox-text { flex: 1; min-width: 0; padding-top: 2px; }
.msgbox-text .mb-title { margin: 0 0 6px; font-size: 15px; font-weight: 400; color: #1d3f84; }
.msgbox-text p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msgbox-text .input { width: 100%; margin-top: 10px; }
.msgbox-foot {
  flex: none; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 11px 12px;
  background: #f0f0f0; border-top: 1px solid #dfdfdf;
}

/* ------------------------------------------------------------ file dialog */
.filedlg { display: flex; flex-direction: column; height: 100%; background: #fff; }
.filedlg-top { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: linear-gradient(#f6f9fc, #e8eef6); border-bottom: 1px solid #c8d3e0; }
.filedlg-top .crumb { flex: 1; }
.filedlg-main { flex: 1; display: flex; min-height: 0; }
.filedlg-nav { flex: 0 0 132px; padding: 8px 4px; border-right: 1px solid #dde4ee; background: #f7f9fc; overflow: auto; }
.filedlg-list { flex: 1; overflow: auto; padding: 4px; }
.filedlg-bottom { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; padding: 10px 12px; border-top: 1px solid #dde4ee; background: #f4f6f9; }
.filedlg-bottom label { text-align: right; color: #333; }
.filedlg-bottom .input { width: 100%; }
.filedlg-btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.filedlg-bottom label.filedlg-opt { grid-column: 2; justify-self: start; text-align: left; display: flex; gap: 6px; align-items: center; }

/* generic list rows used by dialogs & explorer details view */
.row-item {
  display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 8px; margin: 1px 0;
  border: 1px solid transparent; border-radius: 3px;
  white-space: nowrap; user-select: none; -webkit-user-select: none;
}
.row-item img { width: 16px; height: 16px; flex: none; }
.row-item .ri-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.row-item .ri-meta { color: #6d7683; font-size: 12px; }
@media (hover: hover) { .row-item:hover { border-color: var(--hover-border); background: var(--hover-bg); } }
.row-item.selected { border-color: var(--sel-border); background: var(--sel-bg); }
.nav-link {
  display: flex; align-items: center; gap: 7px; width: 100%; height: 26px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 3px; background: transparent; text-align: left; color: #1b3c6b;
}
.nav-link img { width: 16px; height: 16px; }
@media (hover: hover) { .nav-link:hover { border-color: var(--hover-border); background: var(--hover-bg); } }
.nav-link.current { border-color: var(--sel-border); background: var(--sel-bg); }
