/* === Desktop === */
#desktop {
    position: fixed;
    inset: 0;
    background: url('../Resources/background.png') center/cover no-repeat;
    background-color: #0a0a1a;
}

/* === Desktop Icons === */
#desktop-icons {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 8px;
    max-height: calc(100vh - var(--taskbar-height) - 40px);
    align-content: flex-start;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 82px;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.08);
}

.desktop-icon.selected {
    background: var(--accent-soft);
}

.desktop-icon .icon-img {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 6px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.desktop-icon:hover .icon-img {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.desktop-icon .icon-img .material-icons-round {
    font-size: 26px;
    color: var(--accent);
}

.icon-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
    word-break: break-word;
}

/* === Taskbar === */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(var(--blur-heavy));
    -webkit-backdrop-filter: blur(var(--blur-heavy));
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: 5000;
}

#start-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}

#start-btn:hover {
    background: var(--bg-hover);
}

#start-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
}

#start-btn .material-icons-round {
    font-size: 24px;
}

#taskbar-apps {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 0 8px;
    overflow-x: auto;
}

.taskbar-app {
    height: 38px;
    min-width: 38px;
    padding: 0 12px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
    white-space: nowrap;
    font-family: inherit;
    font-size: 12px;
}

.taskbar-app:hover {
    background: var(--bg-hover);
}

.taskbar-app.active {
    background: var(--bg-active);
}

.taskbar-app .material-icons-round {
    font-size: 20px;
}

.taskbar-app::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: width var(--transition);
}

.taskbar-app.active::after {
    width: 20px;
}

#system-tray {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.tray-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.tray-icon:hover {
    background: var(--bg-hover);
}

.tray-icon .material-icons-round {
    font-size: 18px;
    color: var(--text-secondary);
}

#taskbar-clock {
    padding: 4px 12px;
    text-align: right;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
}

#taskbar-clock:hover {
    background: var(--bg-hover);
}

.clock-time {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
}

.clock-date {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* === Start Menu === */
#start-menu {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 8px);
    left: 8px;
    width: 380px;
    max-height: 520px;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(var(--blur-heavy));
    -webkit-backdrop-filter: blur(var(--blur-heavy));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 6000;
    animation: startMenuIn var(--transition-slow) forwards;
    overflow: hidden;
}

#start-menu.hidden {
    display: none;
}

@keyframes startMenuIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.start-header {
    padding: 16px 16px 12px;
}

#start-search {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}

#start-search::placeholder {
    color: var(--text-muted);
}

#start-search:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.start-apps {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.start-app-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
    font-weight: 500;
}

.start-app-item:hover {
    background: var(--bg-hover);
}

.start-app-item .material-icons-round {
    font-size: 22px;
    color: var(--accent);
}

.start-app-item.hidden {
    display: none;
}

.start-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

.start-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.start-user:hover {
    background: var(--bg-hover);
}

.start-user .material-icons-round {
    font-size: 24px;
    color: var(--text-secondary);
}

.start-power {
    display: flex;
    gap: 8px;
}

.start-power-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
}

.start-power-btn:hover {
    background: var(--bg-hover);
}

.start-power-btn .material-icons-round {
    font-size: 20px;
    color: var(--text-secondary);
}

.start-power-btn:last-child:hover {
    background: rgba(255, 77, 77, 0.2);
}

.start-power-btn:last-child:hover .material-icons-round {
    color: #ff6b6b;
}

/* === Context Menu === */
#context-menu {
    position: fixed;
    min-width: 200px;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 7000;
    animation: ctxIn 0.15s ease;
}

#context-menu.hidden {
    display: none;
}

@keyframes ctxIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition);
}

.ctx-item:hover {
    background: var(--bg-hover);
}

.ctx-item .material-icons-round {
    font-size: 18px;
    color: var(--text-secondary);
}

.ctx-separator {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

/* === Calendar Popup === */
#calendar-popup {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 8px);
    right: 8px;
    width: 300px;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(var(--blur-heavy));
    -webkit-backdrop-filter: blur(var(--blur-heavy));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    z-index: 6000;
    animation: startMenuIn var(--transition-slow) forwards;
}

#calendar-popup.hidden {
    display: none;
}

.cal-month {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 12px;
}

.cal-header {
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px;
}

.cal-day {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 500;
    cursor: default;
}

.cal-day.today {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.cal-day.other {
    color: var(--text-muted);
}

/* === Notification Center === */
#notification-center {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 8px);
    right: 8px;
    width: 340px;
    max-height: 400px;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(var(--blur-heavy));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 6000;
    overflow: hidden;
}

#notification-center.hidden {
    display: none;
}

.notif-header {
    padding: 16px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.notif-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* === Shutdown Dialog === */
#shutdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9500;
}

#shutdown-overlay.hidden {
    display: none;
}

.shutdown-dialog {
    background: var(--bg-glass-heavy);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
}

.shutdown-dialog h3 {
    margin-bottom: 24px;
    font-size: 18px;
}

.shutdown-options {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.shutdown-options button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    transition: background var(--transition), border-color var(--transition);
}

.shutdown-options button:hover {
    background: var(--bg-active);
    border-color: var(--accent);
}

.shutdown-options button .material-icons-round {
    font-size: 28px;
}

.shutdown-cancel {
    padding: 8px 24px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: background var(--transition);
}

.shutdown-cancel:hover {
    background: var(--bg-hover);
}

/* === Utility === */
.hidden {
    display: none !important;
}

/* Dragging state */
body.dragging-window * {
    pointer-events: none !important;
}

body.dragging-window .window-titlebar {
    pointer-events: auto !important;
}

body.resizing-window * {
    pointer-events: none !important;
}

body.resizing-window .resize-handle {
    pointer-events: auto !important;
}