/* window.css — ウィンドウの枠、タイトルバー、ボタンなど */

.window {
    width: 480px; 
    height: 600px;
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    transition: box-shadow 0.3s ease;
    z-index: 100;
}

.window.dragging,
.window.resizing {
    transition: none;
}

/* フォーカス中のウィンドウ */
.window.window-focused {
    --md-elevation-level: 2;
}

/* 最大化アニメーション */
.window.maximizing {
    transition: all 0.2s ease;
}

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

.window.maximized {
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    border-radius: 0;
}

.window.maximized .window-content {
    border-radius: 0;
}

.window.maximized .title-bar {
    cursor: default;
}

/* 最小化アニメーション */
.window.minimizing {
    transition: all 0.2s ease;
}

.window-content {
    display: flex; 
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--md-sys-color-surface); 
    border-radius: 10px;
    overflow: hidden; 
    position: relative;
    z-index: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* 閉じるアニメーション */
.window-content.closing {
    opacity: 0;
    transform: scale(0.95);
}

/* 最小化アニメーション */
.window-content.minimizing {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
}

.title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 0px 0px 0px 16px;
    background: var(--md-sys-color-surface-dim);
    border-bottom: 1px solid #e0e0e0;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    z-index: 1;
}

.title-bar-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.title-text {
    font-size: auto;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    letter-spacing: 0.25px;
}

.title-bar-right {
    display: flex;
    align-items: center;
}

md-icon-button {
    --md-icon-button-icon-size: 20px;
}

.resize-handle {
    position: absolute;
    z-index: 10;
}

.handle-t {
    top: -4px;
    left: 4px;
    right: 4px;
    height: 8px;
    cursor: ns-resize;
}

.handle-b {
    bottom: -4px;
    left: 4px;
    right: 4px;
    height: 8px;
    cursor: ns-resize;
}

.handle-l {
    left: -4px;
    top: 4px;
    bottom: 4px;
    width: 8px;
    cursor: ew-resize;
}

.handle-r {
    right: -4px;
    top: 4px;
    bottom: 4px;
    width: 8px;
    cursor: ew-resize;
}

.handle-tl {
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    cursor: nwse-resize;
}

.handle-tr {
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    cursor: nesw-resize;
}

.handle-bl {
    bottom: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    cursor: nesw-resize;
}

.handle-br {
    bottom: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    cursor: nwse-resize;
}
