/* Reset básico */
* {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Roboto", sans-serif;
    background: #000000;
    /* Fundo preto neutro, wallpaper será aplicado no .wallpaper */
    color: #f0f0f0;
    overflow: hidden;
}

:root {
    --desktop-safe-top: 0px;
    --desktop-safe-right: 0px;
    --desktop-safe-bottom: 0px;
    --desktop-safe-left: 0px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --taskbar-height: 56px;
}

#desktop {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    background: transparent;
    min-height: 100vh;
    padding-bottom: calc(var(--taskbar-height) + var(--safe-area-bottom));
    padding-top: var(--safe-area-top);
    /* Removido backdrop-filter blur para não interferir com wallpaper */
}

/* Área de ícones */
#icons-container {
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    gap: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.desktop-icon {
    width: 80px;
    text-align: center;
    cursor: pointer;
    color: #ddd;
    transition:
        color 0.2s ease,
        transform 0.18s ease;
    user-select: none;
}

.desktop-icon img {
    width: 64px;
    height: 64px;
    margin-bottom: 5px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
    transition: transform 0.18s ease;
}

.desktop-icon:hover {
    color: #fff;
}

.desktop-icon:hover img {
    transform: translateY(-6px) scale(1.03);
}

/* Contêiner de janelas */
#windows-container {
    position: relative;
    padding: 10px 20px;
    height: 60%;
    overflow: auto;
}

/* Janela principal */
/* Definição de .window movida para linha 485 - versão moderna sem efeitos hover */

/* Barra de título da janela */
.window-titlebar {
    background: rgba(50, 50, 50, 0.85);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.window-title {
    font-weight: 700;
    font-size: 16px;
    color: #f5f5f5;
    letter-spacing: 0.2px;
}

/* Controles da janela (minimizar, maximizar, fechar) */
.window-controls {
    display: flex;
    align-items: center;
}

.window-controls button {
    background: transparent;
    border: none;
    color: #cfcfcf;
    font-size: 18px;
    margin-left: 10px;
    cursor: pointer;
    transition:
        color 0.18s ease,
        transform 0.12s ease;
    padding: 6px;
    border-radius: 6px;
}

.window-controls button:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-1px);
}

.window-content {
    padding: 16px;
    flex-grow: 1;
    overflow: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

/* Hover e foco removido - estava causando zoom indesejado */

/* Barra de tarefas */
/* Taskbar com ID - usar variáveis CSS para temas */
#taskbar {
    background: var(--bg-taskbar);
    border-top: 1px solid var(--border-color);
}

/* Itens da barra de tarefas */
.taskbar-item {
    margin-right: 22px;
    cursor: pointer;
    color: #cfcfcf;
    font-weight: 600;
    transition:
        color 0.18s ease,
        transform 0.12s ease;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
}

.taskbar-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-2px);
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(50, 50, 50, 0.85);
    color: #eee;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.45s ease,
        transform 0.45s ease;
    transform: translateY(-20px);
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.filesystem-admin-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 360px;
    max-height: 60vh;
    background: rgba(20, 24, 45, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    display: none;
    flex-direction: column;
    z-index: 1200;
}

.filesystem-admin-panel.visible {
    display: flex;
}

.filesystem-admin-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filesystem-admin-header h3 {
    margin: 0;
    font-size: 16px;
}

.filesystem-admin-header p {
    margin: 2px 0 0;
    font-size: 12px;
    color: #9ea7c4;
}

.filesystem-admin-header button {
    background: transparent;
    border: none;
    color: #cfcfcf;
    font-size: 20px;
    cursor: pointer;
}

.filesystem-admin-events {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
}

.filesystem-event {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.filesystem-event__header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ea7c4;
    margin-bottom: 6px;
}

.filesystem-event pre {
    margin: 0;
    font-size: 12px;
    white-space: pre-wrap;
    color: #dce3ff;
}

/* Scrollbar customizada para o container de janelas */
#windows-container::-webkit-scrollbar {
    width: 10px;
}

#windows-container::-webkit-scrollbar-track {
    background: transparent;
}

#windows-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Sistema de Busca Global */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.search-overlay.show {
    display: flex;
}

.search-container {
    width: 100%;
    max-width: 600px;
    padding: 0 20px;
}

.search-box {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
    z-index: 1;
}

.search-box input {
    width: 100%;
    border: none;
    outline: none;
    padding: 20px 20px 20px 60px;
    font-size: 18px;
    background: transparent;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.search-hint {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 12px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.search-hint kbd {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-family: monospace;
}

.search-results {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(0, 120, 212, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 120, 212, 0.1);
    border-radius: 8px;
    color: #0078d4;
    font-size: 16px;
}

.search-result-content {
    flex: 1;
}

.search-result-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.search-result-description {
    font-size: 12px;
    color: #666;
}

.search-result-category {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

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

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

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1045 40%, #0d1b3e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.login-page #techCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
    position: relative;
    z-index: 1;
}

/* Pequenas melhorias responsivas */
@media (max-width: 800px) {
    .desktop-icon {
        width: 56px;
    }

    .desktop-icon img {
        width: 48px;
        height: 48px;
    }

    .window {
        max-width: 100%;
        margin: 12px 0;
    }

    #taskbar {
        padding: 0 12px;
    }
}

.login-box {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 80px rgba(100, 140, 255, 0.08);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.logo i {
    font-size: 44px;
    color: #ffffff;
}

.logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.logo .version {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.login-form-container {
    margin-bottom: 20px;
}

.login-form,
.register-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Mantém compatibilidade com o fechamento de bloco existente para .register-form h2 */
.register-form h2 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 20px;
}

.login-form .form-group,
.register-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form label,
.register-form label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.login-form input,
.register-form input {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 16px;
}

.login-form .password-field,
.register-form .password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.login-form .password-field input,
.register-form .password-field input {
    width: 100%;
    padding-right: 104px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.28);
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.password-toggle:hover {
    background: rgba(0, 0, 0, 0.4);
}

.password-toggle i {
    font-size: 14px;
}

.login-form input::placeholder,
.register-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-form input:focus,
.register-form input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.login-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cancel-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.form-buttons {
    display: flex;
    gap: 12px;
}

.login-options {
    text-align: center;
    margin-top: 16px;
}

.login-options a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
}

.login-options a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* Desktop */
.desktop-page {
    height: 100vh;
    overflow: hidden;
}

.desktop {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.desktop[data-taskbar-position] {
    --desktop-safe-top: 0px;
    --desktop-safe-right: 0px;
    --desktop-safe-bottom: 0px;
    --desktop-safe-left: 0px;
}

.desktop[data-taskbar-position="bottom"] {
    --desktop-safe-bottom: 48px;
}

.desktop[data-taskbar-position="top"] {
    --desktop-safe-top: 48px;
}

.desktop[data-taskbar-position="left"] {
    --desktop-safe-left: 64px;
}

.desktop[data-taskbar-position="right"] {
    --desktop-safe-right: 64px;
}

.wallpaper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: var(--z-desktop);
    /* background-image será aplicado via JavaScript pelo ThemeManager */
}

/* Ícones da Área de Trabalho */
.desktop-icons {
    position: absolute;
    top: calc(20px + var(--desktop-safe-top));
    left: calc(40px + var(--desktop-safe-left));
    right: calc(20px + var(--desktop-safe-right));
    bottom: calc(20px + var(--desktop-safe-bottom));
    display: block;
    width: auto;
    z-index: calc(var(--z-desktop) + 10);
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 8px;
    border-radius: var(--border-radius-small);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 80px;
    text-align: center;
    user-select: none;
    position: absolute;
}

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

.desktop-icon.selected {
    background: rgba(0, 120, 212, 0.3);
    border: 1px solid rgba(0, 120, 212, 0.6);
}

.desktop-icon:focus-visible {
    outline: 2px solid rgba(0, 196, 255, 0.8);
    outline-offset: 2px;
    background: rgba(0, 0, 0, 0.35);
}

.desktop-icon-hidden {
    opacity: 0.4;
    border-color: rgba(255, 255, 255, 0.15);
}

.icon-hidden-tag {
    margin-top: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d7f2ff;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 999px;
}

.desktop-folder {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.desktop-folder .icon-image {
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05));
    position: relative;
}

.desktop-folder .folder-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 2px;
    border-radius: 999px;
    background: #6f42ff;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(111, 66, 255, 0.35);
    pointer-events: none;
}


.desktop-folder.drop-target {
    border-color: rgba(0, 196, 255, 0.9);
    box-shadow: 0 0 14px rgba(0, 196, 255, 0.4);
}

.icon-image {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.icon-image i {
    font-size: 24px;
    color: #ffffff;
}

.icon-label {
    font-size: 12px;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
    word-wrap: break-word;
}

/* Windows Container */
.windows-container {
    position: absolute;
    top: var(--desktop-safe-top);
    left: var(--desktop-safe-left);
    width: calc(100vw - var(--desktop-safe-left) - var(--desktop-safe-right));
    height: calc(100vh - var(--desktop-safe-top) - var(--desktop-safe-bottom));
    z-index: var(--z-window);
    pointer-events: none;
}

.window {
    position: absolute;
    min-width: 320px;
    min-height: 240px;
    max-width: none;
    background: var(--bg-window);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    backdrop-filter: blur(10px);
    pointer-events: all;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #e8e8e8;
    /* Removidas transições que causavam efeitos indesejados */
}

.window.maximized {
    top: var(--desktop-safe-top) !important;
    left: var(--desktop-safe-left) !important;
    width: calc(100vw - var(--desktop-safe-left) - var(--desktop-safe-right)) !important;
    height: calc(100vh - var(--desktop-safe-top) - var(--desktop-safe-bottom)) !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0;
}

.window.minimized {
    opacity: 0;
    transform: scale(0.1);
    pointer-events: none;
}

.window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: move;
    user-select: none;
}

.window-header .window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #f7f7f7;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.window-header .window-title i {
    font-size: 16px;
}

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

.window-control {
    width: 32px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background var(--transition-fast);
}

.window-control.minimize {
    background: #4a4a4a;
    color: #ffffff;
}

.window-control.maximize {
    background: #4a4a4a;
    color: #ffffff;
}

.window-control.close {
    background: #e81123;
    color: #ffffff;
}

.window-control:hover {
    transform: scale(1.1);
}

.window-content {
    flex: 1;
    overflow: auto;
    background: var(--bg-window-content, #060818);
}

/* Barra de Tarefas */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--taskbar-height);
    background: var(--bg-taskbar);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: var(--z-taskbar);
}

.taskbar-start,
.taskbar-center,
.taskbar-end {
    display: flex;
    align-items: center;
    gap: 8px;
}

.taskbar-center {
    flex: 1;
    justify-content: flex-start;
    margin-left: 16px;
}

.start-button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    color: var(--text-primary);
    padding: 8px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.start-button:hover {
    background: #404040;
    transform: translateY(-1px);
}

.start-button.active {
    background: var(--accent-color);
    color: #ffffff;
}

.taskbar-apps {
    display: flex;
    gap: 4px;
}

.taskbar-app {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    border-radius: var(--border-radius-small);
    color: var(--text-primary);
    padding: 6px 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    max-width: 160px;
    position: relative;
}

.taskbar-app:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--border-color);
}

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

.taskbar-app.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #ffffff;
    border-radius: 50%;
}

.taskbar-app span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* System Tray */
.system-tray {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tray-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: 12px;
    color: var(--text-secondary);
}

.tray-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

#systemClock {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
    min-width: 48px;
    text-align: center;
}

/* Menu Iniciar */
.start-menu {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 12px);
    left: 12px;
    width: 320px;
    height: 480px;
    background: var(--bg-window);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    backdrop-filter: blur(20px);
    z-index: var(--z-start-menu);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.start-menu.show {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

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

.start-menu-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info i {
    font-size: 32px;
    color: var(--text-secondary);
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-status {
    font-size: 12px;
    color: var(--text-muted);
}

.start-menu-search {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
}

.start-menu-search i {
    color: var(--text-secondary);
    font-size: 16px;
}

.start-menu-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    font-size: 14px;
}

.start-menu-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.apps-section h3 {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-menu-apps {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-category {
    margin-bottom: 16px;
}

.start-menu-app {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    border-radius: var(--border-radius-small);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.start-menu-app:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.start-menu-app i {
    font-size: 20px;
    color: var(--text-secondary);
    width: 20px;
}

.start-menu-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 4px;
}

.start-menu-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
}

.menu-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius-small);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
}

.menu-action:hover {
    background: #404040;
}

/* Responsive */
@media (max-width: 768px) {
    .desktop-icons {
        position: relative;
        top: auto;
        left: auto;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        padding: 20px;
        height: auto;
        row-gap: 12px;
        column-gap: 20px;
        align-content: center;
    }

    #desktopIcons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        gap: 14px;
        justify-items: center;
        align-items: start;
        align-content: start;
        padding: 48px 16px 96px;
    }

    #desktopIcons .desktop-icon {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        margin: 0;
        width: 60px;
    }

    .start-menu {
        width: calc(100vw - 24px);
        left: 12px;
        right: 12px;
        bottom: calc(var(--taskbar-height) + 8px);
        height: 50vh;
        max-height: 420px;
    }

    .taskbar {
        padding: 0 8px;
        height: var(--taskbar-height);
    }

    .taskbar-app span {
        display: none;
    }

    .system-tray .tray-item span {
        display: none;
    }

    #desktopIcons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        gap: 14px;
        justify-items: center;
        align-items: start;
    }

    #desktopIcons .desktop-icon {
        position: static !important;
        transform: none !important;
        left: auto !important;
        top: auto !important;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .window {
        min-width: 280px;
    }

    #desktopIcons {
        padding: 24px 12px 90px;
        gap: 10px;
        grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
        align-items: start;
        align-content: start;
    }

    :root {
        --taskbar-height: 64px;
    }

    .desktop-icon {
        width: 52px;
    }

    .desktop-icon img {
        width: 44px;
        height: 44px;
    }

    .start-menu {
        width: calc(100vw - 16px);
        left: 8px;
        right: 8px;
        bottom: calc(var(--taskbar-height) + 6px);
        height: 45vh;
        max-height: 360px;
    }

    .login-box {
        padding: 24px;
        margin: 20px;
    }
}

/* Search System Styles */
.search-category h3 {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-category h3 i {
    font-size: 14px;
}

.search-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
}

.search-item:hover,
.search-item.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.search-item.selected {
    background: rgba(103, 126, 234, 0.3);
    border-color: rgba(103, 126, 234, 0.5);
}

.search-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.search-item-icon i {
    font-size: 16px;
}

.search-item-content {
    flex: 1;
    min-width: 0;
}

.search-item-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 2px;
}

.search-item-description {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.search-no-results i {
    font-size: 48px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    display: block;
}

.search-no-results h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 8px 0;
}

.search-no-results p {
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

.search-suggestions {
    padding: 8px 0;
}

/* Animation for search results */
.search-category {
    opacity: 0;
    animation: fadeInUp 0.3s ease forwards;
}

.search-category:nth-child(1) {
    animation-delay: 0.1s;
}

.search-category:nth-child(2) {
    animation-delay: 0.2s;
}

.search-category:nth-child(3) {
    animation-delay: 0.3s;
}

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

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

/* Responsive search */
@media (max-width: 768px) {
    .search-container {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }

    .search-box input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .search-item {
        padding: 16px;
    }

    .search-item-icon {
        width: 40px;
        height: 40px;
    }

    .search-item-icon i {
        font-size: 18px;
    }
}

/* Notification System Styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    left: auto;
    bottom: auto;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification-container:focus {
    outline: none;
}

.notification {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transform: translateX(100%);
    opacity: 0;
    animation: slideInNotification 0.3s ease forwards;
}

.notification.hiding {
    animation: slideOutNotification 0.3s ease forwards;
}

.notification:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.6);
    outline-offset: 4px;
}

.notification-container[data-viewport="compact"] {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: 16px;
}

.notification-container[data-viewport="compact"] .notification {
    min-width: auto;
    width: 100%;
    margin: 0;
}

.global-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 12000;
}

.global-confirm-overlay.visible {
    display: flex;
}

.global-confirm-modal {
    background: rgba(20, 23, 38, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: min(420px, 90vw);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
    color: var(--text-primary, #fff);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.global-confirm-header,
.global-confirm-footer {
    padding: 20px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.global-confirm-footer {
    padding-bottom: 20px;
}

.global-confirm-body {
    padding: 0 24px;
    color: var(--text-secondary, #c0c4d7);
    line-height: 1.5;
}

.global-confirm-close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
}

.global-confirm-footer button {
    flex: 1;
}

.notification::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
}

.notification.success::before {
    background: #10b981;
}

.notification.error::before {
    background: #ef4444;
}

.notification.warning::before {
    background: #f59e0b;
}

.notification.info::before {
    background: #3b82f6;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    color: white;
}

.notification.success .notification-icon {
    background: #10b981;
}

.notification.error .notification-icon {
    background: #ef4444;
}

.notification.warning .notification-icon {
    background: #f59e0b;
}

.notification.info .notification-icon {
    background: #3b82f6;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    color: #f0f0f0;
    flex: 1;
}

.notification-close {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
}

.notification-message {
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.4;
    margin-left: 44px;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 12px 12px;
    transform-origin: left;
    animation: notificationProgress var(--duration, 5s) linear forwards;
}

.notification.success .notification-progress {
    background: #10b981;
}

.notification.error .notification-progress {
    background: #ef4444;
}

.notification.warning .notification-progress {
    background: #f59e0b;
}

.notification.info .notification-progress {
    background: #3b82f6;
}

/* Notification Actions */
.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    margin-left: 44px;
}

.notification-action {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    color: #d1d5db;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-action:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
}

.notification-action.primary {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.notification-action.primary:hover {
    background: rgba(103, 126, 234, 0.9);
}

/* Animations */
@keyframes slideInNotification {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideOutNotification {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes notificationProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .notification {
        transform: translateY(-100%);
    }

    @keyframes slideInNotification {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }

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

    @keyframes slideOutNotification {
        from {
            transform: translateY(0);
            opacity: 1;
        }

        to {
            transform: translateY(-100%);
            opacity: 0;
        }
    }
}

/* Alt+Tab Overlay Styles */
.alt-tab-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    pointer-events: none;
}

.alt-tab-overlay.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.alt-tab-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 80vw;
    max-height: 70vh;
    min-width: 400px;
}

.alt-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #333;
}

.alt-tab-header i {
    font-size: 20px;
    margin-right: 12px;
    color: var(--accent-color);
}

.alt-tab-header span {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.alt-tab-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
}

.alt-tab-hint kbd {
    padding: 2px 6px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
}

.alt-tab-windows {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.alt-tab-window {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.alt-tab-window:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(103, 126, 234, 0.3);
    transform: translateY(-2px);
}

.alt-tab-window.active {
    background: rgba(103, 126, 234, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(103, 126, 234, 0.3);
}

.window-preview {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    overflow: hidden;
}

.window-preview-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.window-preview-header i {
    margin-right: 8px;
    color: var(--accent-color);
    font-size: 14px;
}

.window-preview-title {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window-preview-content {
    height: 80px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.preview-placeholder i {
    font-size: 32px;
}

.alt-tab-window .window-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .alt-tab-container {
        margin: 20px;
        min-width: auto;
        width: calc(100vw - 40px);
        max-width: none;
    }

    .alt-tab-windows {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .alt-tab-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .alt-tab-hint {
        justify-content: center;
    }

    .window-preview-content {
        height: 60px;
    }

    .preview-placeholder i {
        font-size: 24px;
    }
}

/* Animation for Alt+Tab windows */
.alt-tab-window {
    opacity: 0;
    animation: fadeInScale 0.3s ease forwards;
}

.alt-tab-window:nth-child(1) {
    animation-delay: 0.05s;
}

.alt-tab-window:nth-child(2) {
    animation-delay: 0.1s;
}

.alt-tab-window:nth-child(3) {
    animation-delay: 0.15s;
}

.alt-tab-window:nth-child(4) {
    animation-delay: 0.2s;
}

.alt-tab-window:nth-child(5) {
    animation-delay: 0.25s;
}

.alt-tab-window:nth-child(6) {
    animation-delay: 0.3s;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

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

/* Taskbar Position Variants */
.taskbar.position-bottom {
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: 48px;
    flex-direction: row;
}

.taskbar.position-top {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: 100%;
    height: 48px;
    flex-direction: row;
    border-top: none;
    border-bottom: 1px solid var(--border-color);
}

.taskbar.position-left {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    width: 64px;
    height: 100%;
    flex-direction: column;
    border-top: none;
    border-right: 1px solid var(--border-color);
    padding: 12px 0;
}

.taskbar.position-right {
    right: 0;
    left: auto;
    top: 0;
    bottom: 0;
    width: 64px;
    height: 100%;
    flex-direction: column;
    border-top: none;
    border-left: 1px solid var(--border-color);
    padding: 12px 0;
}

/* Desktop adjustments for taskbar positions */
.desktop[data-taskbar-position="bottom"] {
    padding-bottom: 48px;
}

.desktop[data-taskbar-position="top"] {
    padding-top: 48px;
}

.desktop[data-taskbar-position="left"] {
    padding-left: 64px;
}

.desktop[data-taskbar-position="right"] {
    padding-right: 64px;
}

/* Taskbar content adjustments for vertical positions */
.taskbar.position-left .taskbar-start,
.taskbar.position-left .taskbar-center,
.taskbar.position-left .taskbar-end,
.taskbar.position-right .taskbar-start,
.taskbar.position-right .taskbar-center,
.taskbar.position-right .taskbar-end {
    flex-direction: column;
    width: 100%;
}

.taskbar.position-left .taskbar-center,
.taskbar.position-right .taskbar-center {
    margin-left: 0;
    margin-top: 16px;
    flex: 1;
}

/* Hide text in vertical taskbar */
.taskbar.position-left .taskbar-app span,
.taskbar.position-right .taskbar-app span,
.taskbar.position-left .start-button span,
.taskbar.position-right .start-button span {
    display: none;
}

.taskbar.position-left .taskbar-app,
.taskbar.position-right .taskbar-app {
    width: 48px;
    justify-content: center;
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: fixed;
    bottom: 60px;
    right: 12px;
    width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.user-menu-dropdown.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-menu-header {
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar i {
    font-size: 28px;
    color: white;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-fullname {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.user-menu-items {
    padding: 8px;
}

.user-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-align: left;
}

.user-menu-item:hover {
    background: var(--bg-tertiary);
}

.user-menu-item i {
    font-size: 18px;
    width: 18px;
    flex-shrink: 0;
}

.user-menu-item.danger {
    color: #dc3545;
}

.user-menu-item.danger:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* Desktop Icons Drag & Drop */
.desktop-icon {
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
    cursor: grab;
    user-select: none;
}

.desktop-icon.dragging {
    opacity: 0.8;
    cursor: grabbing;
    transform: scale(1.1);
    transition: none;
    z-index: 1000;
}

.desktop-icon.selected {
    background: rgba(0, 123, 255, 0.2);
    border-radius: 8px;
}

/* Desktop Icons Container */
#desktopIcons {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 20px 16px 80px;
}

/* Smooth Transitions & Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Apply animations */
.window {
    animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.start-menu {
    animation: slideInUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-menu-dropdown {
    animation: slideInUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* .notification já tem animação própria slideInNotification definida anteriormente */

.desktop-icon {
    animation: fadeIn 0.4s ease forwards;
}

.desktop-icon:nth-child(1) {
    animation-delay: 0.05s;
}

.desktop-icon:nth-child(2) {
    animation-delay: 0.1s;
}

.desktop-icon:nth-child(3) {
    animation-delay: 0.15s;
}

.desktop-icon:nth-child(4) {
    animation-delay: 0.2s;
}

.desktop-icon:nth-child(5) {
    animation-delay: 0.25s;
}

.desktop-icon:nth-child(6) {
    animation-delay: 0.3s;
}

.desktop-icon:nth-child(7) {
    animation-delay: 0.35s;
}

.desktop-icon:nth-child(8) {
    animation-delay: 0.4s;
}

/* Loading state animation */
.loading-spinner i {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth hover transitions */
button,
.btn,
.toolbar-btn,
.menu-action {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Context menu animation */
.context-menu {
    animation: fadeIn 0.15s ease;
}

/* Taskbar app animation on open */
.taskbar-app {
    transition: all 0.2s ease;
}

.taskbar-app.active {
    animation: pulse 0.5s ease;
}

/* Desktop dialogs */
.desktop-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 20, 0.72);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.desktop-dialog {
    width: min(420px, 90vw);
    background: rgba(7, 11, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.desktop-dialog h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #f8fbff;
}

.desktop-dialog label {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
}

.desktop-dialog input,
.desktop-dialog select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 14px;
}

.desktop-dialog input:focus,
.desktop-dialog select:focus {
    border-color: rgba(0, 186, 255, 0.8);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 186, 255, 0.2);
}

.desktop-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.desktop-dialog__actions button {
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.desktop-dialog__actions button[data-action="cancel"] {
    background: rgba(255, 255, 255, 0.08);
    color: #d4d7dd;
}

.desktop-dialog__actions button[data-variant="primary"] {
    background: linear-gradient(135deg, #00b4d8, #0077ff);
    color: #fff;
    box-shadow: 0 12px 24px rgba(0, 119, 255, 0.35);
}

.folder-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 16px;
}

.folder-items-list .folder-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.folder-items-list .folder-item span {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #eef4ff;
    font-size: 14px;
}

.folder-items-list .folder-item button {
    padding: 6px 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    background: rgba(0, 186, 255, 0.15);
    color: #8ce1ff;
}

.folder-items-list .folder-item button:hover {
    background: rgba(0, 186, 255, 0.25);
}

.folder-items-list .folder-item-empty {
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    padding: 12px;
}

.folder-window {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 10px 14px;
    height: 100%;
    max-height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.folder-window-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 16, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s ease;
    width: 180px;
    position: relative;
}

.folder-window-item:hover {
    background: rgba(111, 66, 255, 0.25);
}

.folder-window-item-hidden {
    opacity: 0.45;
}

.folder-window-item .folder-hidden-tag {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f1f5ff;
}

.folder-hidden-notice {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px;
    color: #f1f5ff;
    margin-bottom: 8px;
}

.folder-hidden-notice button {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    background: rgba(0, 186, 255, 0.25);
    color: #e6f7ff;
    cursor: pointer;
}

.folder-window-item .folder-app-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
}

.folder-window-item .folder-app-icon i {
    font-size: 20px;
    color: #ffffff;
}

.folder-window-item .folder-app-label {
    display: -webkit-box;
    font-size: 12px;
    color: #f1f5ff;
    line-height: 1.2;
    text-align: left;
    max-width: 120px;
    white-space: normal;
    word-break: break-word;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.desktop-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.desktop-dialog__close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 999px;
}

.desktop-dialog__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
