/* assets/css/os-window.css - Handcrafted Warm Beige Retro Windows */

.os-window {
    position: absolute;
    width: 840px;
    height: 580px;
    min-width: 340px;
    min-height: 260px;
    background: #FAF5EC;
    border: 2px solid #3E3228;
    border-radius: 6px;
    box-shadow: 6px 6px 0px #3E3228;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.os-window.focused {
    box-shadow: 8px 8px 0px #3E3228;
    border-color: #3E3228;
}

.os-window.minimized {
    opacity: 0;
    transform: scale(0.7) translateY(180px);
    pointer-events: none;
    visibility: hidden;
}

.os-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 50px) !important;
    border-radius: 0 !important;
    border: none !important;
    z-index: 9999 !important;
}

.os-window.maximized .window-body {
    flex: 1 !important;
    height: calc(100% - 40px) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* WINDOW HEADER TITLEBAR */
.window-header {
    height: 40px;
    background: #DBCAB2;
    border-bottom: 2px solid #3E3228;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    cursor: grab;
    user-select: none;
}

.window-header:active {
    cursor: grabbing;
}

/* WARM BEIGE RETRO APP TITLEBARS */
.win-theme-this-pc .window-header { background: #DBCAB2; border-bottom: 2px solid #3E3228; }
.win-theme-projects .window-header { background: #D8C4E8; border-bottom: 2px solid #3E3228; }
.win-theme-resume .window-header { background: #BCE3C5; border-bottom: 2px solid #3E3228; }
.win-theme-mail .window-header { background: #E8B4A2; border-bottom: 2px solid #3E3228; }
.win-theme-terminal .window-header { background: #3E3228; border-bottom: 2px solid #3E3228; color: #FAF5EC; }
.win-theme-admin .window-header { background: #E8B4A2; border-bottom: 2px solid #3E3228; }
.win-theme-settings .window-header { background: #DBCAB2; border-bottom: 2px solid #3E3228; }
.win-theme-blogs .window-header { background: #F7D692; border-bottom: 2px solid #3E3228; }
.win-theme-research .window-header { background: #D8C4E8; border-bottom: 2px solid #3E3228; }
.win-theme-achievements .window-header { background: #F7D692; border-bottom: 2px solid #3E3228; }
.win-theme-academics .window-header { background: #BCE3C5; border-bottom: 2px solid #3E3228; }
.win-theme-community-notes .window-header { background: #D8C4E8; border-bottom: 2px solid #3E3228; }
.win-theme-recycle-bin .window-header { background: #DBCAB2; border-bottom: 2px solid #3E3228; }

.win-theme-terminal .window-title { color: #FAF5EC !important; }

/* WINDOW BODIES */
.os-window .window-body {
    background: #FAF5EC;
    color: #2E241C;
}

.window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--os-pixel);
    font-size: 0.95rem;
    font-weight: 700;
    color: #2E241C;
}

.window-title i {
    font-size: 0.95rem;
    color: #2E241C;
}

/* RETRO CONTROL DOTS */
.window-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.win-btn {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid #3E3228;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.win-btn:active {
    transform: scale(0.9);
}

.win-btn i {
    font-size: 7px;
    opacity: 0;
    color: #2E241C;
    transition: opacity 0.15s;
}

.win-btn:hover i {
    opacity: 1;
}

.win-close {
    background: #E8B4A2;
}

.win-minimize {
    background: #DBCAB2;
}

.win-maximize {
    background: #BCE3C5;
}

/* WINDOW CONTENT BODY */
.window-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.4rem;
    position: relative;
    background: #FAF5EC;
    color: #2E241C;
}

/* RESIZE HANDLES */
.resize-handle {
    position: absolute;
    z-index: 10;
}

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

/* MOBILE SPECIFIC WINDOW OVERRIDES */
@media (max-width: 768px) {
    .os-window {
        width: 100vw !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        z-index: 1000 !important;
    }

    .os-window.maximized {
        width: 100vw !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
    }

    .window-body {
        padding: 1rem 0.8rem 6rem 0.8rem !important;
        -webkit-overflow-scrolling: touch;
    }

    .resize-handle {
        display: none !important;
    }
}
