/* OS-style Windows */
.os-window {
    position: absolute;
    background: rgba(30, 30, 46, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s;
    backdrop-filter: blur(10px);
}

.os-window.active {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(97, 192, 128, 0.4);
}

.os-window.minimized {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.os-window.maximized {
    border-radius: 0;
}

.os-window.dragging {
    opacity: 0.9;
    cursor: grabbing;
}

.os-window.resizing {
    transition: none;
}

/* Window Titlebar */
.window-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.os-window.dragging .window-titlebar {
    cursor: grabbing;
}

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

.window-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.window-icon svg {
    width: 18px;
    height: 18px;
}

.window-title-text {
    font-size: 0.95rem;
}

/* Window Controls - Flat Ubuntu-style */
.window-controls {
    display: flex;
    gap: 8px;
}

.window-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.window-btn svg {
    width: 14px;
    height: 14px;
}

.window-btn.minimize-btn {
    color: #61c080;
}

.window-btn.minimize-btn:hover {
    background: rgba(97, 192, 128, 0.2);
}

.window-btn.maximize-btn {
    color: #61c080;
}

.window-btn.maximize-btn:hover {
    background: rgba(97, 192, 128, 0.2);
}

.window-btn.close-btn {
    color: #e1e483;
}

.window-btn.close-btn:hover {
    background: rgba(225, 228, 131, 0.2);
}

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

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

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

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

/* Desktop Area */
#windowContainer {
    position: relative;
    flex: 1;
    overflow: hidden;
}

/* Desktop Background */
#desktopBg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.3;
}

#desktopBg img {
    width: 200px;
    margin-bottom: 20px;
}

#desktopBg h1 {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-muted);
}

/* Bottom Panel / Dock */
#bottomPanel {
    position: absolute;
    bottom: 0;
    left: var(--taskbar-width);
    right: 0;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 1000;
}

#taskbarWindows {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
}

.taskbar-window-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    max-width: 200px;
    white-space: nowrap;
}

.taskbar-window-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.taskbar-window-btn.active {
    background: rgba(97, 192, 128, 0.15);
    border-color: #61c080;
    color: var(--text-primary);
}

.taskbar-window-btn.minimized {
    opacity: 0.6;
}

.tw-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tw-icon svg {
    width: 14px;
    height: 14px;
}

.tw-title {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Clock in bottom panel */
#clock {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: auto;
}

/* App content inside windows - resets */
.window-content .app-header {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.window-content .app-body {
    padding: 20px;
}
