/* ============================================================
   window.css — ウィンドウ共通（DESIGN.md準拠）
   ============================================================ */
.window {
  position: absolute;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-window), 0 0 0 1px rgba(0,0,0,0.04);
  overflow: hidden;
}
.window.maximized { border-radius: 0; border: none; }

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 36px;
  background: #3b5998;
  cursor: grab;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.15);
}
.window-titlebar:active { cursor: grabbing; }
.window-title {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
}
.window-controls { display: flex; gap: 6px; }
.win-btn {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.win-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.win-close:hover { background: var(--danger); color: #fff; }

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

/* リサイズハンドル */
.resize-handle { position: absolute; }
.resize-n { top: -3px; left: 8px; right: 8px; height: 6px; cursor: n-resize; }
.resize-s { bottom: -3px; left: 8px; right: 8px; height: 6px; cursor: s-resize; }
.resize-e { right: -3px; top: 8px; bottom: 8px; width: 6px; cursor: e-resize; }
.resize-w { left: -3px; top: 8px; bottom: 8px; width: 6px; cursor: w-resize; }
.resize-ne { top: -3px; right: -3px; width: 12px; height: 12px; cursor: ne-resize; }
.resize-nw { top: -3px; left: -3px; width: 12px; height: 12px; cursor: nw-resize; }
.resize-se { bottom: -3px; right: -3px; width: 12px; height: 12px; cursor: se-resize; }
.resize-sw { bottom: -3px; left: -3px; width: 12px; height: 12px; cursor: sw-resize; }
.maximized .resize-handle { display: none; }

/* ============================================================
   モバイル対応 — ウィンドウをフルスクリーン化
   ============================================================ */
@media (max-width: 768px) {
  .window {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 48px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 100 !important;
  }
  .window-titlebar {
    height: 44px;
    padding: 0 12px;
  }
  .win-minimize { display: none; }
  .win-maximize { display: none; }
  .win-close { width: 28px; height: 28px; font-size: 14px; }
  .resize-handle { display: none; }
}
