/* ============================================================
   WINDOW CHROME
   Retro Windows style with 3D beveled borders
   ============================================================ */

.win7-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--win-bg);
  box-shadow: var(--win-shadow);
  min-width: 280px;
  min-height: 200px;
  transition: background 0.3s;
  overflow: hidden;
  pointer-events: auto;
}

.win7-window.maximized {
  border-width: 0 !important;
  box-shadow: none !important;
}

/* ---- titlebar ---- */
.win7-titlebar {
  background: var(--tb-bg);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
}

.win7-window.inactive .win7-titlebar {
  opacity: 0.7;
}

.win7-dots {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: filter 0.1s;
}

.dot:hover {
  filter: brightness(1.2);
}

.dot-close { background: var(--dot-close); }
.dot-minimize { background: var(--dot-minimize); }
.dot-maximize { background: var(--dot-maximize); }

.win7-titlebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  image-rendering: pixelated;
}

.win7-titlebar-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--tb-text);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- content area ---- */
.win7-content {
  flex: 1;
  overflow-y: auto;
  background: var(--content-bg);
  margin: 2px;
  padding: 8px;
  transition: background 0.3s;
}

/* ---- statusbar ---- */
.win7-statusbar {
  background: var(--status-bg);
  border-top: 1px solid var(--status-border);
  padding: 2px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  transition: background 0.3s;
}

.win7-statusbar span {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--status-text);
}

/* ---- resize handles ---- */
.win7-resize {
  position: absolute;
}

.win7-resize-n,
.win7-resize-s {
  left: 8px;
  right: 8px;
  height: 5px;
  cursor: ns-resize;
}

.win7-resize-e,
.win7-resize-w {
  top: 8px;
  bottom: 8px;
  width: 5px;
  cursor: ew-resize;
}

.win7-resize-n { top: -3px; }
.win7-resize-s { bottom: -3px; }
.win7-resize-e { right: -3px; }
.win7-resize-w { left: -3px; }

.win7-resize-ne {
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}

.win7-resize-nw {
  top: -3px;
  left: -3px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}

.win7-resize-se {
  bottom: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}

.win7-resize-sw {
  bottom: -3px;
  left: -3px;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}

.win7-window.maximized .win7-resize {
  display: none;
}

/* ---- animations ---- */
@keyframes windowOpen {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.win7-window {
  animation: windowOpen 0.2s ease-out both;
}
