/* BioStudio AI — window chrome (Windows 11) */

.window {
  position: absolute;
  min-width: 260px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  background: var(--win-bg);
  border: 1px solid var(--win-border);
  border-radius: 8px;
  box-shadow: var(--win-shadow);
  overflow: hidden;
  transform-origin: center;
  animation: window-pop 0.16s ease;
  color: var(--ink);
}

@keyframes window-pop {
  from { transform: scale(0.97); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.window.dragging { transition: none; user-select: none; will-change: left, top; }
.window.focused { box-shadow: var(--win-shadow-focus); border-color: var(--win-border-focus); }
.window:not(.focused) .window-titlebar { opacity: 0.72; }
.window.minimized { display: none; }
/* Windows that live on another virtual desktop stay mounted but hidden. */
.window.on-other-desktop { display: none !important; }
.window.maximized { border-radius: 0; border-color: transparent; }
.window.snapped { border-radius: 8px; }
.window.drop-target { outline: 2px dashed var(--accent, #2f6bff); outline-offset: -2px; }
.window.drop-target::after {
  content: "Drop to import";
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--accent, #2f6bff); color: #fff; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; pointer-events: none; z-index: 5; box-shadow: 0 6px 24px rgba(0,0,0,.25);
}

.window.closing { animation: window-close 0.12s ease forwards; }
@keyframes window-close { to { transform: scale(0.97); opacity: 0; } }

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 0 0 14px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--win-border);
  cursor: default;
  flex: 0 0 auto;
  transition: opacity 0.15s ease;
}

.window-title-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
}
.window-title-icon .icon, .window-title-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.window-title-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.window-controls { display: flex; align-items: stretch; height: 100%; }

.win-btn {
  width: 46px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--ink);
  transition: background 0.1s ease, color 0.1s ease;
}
.win-btn svg { width: 16px; height: 16px; }
.win-btn:hover { background: rgba(127, 127, 127, 0.18); }
.win-btn.close:hover { background: #e81123; color: #fff; }

.window-body {
  flex: 1 1 auto;
  overflow: auto;
  background: var(--win-body-bg);
  position: relative;
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 5;
}

.app-crash { padding: 18px; color: #d11; font-size: 13px; }
.app-crash pre { margin-top: 8px; white-space: pre-wrap; font-size: 11px; color: var(--ink-soft); }

:root {
  --win-bg: rgba(249, 249, 251, 0.92);
  --win-body-bg: #fbfbfd;
  --win-border: rgba(0, 0, 0, 0.1);
  --win-border-focus: rgba(0, 0, 0, 0.16);
  --titlebar-bg: rgba(245, 246, 249, 0.9);
  --win-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  --win-shadow-focus: 0 18px 50px rgba(0, 0, 0, 0.32);
}
.dark {
  --win-bg: rgba(32, 32, 38, 0.94);
  --win-body-bg: #1f1f25;
  --win-border: rgba(255, 255, 255, 0.09);
  --win-border-focus: rgba(255, 255, 255, 0.16);
  --titlebar-bg: rgba(40, 40, 47, 0.92);
  --win-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  --win-shadow-focus: 0 18px 50px rgba(0, 0, 0, 0.6);
}
