/* Window Styling */
.window {
    position: absolute;
    background: linear-gradient(to bottom, #c6c6c6 0%, #c0c0c0 50%, #b8b8b8 100%);
    border: 1px solid #808080;
    border-top-color: #dfdfdf;
    border-left-color: #dfdfdf;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3), inset 1px 1px 0 #ffffff;
    min-width: 200px;
    min-height: 100px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    border-radius: 2px;
    transform-origin: center center;
}

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

.window.minimizing {
    pointer-events: none;
}

.window.restoring {
    pointer-events: none;
}

.window.active {
    z-index: 200;
}

.window-titlebar {
    height: 18px;
    background: linear-gradient(90deg, #0080ff 0%, #0060d0 50%, #004080 100%);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 4px;
    cursor: move;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #808080;
}

.window-titlebar.inactive {
    background: linear-gradient(90deg, #808080 0%, #a0a0a0 50%, #c0c0c0 100%);
    color: #c0c0c0;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.window-title {
    flex: 1;
    padding-left: 4px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.window-controls {
    display: flex;
    gap: 2px;
}

.window-control {
    width: 16px;
    height: 14px;
    background: linear-gradient(to bottom, #d4d4d4 0%, #c0c0c0 50%, #b0b0b0 100%);
    border: 1px solid #808080;
    border-top-color: #dfdfdf;
    border-left-color: #dfdfdf;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    border-radius: 1px;
}

.window-control:hover {
    background: linear-gradient(to bottom, #e0e0e0 0%, #d0d0d0 50%, #c0c0c0 100%);
}

.window-control:active {
    background: linear-gradient(to bottom, #a0a0a0 0%, #b0b0b0 50%, #c0c0c0 100%);
    border-top-color: #808080;
    border-left-color: #808080;
    border-right-color: #dfdfdf;
    border-bottom-color: #dfdfdf;
    box-shadow: inset -1px -1px 0 #ffffff, inset 1px 1px 0 #808080;
}

.window-control.minimize::after {
    content: '_';
    margin-top: 4px;
}

.window-control.maximize::after {
    content: '□';
}

.window.maximized .window-control.maximize::after {
    content: '❐';
}

.window-control.close::after {
    content: '×';
}

.window-menubar {
    height: 20px;
    background: var(--win95-gray);
    border-bottom: 1px solid var(--win95-dark-gray);
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.window-menu-item {
    padding: 2px 8px;
    cursor: pointer;
    font-size: 11px;
}

.window-menu-item:hover {
    background: var(--win95-blue);
    color: white;
}

.window-content {
    flex: 1;
    overflow: auto;
    background: white;
}

.window-statusbar {
    height: 20px;
    background: var(--win95-gray);
    border-top: var(--border-sunken);
    display: flex;
    align-items: center;
    padding: 0 4px;
    font-size: 10px;
}

/* Resize handles */
.window-resize-handle {
    position: absolute;
    background: transparent;
}

.window-resize-handle.n {
    top: -2px;
    left: 2px;
    right: 2px;
    height: 4px;
    cursor: n-resize;
}

.window-resize-handle.s {
    bottom: -2px;
    left: 2px;
    right: 2px;
    height: 4px;
    cursor: s-resize;
}

.window-resize-handle.w {
    left: -2px;
    top: 2px;
    bottom: 2px;
    width: 4px;
    cursor: w-resize;
}

.window-resize-handle.e {
    right: -2px;
    top: 2px;
    bottom: 2px;
    width: 4px;
    cursor: e-resize;
}

.window-resize-handle.nw {
    top: -2px;
    left: -2px;
    width: 4px;
    height: 4px;
    cursor: nw-resize;
}

.window-resize-handle.ne {
    top: -2px;
    right: -2px;
    width: 4px;
    height: 4px;
    cursor: ne-resize;
}

.window-resize-handle.sw {
    bottom: -2px;
    left: -2px;
    width: 4px;
    height: 4px;
    cursor: sw-resize;
}

.window-resize-handle.se {
    bottom: -2px;
    right: -2px;
    width: 4px;
    height: 4px;
    cursor: se-resize;
}