/* ===== Windows Container ===== */
.windows-container {
    position: absolute;
    inset: 0;
    bottom: 48px;
    z-index: 10;
    pointer-events: none;
}

/* ===== Window Base ===== */
.window {
    position: absolute;
    background: var(--bg-window);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.65),
        0 0 0 0.5px rgba(255, 255, 255, 0.04) inset;
    display: none;
    flex-direction: column;
    min-width: 350px;
    min-height: 250px;
    pointer-events: auto;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    resize: both;
}

/* Resize handle */
.window::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
    border-radius: 0 0 14px 0;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.window:hover::after {
    opacity: 0.7;
}

.window[data-window="about"] {
    resize: none;
}

.window[data-window="about"]::after {
    display: none;
}

.window.active {
    display: flex;
    border-color: var(--border-active);
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.7),
        0 0 50px rgba(74, 163, 255, 0.06),
        0 0 0 0.5px rgba(74, 163, 255, 0.08) inset;
    animation: windowOpen 0.18s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.window.minimized {
    display: none !important;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - 48px) !important;
    border-radius: 0;
    resize: none;
}

.window.maximized::after {
    display: none;
}

/* ===== Window Header ===== */
.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    cursor: grab;
}

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

.window-header.terminal-header {
    background: rgba(15, 15, 28, 0.6);
}

.window-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.window-title span {
    font-family: 'JetBrains Mono', monospace;
}

.window-title i {
    color: var(--accent);
    font-size: 0.9rem;
}

/* ===== Window Controls — macOS style ===== */
.window-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.win-btn {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: filter 0.15s ease, transform 0.12s ease;
    position: relative;
}

.win-btn i {
    font-size: 0.42rem;
    opacity: 0;
    transition: opacity 0.15s ease;
    position: absolute;
    color: rgba(0, 0, 0, 0.55);
}

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

.win-btn.close    { background: #ff5f57; }
.win-btn.minimize { background: #febc2e; }
.win-btn.maximize { background: #28c840; }

.win-btn:hover {
    filter: brightness(1.12);
    transform: scale(1.1);
}

/* ===== Window Content ===== */
.window-content {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.window-content::-webkit-scrollbar { width: 4px; }
.window-content::-webkit-scrollbar-track { background: transparent; }
.window-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.window-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
