/* ===================== Windows (Mint-Y / Muffin) ===================== */
.mint-window {
  position: absolute;
  display: flex; flex-direction: column;
  background: var(--win-bg); color: var(--win-fg);
  border: 1px solid var(--win-border);
  border-radius: var(--radius) var(--radius) 4px 4px;
  box-shadow: var(--shadow-blur);
  min-width: 220px; min-height: 140px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.mint-window.focused { box-shadow: var(--shadow-focus); }
.mint-window.maximized { border-radius: 0; border: none; }
.mint-window.snapped { border-radius: 0; }
.mint-window.opening { animation: winOpen 0.18s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes winOpen { from { opacity: 0; transform: scale(0.92); } }
.mint-window.closing { animation: winClose 0.15s ease-in forwards; pointer-events: none; }
@keyframes winClose { to { opacity: 0; transform: scale(0.92); } }
.mint-window.minimizing { transition: transform 0.24s cubic-bezier(0.5, 0, 0.9, 0.4), opacity 0.24s; pointer-events: none; }
.mint-window.restoring { transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.22s; }
.mint-window.geo-anim { transition: left 0.16s ease-out, top 0.16s ease-out, width 0.16s ease-out, height 0.16s ease-out; }

/* Titlebar */
.win-titlebar {
  height: 34px; flex-shrink: 0;
  display: flex; align-items: center;
  background: var(--titlebar-bg); color: var(--titlebar-fg);
  border-bottom: 1px solid var(--win-border);
  padding: 0 6px 0 10px; gap: 8px;
  position: relative;
}
.mint-window:not(.focused) .win-titlebar { background: var(--titlebar-unfocused-bg); color: var(--titlebar-unfocused-fg); }
.win-title-icon { width: 17px; height: 17px; flex-shrink: 0; }
.mint-window:not(.focused) .win-title-icon { opacity: 0.6; filter: grayscale(0.4); }
.win-title-text {
  flex: 1; text-align: center; font-weight: 600; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  position: absolute; left: 60px; right: 110px; pointer-events: none;
}
.win-buttons { display: flex; gap: 4px; margin-left: auto; z-index: 2; }
.win-btn {
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: transparent; color: inherit;
  display: flex; align-items: center; justify-content: center;
}
.win-btn svg { opacity: 0.75; }
.win-btn:hover { background: var(--hover-bg); }
.win-btn:hover svg { opacity: 1; }
.win-btn:active { background: var(--press-bg); }
.win-btn.win-close:hover { background: #d4574e; color: #fff; }
.win-btn.win-close:active { background: #b8443c; }
.mint-window:not(.focused) .win-btn svg { opacity: 0.45; }

/* Resize handles */
.rsz { position: absolute; z-index: 3; }
.rsz-n  { top: -4px; left: 8px; right: 8px; height: 8px; cursor: n-resize; }
.rsz-s  { bottom: -4px; left: 8px; right: 8px; height: 8px; cursor: s-resize; }
.rsz-e  { right: -4px; top: 8px; bottom: 8px; width: 8px; cursor: e-resize; }
.rsz-w  { left: -4px; top: 8px; bottom: 8px; width: 8px; cursor: w-resize; }
.rsz-ne { top: -5px; right: -5px; width: 13px; height: 13px; cursor: ne-resize; }
.rsz-nw { top: -5px; left: -5px; width: 13px; height: 13px; cursor: nw-resize; }
.rsz-se { bottom: -5px; right: -5px; width: 13px; height: 13px; cursor: se-resize; }
.rsz-sw { bottom: -5px; left: -5px; width: 13px; height: 13px; cursor: sw-resize; }
.mint-window.maximized .rsz, .mint-window.snapped .rsz-n { display: none; }

/* Window content */
.win-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; background: var(--content-bg); position: relative; }

/* Toolbar look shared by apps */
.app-toolbar {
  display: flex; align-items: center; gap: 4px; padding: 5px 8px;
  background: var(--win-bg); border-bottom: 1px solid var(--win-border);
  flex-shrink: 0;
}
.tb-btn {
  border: 1px solid transparent; background: transparent; color: var(--win-fg);
  padding: 5px 8px; border-radius: 5px; display: flex; align-items: center; gap: 6px; font-size: 12.5px;
}
.tb-btn:hover { background: var(--hover-bg); }
.tb-btn:active { background: var(--press-bg); }
.tb-btn.disabled { opacity: 0.4; pointer-events: none; }
.tb-btn.active { background: var(--press-bg); border-color: var(--btn-border); }
.tb-sep { width: 1px; height: 20px; background: var(--win-border); margin: 0 4px; }
.tb-spacer { flex: 1; }
.tb-input {
  background: var(--input-bg); border: 1px solid var(--input-border); color: var(--win-fg);
  border-radius: 5px; padding: 5px 9px; font-size: 12.5px; outline: none;
}
.tb-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(146,179,114,0.25); }

/* Alt-tab switcher */
#alt-tab {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 9100; display: none; gap: 10px; padding: 16px;
  background: rgba(32,32,32,0.95); border-radius: 12px; border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 44px rgba(0,0,0,0.55); max-width: 80vw; flex-wrap: wrap; justify-content: center;
}
#alt-tab.visible { display: flex; }
.at-item {
  width: 108px; padding: 12px 6px 8px; border-radius: 8px; text-align: center; color: #ccc;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.at-item img, .at-item .at-ico { width: 44px; height: 44px; }
.at-item span { font-size: 11.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-item.current { background: rgba(146,179,114,0.3); outline: 1px solid var(--accent); color: #fff; }

/* Statusbar shared */
.app-statusbar {
  height: 26px; flex-shrink: 0; display: flex; align-items: center; gap: 14px;
  padding: 0 12px; font-size: 12px; color: var(--win-fg-dim);
  background: var(--win-bg); border-top: 1px solid var(--win-border);
}
