:root {
    --bg-color: rgba(32, 32, 32, 0.75);
    --taskbar-bg: rgba(28, 28, 28, 0.85);
    --start-bg: rgba(32, 32, 32, 0.85);
    --accent-color: #0078d4;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --glass-blur: blur(20px);
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    user-select: none;
}

body {
    overflow: hidden;
    background-color: #000;
}

.desktop {
    width: 100vw;
    height: 100vh;
    background-image: url('wallpaper.png');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Desktop Icons */
.desktop-icons {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: fit-content;
}

.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    padding: 10px 5px;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
}

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

.icon img {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
}

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

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

.taskbar-center {
    display: flex;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

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

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

.task-icon img {
    width: 24px;
    height: 24px;
}

.task-icon#start-btn img {
    width: 26px;
    height: 26px;
}

.taskbar-left {
    display: flex;
    align-items: center;
}

.taskbar-left .task-icon {
    width: auto;
    padding: 0 8px;
    gap: 8px;
}

.taskbar-left span {
    color: white;
    font-size: 13px;
}

.taskbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clock {
    text-align: right;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
}

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

.divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.tray-icons {
    display: flex;
    gap: 12px;
    padding: 0 8px;
}

.desktop-peek {
    width: 5px;
    height: 48px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 4px;
}

/* Windows */
.window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 80%;
    height: 80%;
    background: var(--bg-color);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.window.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.window-header {
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    background: rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 12px;
}

.window-controls {
    display: flex;
}

.control-btn {
    width: 46px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

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

.control-btn.close:hover {
    background: #e81123;
}

.window-nav {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.nav-btns {
    display: flex;
    gap: 20px;
}

.nav-btns img {
    opacity: 0.6;
    cursor: pointer;
}

.address-bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    height: 30px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    color: white;
    font-size: 13px;
}

.search-box {
    width: 200px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    height: 30px;
    border-radius: 4px;
    padding: 0 12px;
}

.search-box input {
    background: none;
    border: none;
    color: white;
    width: 100%;
    height: 100%;
    outline: none;
    font-size: 12px;
}

.window-body {
    flex: 1;
    display: flex;
}

.sidebar {
    width: 200px;
    padding: 12px 8px;
    border-right: 1px solid var(--border-color);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.content-area {
    flex: 1;
    padding: 24px;
    background: rgba(0, 0, 0, 0.05);
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
}

.folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.folder-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.folder-item span {
    color: white;
    font-size: 12px;
}

.start-menu {
    position: absolute;
    bottom: -700px;
    /* Initially hidden */
    left: 50%;
    transform: translateX(-50%);
    width: 640px;
    height: 600px;
    background: var(--start-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 32px;
    transition: bottom 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.start-menu.open {
    bottom: 60px;
}

.search-bar {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid var(--accent-color);
    padding: 8px 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.search-bar input {
    background: none;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 16px;
}

.section-title span {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.all-apps,
.more {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    margin-bottom: 40px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 4px;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
    text-align: center;
}

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

.app-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

.app-item span {
    color: white;
    font-size: 12px;
}

.rec-list {
    padding: 0 16px;
}

.rec-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}

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

.rec-item p {
    color: white;
    font-size: 13px;
    margin-bottom: 2px;
}

.rec-item span {
    color: var(--text-secondary);
    font-size: 11px;
}

.start-footer {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
    margin: auto -32px -32px -32px;
    padding: 16px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 8px 8px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.1);
}

.power-btn {
    padding: 8px;
    border-radius: 4px;
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Hide desktop icons on small screens to save space */
    .desktop-icons {
        display: none;
    }

    /* Make Taskbar simpler */
    .taskbar {
        padding: 0 4px;
    }
    
    .taskbar-right .tray-icons,
    .taskbar-right .clock,
    .taskbar-right .desktop-peek,
    .divider {
        display: none !important;
    }

    .taskbar-center {
        gap: 16px;
        width: 100%;
        justify-content: center;
    }
    
    .task-icon {
        width: 48px;
        height: 48px;
    }
    
    .task-icon img {
        width: 32px;
        height: 32px;
    }

    /* Start Menu adjustments */
    .start-menu {
        width: 100%;
        height: calc(100vh - 48px);
        bottom: -100vh;
        left: 0;
        transform: none;
        border-radius: 16px 16px 0 0;
        padding: 24px 16px;
    }

    .start-menu.open {
        bottom: 48px;
    }

    .start-footer {
        margin: auto -16px -24px -16px;
        padding: 16px 24px;
    }

    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px 8px;
    }

    /* Window / CRUD adjustments */
    .window {
        width: 100% !important;
        height: calc(100vh - 48px) !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0;
        border: none;
    }

    .window.open {
        transform: none !important;
    }

    .window-nav {
        flex-direction: column;
        height: auto;
        padding: 16px 12px;
        gap: 12px;
    }

    .search-box {
        width: 100% !important;
    }

    .nav-btns {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .nav-btns button {
        flex: 1;
    }

    .window-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .content-area {
        padding: 12px;
    }
    
    /* Modals */
    .modal-content {
        width: 95% !important;
        max-height: 90vh;
        margin: 0 auto;
        border-radius: 12px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    /* Responsive Table Wrapper */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Responsive Admin Chat */
    .admin-chat-layout {
        flex-direction: column !important;
        height: auto !important;
        min-height: 500px;
    }
    
    .chat-sidebar-new {
        width: 100% !important;
        min-width: 100% !important;
        height: 250px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .chat-box-wrapper {
        min-height: 400px;
    }
}