/* System okien Windows 98 */
.window {
    position: absolute;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    font-family: 'MS Sans Serif', 'Tahoma', sans-serif;
    font-size: 11px;
    min-width: 200px;
    min-height: 100px;
    display: none;
    z-index: 100;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

.window.show {
    display: block;
}

/* Nagłówek okna */
.window-header {
    background: linear-gradient(90deg, #0000ff 0%, #000080 100%);
    color: white;
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-bottom: 1px solid #808080;
    height: 20px;
}

.window-header.inactive {
    background: linear-gradient(90deg, #808080 0%, #404040 100%);
}

.window-title {
    font-weight: bold;
    font-size: 11px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Przyciski okna */
.window-controls {
    display: flex;
    gap: 2px;
}

.window-btn {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    color: #000000;
    font-size: 9px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.window-btn:hover {
    background: #dfdfdf;
}

.window-btn:active {
    border: 1px inset #c0c0c0;
    background: #a0a0a0;
}

/* Zawartość okna */
.window-content {
    padding: 8px;
    background: #c0c0c0;
    overflow: auto;
    height: calc(100% - 20px);
}

/* Menu okna (opcjonalne) */
.window-menu {
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 0;
    font-size: 11px;
}

.window-menu-item {
    display: inline-block;
    padding: 4px 8px;
    cursor: pointer;
    border: 1px solid transparent;
}

.window-menu-item:hover {
    border: 1px outset #c0c0c0;
    background: #dfdfdf;
}

.window-menu-item:active {
    border: 1px inset #c0c0c0;
}

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

.window-resize.n { top: 0; left: 0; right: 0; height: 4px; cursor: n-resize; }
.window-resize.s { bottom: 0; left: 0; right: 0; height: 4px; cursor: s-resize; }
.window-resize.e { top: 0; bottom: 0; right: 0; width: 4px; cursor: e-resize; }
.window-resize.w { top: 0; bottom: 0; left: 0; width: 4px; cursor: w-resize; }
.window-resize.ne { top: 0; right: 0; width: 8px; height: 8px; cursor: ne-resize; }
.window-resize.nw { top: 0; left: 0; width: 8px; height: 8px; cursor: nw-resize; }
.window-resize.se { bottom: 0; right: 0; width: 8px; height: 8px; cursor: se-resize; }
.window-resize.sw { bottom: 0; left: 0; width: 8px; height: 8px; cursor: sw-resize; }

/* Statusbar okna */
.window-statusbar {
    background: #c0c0c0;
    border-top: 1px solid #ffffff;
    border-bottom: 1px solid #808080;
    padding: 2px 4px;
    font-size: 10px;
    height: 18px;
    display: flex;
    align-items: center;
}

/* Specjalne style dla zminimalizowanych okien */
.window.minimized {
    display: none;
}

/* Efekt maksymalizacji */
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - 40px) !important;
    border: none;
    z-index: 999;
}

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

/* Overlay dla przeciągania */
.window-drag-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    cursor: move;
    display: none;
}

/* Animacje */
.window.opening {
    animation: windowOpen 0.15s ease-out;
}

.window.closing {
    animation: windowClose 0.1s ease-in;
}

@keyframes windowOpen {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes windowClose {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* Responsywność dla małych ekranów */
@media (max-width: 768px) {
    .window {
        font-size: 10px;
        min-width: 150px;
    }
    
    .window-header {
        height: 18px;
        padding: 1px 3px;
    }
    
    .window-title {
        font-size: 10px;
    }
    
    .window-btn {
        width: 14px;
        height: 12px;
        font-size: 8px;
    }
    
    .window-content {
        padding: 6px;
        height: calc(100% - 18px);
    }
}

@media (max-width: 480px) {
    .window {
        font-size: 9px;
        min-width: 120px;
    }
    
    .window-header {
        height: 16px;
    }
    
    .window-btn {
        width: 12px;
        height: 10px;
        font-size: 7px;
    }
}
