@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

body {
    background: #00427e;
    background: linear-gradient(135deg, #1e5799 0%, #2989d8 50%, #207cca 51%, #7db9e8 100%);
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

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

/* Taskbar */
#taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(20, 20, 20, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 9999;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 60px;
    left: 10px;
    width: 320px;
    height: 400px;
    background: rgba(25, 25, 25, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: 
        opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.25s;
    transform-origin: bottom left;
    visibility: visible;
    opacity: 1;
}

#start-menu.closed {
    opacity: 0 !important;
    transform: scale(0.9) translateY(20px) !important;
    visibility: hidden;
    pointer-events: none;
}

.start-menu-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.start-menu-apps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.start-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.2s;
}

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

.start-app-item svg {
    width: 32px;
    height: 32px;
}

.start-app-item span {
    font-size: 0.75rem;
    color: white;
    text-align: center;
}

#start-button {
    background: transparent;
    color: white;
    border: none;
    height: 40px;
    width: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#start-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

#active-apps {
    display: flex;
    flex-grow: 1;
    justify-content: center; /* Center icons like modern OS */
    margin: 0 15px;
    gap: 12px;
}

.taskbar-item {
    background: transparent;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.taskbar-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.taskbar-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 20%;
    right: 20%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.taskbar-item.active::after {
    opacity: 1;
    background: #0078d7;
    width: 50%;
    left: 25%;
}

.taskbar-item svg {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

#system-tray {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Window Management */
.window {
    position: absolute;
    min-width: 400px;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.4);
    
    /* Initial state for opening animation */
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    
    /* Transitions */
    transition: 
        opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s ease,
        width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 0.3s ease;
    
    will-change: transform, opacity, width, height, top, left;
}

.window.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.window.dragging, .window.resizing {
    transition: none !important;
}

.window.active {
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    border: 1px solid rgba(0, 120, 215, 0.3);
}

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

.window.closing {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    pointer-events: none;
}

@keyframes window-open {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.window-header {
    background: rgba(240, 240, 240, 0.8);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.window-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-title svg {
    width: 16px;
    height: 16px;
}

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

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
}

.control:hover { opacity: 0.8; }
.close { background: #ff5f56; border: 0.5px solid #e0443e; }
.min { background: #ffbd2e; border: 0.5px solid #dea123; }
.max { background: #27c93f; border: 0.5px solid #1aab29; }

.window-content {
    flex-grow: 1;
    background: #121212;
    position: relative;
    overflow: hidden;
}

/* xterm override */
.terminal-view {
    height: 100%;
    width: 100%;
}

.xterm {
    padding: 10px;
    height: 100%;
}

