/* Windows 98 Window Styles */

.window {
    position: absolute;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    min-width: 200px;
    min-height: 100px;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

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

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 28px) !important;
}

.window.minimized {
    display: none;
}

/* Title Bar */
.title-bar {
    height: 18px;
    background: linear-gradient(90deg, #0a246a 0%, #a6caf0 100%);
    color: white;
    display: flex;
    align-items: center;
    padding: 2px;
    cursor: move;
    font-size: 11px;
    font-weight: bold;
}

.title-bar.inactive {
    background: linear-gradient(90deg, #808080 0%, #c0c0c0 100%);
    color: #c0c0c0;
}

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

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

.title-bar-control {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    color: black;
}

.title-bar-control:active {
    border: 1px inset #c0c0c0;
}

.title-bar-control.minimize::before {
    content: '_';
    margin-top: 2px;
}

.title-bar-control.maximize::before {
    content: '□';
}

.title-bar-control.close::before {
    content: '×';
    font-size: 10px;
}

/* Menu Bar */
.menu-bar {
    height: 20px;
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

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

.menu-item:hover {
    background: #316AC5;
    color: white;
}

/* Toolbar */
.toolbar {
    height: 28px;
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    display: flex;
    align-items: center;
    padding: 2px 4px;
    gap: 2px;
}

.toolbar-button {
    width: 24px;
    height: 22px;
    background: #c0c0c0;
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-button:hover {
    border: 1px outset #c0c0c0;
}

.toolbar-button:active {
    border: 1px inset #c0c0c0;
}

.toolbar-separator {
    width: 1px;
    height: 18px;
    background: #808080;
    margin: 0 2px;
    border-right: 1px solid #ffffff;
}

/* Status Bar */
.status-bar {
    height: 20px;
    background: #c0c0c0;
    border-top: 1px solid #808080;
    display: flex;
    align-items: center;
    padding: 0 4px;
    font-size: 11px;
}

.status-bar-section {
    padding: 2px 4px;
    border: 1px inset #c0c0c0;
    margin-right: 4px;
}

/* Window Content */
.window-content {
    flex: 1;
    background: white;
    overflow: auto;
    padding: 4px;
}

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

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

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

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

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

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

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

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

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

/* Dialog Boxes */
.dialog {
    position: fixed;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    z-index: 1000;
    min-width: 200px;
    font-size: 11px;
}

.dialog-content {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dialog-icon {
    width: 32px;
    height: 32px;
}

.dialog-text {
    flex: 1;
    line-height: 1.4;
}

.dialog-buttons {
    padding: 8px 16px 16px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.dialog-button {
    padding: 4px 16px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-family: 'Courier New', 'MS Sans Serif', sans-serif;
    font-size: 11px;
    cursor: pointer;
    min-width: 75px;
}

.dialog-button:active {
    border: 1px inset #c0c0c0;
}

.dialog-button.default {
    border: 2px outset #c0c0c0;
}

/* Mobile Window Responsiveness */
@media (max-width: 768px) {
    .window {
        min-width: 280px;
        min-height: 200px;
    }
    
    .title-bar {
        height: 22px;
        font-size: 12px;
        padding: 3px;
    }
    
    .title-bar-control {
        width: 18px;
        height: 16px;
        font-size: 9px;
    }
    
    .menu-bar {
        height: 24px;
        font-size: 12px;
    }
    
    .menu-item {
        padding: 5px 10px;
    }
    
    .toolbar {
        height: 32px;
        padding: 3px 6px;
    }
    
    .toolbar-button {
        width: 28px;
        height: 26px;
    }
    
    .status-bar {
        height: 24px;
        font-size: 12px;
    }
    
    .status-bar-section {
        padding: 3px 6px;
    }
    
    /* Dialog adjustments */
    .dialog {
        min-width: 250px;
        max-width: calc(100vw - 20px);
    }
    
    .dialog-content {
        padding: 12px;
    }
    
    .dialog-buttons {
        padding: 6px 12px 12px;
    }
    
    .dialog-button {
        padding: 6px 12px;
        min-width: 60px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .window {
        min-width: 250px;
        min-height: 180px;
    }
    
    .title-bar {
        height: 20px;
        font-size: 11px;
    }
    
    .title-bar-control {
        width: 16px;
        height: 14px;
        font-size: 8px;
    }
    
    .menu-bar {
        height: 22px;
        font-size: 11px;
    }
    
    .menu-item {
        padding: 4px 8px;
    }
    
    .toolbar {
        height: 28px;
        padding: 2px 4px;
    }
    
    .toolbar-button {
        width: 24px;
        height: 22px;
    }
    
    .status-bar {
        height: 20px;
        font-size: 11px;
    }
    
    .dialog {
        min-width: 220px;
    }
    
    .dialog-content {
        padding: 10px;
    }
    
    .dialog-button {
        padding: 5px 10px;
        min-width: 50px;
        font-size: 11px;
    }
}

/* Touch-friendly window controls */
@media (hover: none) and (pointer: coarse) {
    .title-bar-control {
        min-width: 20px;
        min-height: 18px;
    }
    
    .toolbar-button {
        min-width: 28px;
        min-height: 26px;
    }
    
    .menu-item {
        min-height: 24px;
    }
    
    .dialog-button {
        min-height: 28px;
        min-width: 70px;
    }
}