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

:root {
    --bg-primary: #2e3440;
    --bg-secondary: #3b4252;
    --bg-tertiary: #434c5e;
    --text-primary: #eceff4;
    --text-secondary: #d8dee9;
    --accent: #88c0d0;
    --accent-hover: #81a1c1;
    --border: #4c566a;
    --terminal-bg: #1e1e1e;
    --terminal-text: #00ff00;
    --window-shadow: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Ubuntu', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
}

/* Desktop */
#desktop {
    height: calc(100vh - 40px);
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 100px);
    grid-auto-rows: 100px;
    gap: 20px;
    align-content: start;
}

/* Desktop Icons */
.desktop-icon {
    width: 80px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
    user-select: none;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-icon:active {
    transform: scale(0.95);
}

.icon-image {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    color: var(--text-primary);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.icon-image svg {
    width: 100%;
    height: 100%;
}

.icon-label {
    font-size: 12px;
    text-align: center;
    color: var(--text-primary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    max-width: 80px;
}

/* Windows */
.window {
    position: absolute;
    background: transparent;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 10px 40px var(--window-shadow);
    min-width: 400px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 66, 82, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: -1;
    border-radius: 8px 8px 0 0;
}

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

.window.minimized {
    display: none;
}

/* Window Titlebar */
.window-titlebar {
    background: rgba(67, 76, 94, 0.3);
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    border-bottom: 1px solid rgba(76, 86, 106, 0.5);
    position: relative;
    z-index: 1;
}

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

.window-icon {
    font-size: 16px;
}

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

.window-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-btn:hover {
    background: var(--accent-hover);
}

.window-btn.close:hover {
    background: #bf616a;
}

/* Terminal Window */
#terminal-window {
    top: 100px;
    left: 100px;
    width: 700px;
    height: 500px;
}

.terminal-content {
    flex: 1;
    
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

#terminal-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 8px;
}

.terminal-line {
    margin-bottom: 4px;
    line-height: 1.5;
}

.terminal-line.command {
    color: var(--terminal-text);
}

.terminal-line.output {
    color: #d8dee9;
}

.terminal-line.error {
    color: #bf616a;
}

.terminal-line.success {
    color: #a3be8c;
}

.terminal-line.info {
    color: var(--accent);
}

.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.prompt {
    color: var(--terminal-text);
    font-weight: bold;
    white-space: nowrap;
}

#terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Info Window */
#info-window {
    top: 150px;
    left: 200px;
    width: 600px;
    height: 400px;
}

.info-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: rgba(46, 52, 64, 0.3);
    position: relative;
    z-index: 1;
}

.info-content h2 {
    color: var(--accent);
    margin-bottom: 16px;
    font-size: 24px;
}

.info-content h3 {
    color: var(--accent-hover);
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 18px;
}

.info-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.info-content ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.info-content li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.info-content a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

.info-content a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 1000;
}

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

.taskbar-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.taskbar-menu:hover {
    background: var(--accent-hover);
}

.menu-icon {
    font-size: 18px;
}

.taskbar-center {
    flex: 1;
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.taskbar-app {
    padding: 6px 16px;
    background: var(--bg-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    white-space: nowrap;
    user-select: none;
}

.taskbar-app:hover {
    background: var(--accent-hover);
}

.taskbar-app.active {
    background: var(--accent);
    color: var(--bg-primary);
}

.taskbar-right {
    display: flex;
    gap: 12px;
}

.taskbar-time {
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 13px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.window {
    animation: fadeIn 0.2s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    #desktop {
        grid-template-columns: repeat(auto-fill, 80px);
        gap: 15px;
        padding: 15px;
    }

    .window {
        min-width: 300px;
        min-height: 250px;
    }

    #terminal-window {
        width: 90%;
        height: 60%;
        left: 5%;
        top: 50px;
    }

    #info-window {
        width: 90%;
        height: 70%;
        left: 5%;
        top: 50px;
    }
}
