* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

#desktop {
    position: relative;
    width: 100%;
    height: calc(100vh - 48px);
    overflow: hidden;
}

.window {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    min-width: 400px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.window-header {
    background: #f5f5f5;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    border-bottom: 1px solid #ddd;
    user-select: none;
}

.window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.window-btn.close { background: #ff5f56; }
.window-btn.minimize { background: #ffbd2e; }
.window-btn.maximize { background: #27c93f; }

.window-btn:hover {
    opacity: 0.8;
}

.window-content {
    flex: 1;
    overflow: auto;
    background: white;
}

#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 12px;
}

.taskbar-start {
    position: relative;
}

.start-btn {
    padding: 8px 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.start-btn:hover {
    background: rgba(255,255,255,0.2);
}

.start-menu {
    position: absolute;
    bottom: 60px;
    left: 0;
    width: 280px;
    background: rgba(30,30,30,0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    overflow: hidden;
}

.start-menu-header {
    padding: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.start-menu-item {
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    transition: background 0.2s;
}

.start-menu-item:hover {
    background: rgba(255,255,255,0.1);
}

.taskbar-windows {
    display: flex;
    gap: 8px;
    flex: 1;
}

.taskbar-window {
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.2s;
}

.taskbar-window:hover {
    background: rgba(255,255,255,0.2);
}

.taskbar-window.active {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Resize handles */
.resizer {
    position: absolute;
    width: 12px;
    height: 12px;
    background: transparent;
    z-index: 3000;
}
.resizer-n { top: -6px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resizer-s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resizer-e { right: -6px; top: 50%; transform: translateY(-50%); cursor: e-resize; }
.resizer-w { left: -6px; top: 50%; transform: translateY(-50%); cursor: w-resize; }
.resizer-ne { right: -6px; top: -6px; cursor: ne-resize; }
.resizer-nw { left: -6px; top: -6px; cursor: nw-resize; }
.resizer-se { right: -6px; bottom: -6px; cursor: se-resize; }
.resizer-sw { left: -6px; bottom: -6px; cursor: sw-resize; }

/* Make the hit targets a bit larger on touch/hi-dpi by increasing touch area invisibly */
.window .resizer::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    background: transparent;
}
