/* windows.css */

.window {
    position: absolute;
    background-color: var(--window-bg-color, #fff);
    border: 1px solid var(--window-border-color, #e0e0e0);
    border-radius: var(--window-border-radius, 5px);
    box-shadow: 0 2px 10px var(--window-shadow-color, rgba(0, 0, 0, 0.1));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: var(--window-min-width, 200px);
    min-height: var(--window-min-height, 150px);
    transition: box-shadow 0.3s ease;
}

.window-header {
    padding: 8px;
    display: flex;
    align-items: center;
    color: var(--window-header-text-color, white);
    user-select: none;
    cursor: move;
}

.window-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.window-icon.emoji {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

.window-title {
    flex-grow: 1;
    font-weight: bold;
    user-select: none;
}

.window-controls {
    display: flex;
}

.window-controls button {
    width: 24px;
    height: 24px;
    border: none;
    background-color: transparent;
    color: var(--window-control-color, white);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
}

.window-controls button:hover {
    background-color: var(--window-control-hover-color, rgba(255, 255, 255, 0.1));
}

.window-content {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.window-content iframe {
    position: absolute;
    border: none;
    transform-origin: top left;
}

.window-ribbon {
    height: 2px;
    width: 100%;
}

.window.maximized {
    width: 100% !important;
    height: calc(100% - var(--taskbar-height, 40px)) !important;
    left: 0 !important;
    top: 0 !important;
    border-radius: 0;
}

.window-highlighted {
    box-shadow: 0 0 15px var(--window-highlight-shadow-color, rgba(0, 0, 0, 0.2)), 0 0 0 2px var(--window-highlight-border-color, #FFA500);
}

/* Resize handles */
.resize-handle {
    position: absolute;
    background-color: transparent;
}

.resize-handle.top {
    top: 0;
    left: 5px;
    right: 5px;
    height: 5px;
    cursor: n-resize;
}

.resize-handle.right {
    top: 5px;
    right: 0;
    bottom: 5px;
    width: 5px;
    cursor: e-resize;
}

.resize-handle.bottom {
    bottom: 0;
    left: 5px;
    right: 5px;
    height: 5px;
    cursor: s-resize;
}

.resize-handle.left {
    top: 5px;
    left: 0;
    bottom: 5px;
    width: 5px;
    cursor: w-resize;
}

.resize-handle.top-left {
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: nw-resize;
}

.resize-handle.top-right {
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: ne-resize;
}

.resize-handle.bottom-left {
    bottom: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: sw-resize;
}

.resize-handle.bottom-right {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: se-resize;
}

.window.maximized .resize-handle {
    display: none;
}

/* Scaling control */
.window-header select {
    background-color: transparent;
    color: var(--window-header-text-color, white);
    border: 1px solid var(--window-header-select-border-color, rgba(255, 255, 255, 0.5));
    padding: 2px 5px;
    font-size: 12px;
    margin-left: 10px;
}

.window-header select option {
    background-color: var(--window-header-select-option-bg, #333);
    color: var(--window-header-select-option-color, white);
}