:root {
    --bg-color: #000;
    --taskbar-bg: rgba(32, 32, 32, 0.75);
    --window-bg: rgba(32, 32, 32, 0.95);
    --accent-color: #3498db;
    --text-color: #fff;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: url('https://images.unsplash.com/photo-1579546929518-9e396f3cc809?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') no-repeat center center/cover;
    height: 100vh;
    overflow: hidden;
    color: var(--text-color);
}

/* Boot Screen */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease-out;
}

.boot-logo {
    text-align: center;
    margin-bottom: 50px;
}

.boot-logo i {
    font-size: 80px;
    color: #00a8e8;
    margin-bottom: 20px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Login Screen */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    transition: opacity 0.5s ease-out;
}

.login-container {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-size: 24px;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.login-input {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

#password-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 5px;
    color: white;
    font-family: inherit;
    outline: none;
    width: 200px;
    transition: border-color 0.2s;
}

#password-input:focus {
    border-color: var(--accent-color);
}

#login-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

#login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.login-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.login-hint:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Desktop */
#desktop {
    width: 100%;
    height: 100%;
    position: relative;
}

.hidden {
    display: none !important;
}

/* Desktop Icons */
.desktop-icons {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-wrap: wrap;
    height: calc(100% - 50px);
    align-content: flex-start;
}

.icon {
    width: 80px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s;
    text-align: center;
}

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

.icon i {
    font-size: 32px;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.icon span {
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Taskbar */
#taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: var(--taskbar-bg);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    border-top: var(--glass-border);
    z-index: 1000;
}

.start-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.start-btn i {
    font-size: 20px;
    color: #00a8e8;
}

.taskbar-apps {
    flex: 1;
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.taskbar-app {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

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

.taskbar-app.active {
    background: rgba(255, 255, 255, 0.15);
}

.taskbar-app.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
}

.tray-icon {
    cursor: pointer;
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 60px;
    left: 10px;
    width: 320px;
    height: 450px;
    background: var(--window-bg);
    backdrop-filter: blur(15px);
    border-radius: 8px;
    border: var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.start-header {
    padding: 20px;
    border-bottom: var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    background: #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
}

.power-btn {
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
}

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

.pinned-apps {
    padding: 20px;
    flex: 1;
}

.pinned-apps h3 {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 15px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.start-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 10px 5px;
    border-radius: 5px;
}

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

.start-app i {
    font-size: 20px;
    color: var(--accent-color);
}

.start-app span {
    font-size: 10px;
}

/* Windows */
.window {
    position: absolute;
    background: var(--window-bg);
    backdrop-filter: blur(15px);
    border-radius: 8px;
    border: var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    min-width: 300px;
    min-height: 200px;
    animation: popIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes popIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.window-header {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border-bottom: var(--glass-border);
    cursor: default;
}

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

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

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

.close-btn {
    background: #ff5f56;
}

.minimize-btn {
    background: #ffbd2e;
}

.maximize-btn {
    background: #27c93f;
}

.window-content {
    flex: 1;
    overflow-y: auto;
    /* Ensure vertical scrolling */
    overflow-x: hidden;
    padding: 20px;
    color: #ddd;
    height: 100%;
    /* Take full available height */
    min-height: 0;
    /* Crucial for flex child scrolling */
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* App Specific Styles */
.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: var(--glass-border);
}

.project-card h3 {
    color: var(--accent-color);
    margin-bottom: 5px;
}

.project-tags {
    display: flex;
    gap: 5px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 10px;
}

.btn:hover {
    opacity: 0.9;
}

/* Terminal */
.terminal-content {
    font-family: 'Courier New', monospace;
    padding: 10px;
    height: 100%;
    background: #1e1e1e;
    color: #fff;
    overflow-y: auto;
}

.terminal-line {
    margin-bottom: 5px;
}

.terminal-prompt {
    color: #2ecc71;
    margin-right: 10px;
}

.terminal-input-line {
    display: flex;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    flex: 1;
    outline: none;
}