:root {
    /* Windows 11 Light Mode Default Variables */
    --font-family: 'Segoe UI', system-ui, sans-serif;
    --os-background: url('https://images.unsplash.com/photo-1622737133809-d95047b9e673?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    --taskbar-bg: rgba(243, 243, 243, 0.85);
    --taskbar-border: rgba(0, 0, 0, 0.1);
    --taskbar-text: #202020;
    --item-hover: rgba(255, 255, 255, 0.6);
    --window-bg: rgba(255, 255, 255, 0.95);
    --window-text: #202020;
    --start-text: var(--window-text);
    --window-border: rgba(0, 0, 0, 0.1);
    --window-radius: 8px;
    --window-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --start-bg: rgba(243, 243, 243, 0.9);
    --start-radius: 8px;
    --start-bottom-margin: 60px;
    --start-left-margin: 50%;
    --start-transform: translateX(-50%);
    --taskbar-position-bottom: 0;
    --taskbar-position-top: auto;
    --taskbar-radius: 0;
    --taskbar-margin: 0;
    --taskbar-width: 100%;
    --accent: #0078D4;
    --backdrop-filter: blur(20px);
}

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

.hidden-icon {
    display: none !important;
}

html, body {
    font-family: var(--font-family);
    overflow: hidden !important;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    position: fixed;
    top: 0; left: 0;
    background: #000;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
}

#desktop {
    width: 100%;
    height: 100%;
    background: var(--os-background);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Desktop Icons */
.desktop-icons {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: calc(100% - 10px); /* Reaches almost until the taskbar */
    flex-wrap: wrap;
    align-content: flex-start;
}

.desktop-icon {
    width: 85px;
    height: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 5px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.desktop-icon.selected {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.desktop-icon .icon-img {
    font-size: 32px;
    margin-bottom: 5px;
}

.desktop-icon span {
    font-size: 12px;
    text-align: center;
    word-break: break-word;
}

/* Reduzir espaçamento no mobile */
@media (max-width: 1024px) {
    .desktop-icons {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        justify-items: center !important;
        align-content: start !important;
        gap: 0px !important;
        padding: 5px !important;
        padding-bottom: 250px !important; /* Ensure last apps are reachable below taskbar */
        height: 100% !important;
        overflow-y: auto !important;
        position: absolute !important;
        width: 100% !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .desktop-icon {
        margin-bottom: 5px !important;
        height: 75px !important;
        width: 100% !important;
        max-width: 80px !important;
        position: relative !important;
    }
}

.os-watermark {
    position: fixed;
    top: 45px;
    bottom: auto;
    right: 30px;
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5);
    user-select: none;
}
.os-watermark h1 {
    font-size: 42px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 2px;
}
.os-watermark p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    letter-spacing: 1px;
}

/* Windows Container */
#windows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.window {
    position: absolute;
    background: var(--window-bg);
    border: 1px solid var(--window-border);
    border-radius: var(--window-radius);
    box-shadow: var(--window-shadow);
    color: var(--window-text);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    overflow: hidden;
    min-width: 300px;
    min-height: 200px;
    box-sizing: border-box;
    backdrop-filter: var(--backdrop-filter);
    transition: transform 0.2s;
}

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

.window-header {
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    background: transparent;
    cursor: default;
}

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

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

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

.win-control:hover {
    background: var(--item-hover);
}

.win-control.close:hover {
    background: #e81123;
    color: white;
}

.window-content {
    flex: 1;
    position: relative;
    background: var(--window-bg);
}

.window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* Taskbar */
#taskbar {
    position: absolute;
    bottom: var(--taskbar-position-bottom);
    top: var(--taskbar-position-top);
    left: 50%;
    transform: translateX(-50%);
    width: var(--taskbar-width);
    height: 48px;
    background: var(--taskbar-bg);
    backdrop-filter: var(--backdrop-filter);
    border-radius: var(--taskbar-radius);
    border: 1px solid var(--taskbar-border);
    margin: var(--taskbar-margin);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 10000;
    box-shadow: 0 -1px 10px rgba(0,0,0,0.1);
    color: var(--taskbar-text);
}

.taskbar-left { flex: 1; display: flex; align-items: center; justify-content: flex-start; }
.taskbar-left { flex: 1; display: flex; align-items: center; justify-content: flex-start; }
.taskbar-center {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    gap: 5px;
    max-width: calc(100% - 650px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.taskbar-center::-webkit-scrollbar {
    display: none;
}

.taskbar-item {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    color: var(--taskbar-text);
}

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

.taskbar-item:active {
    transform: scale(0.95);
}

.start-btn {
    font-size: 20px;
}

.start-btn .win-icon { color: #0078D4; }

#taskbar-apps {
    display: flex;
    gap: 5px;
}

.taskbar-app-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    position: relative;
    flex-shrink: 0;
}
.taskbar-app-icon:hover {
    background: var(--item-hover);
}
.taskbar-app-icon.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.taskbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    flex: 1;
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 15px;
    font-size: 14px;
    height: 100%;
    border-radius: 4px;
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: var(--start-bottom-margin, 60px);
    left: var(--start-left-margin, 50%);
    top: var(--start-top-margin, auto);
    transform: var(--start-transform, translateX(-50%));
    width: var(--start-width, 450px);
    height: var(--start-height, 550px);
    background: var(--start-bg, rgba(255,255,255,0.9));
    backdrop-filter: var(--backdrop-filter, blur(20px));
    border: 1px solid var(--window-border, rgba(0,0,0,0.1));
    border-radius: var(--start-radius, 12px);
    box-shadow: var(--window-shadow, 0 10px 30px rgba(0,0,0,0.2));
    z-index: 10001;
    display: flex;
    flex-direction: column;
    color: var(--start-text, #333);
    transition: opacity 0.2s, transform 0.2s;
    padding: 24px;
    box-sizing: border-box;
}

#start-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: var(--start-hidden-transform, var(--start-transform) translateY(20px));
}

.start-header input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background: rgba(0,0,0,0.05);
    outline: none;
    color: var(--start-text);
    font-family: inherit;
    border: 1px solid rgba(0,0,0,0.1);
    box-sizing: border-box;
}

.start-content {
    flex: 1;
    margin-top: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px; /* space for scrollbar */
}

/* Custom Scrollbar for sleek UI */
.start-content::-webkit-scrollbar {
    width: 4px;
}
.start-content::-webkit-scrollbar-track {
    background: transparent; 
}
.start-content::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3); 
    border-radius: 4px;
}
.start-content::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.6); 
}

.pinned-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

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

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 0;
}

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

.app-item i {
    font-size: 24px;
}

.app-item span {
    font-size: 12px;
    text-align: center;
    width: 100%;
    word-break: break-word;
}

.start-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--window-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.user-info img {
    width: 32px;
    height: 32px;
}

.power-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
}

.power-btn:hover {
    background: var(--item-hover);
    color: #e81123;
}

/* Settings DOM Application */
.settings-app {
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--window-bg);
}

.settings-sidebar {
    width: 200px;
    border-right: 1px solid var(--window-border);
    padding: 10px;
}

.settings-sidebar ul {
    list-style: none;
}

.settings-sidebar li {
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 5px;
}

.settings-sidebar li.active {
    background: rgba(0, 120, 212, 0.1);
    color: var(--accent);
    font-weight: 500;
}

.settings-content {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
}

.settings-content h2 {
    margin-bottom: 30px;
    font-weight: 500;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group h3 {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 500;
}

.theme-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    flex: 1 1 calc(20% - 10px); /* 5 cards per row */
    max-width: calc(20% - 5px);
}
.theme-card span {
    margin-top: 4px;
    font-weight: 500;
    font-size: 11px;
}

.theme-card:hover {
    background: rgba(0,0,0,0.05);
}

.theme-card.active {
    border-color: var(--accent);
    background: rgba(0, 120, 212, 0.05);
}

.theme-card img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 2px;
    border: 1px solid var(--window-border);
}

.mode-options {
    display: flex;
    gap: 10px;
}

.mode-btn {
    padding: 8px 20px;
    border: 1px solid var(--window-border);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--window-text);
}

.mode-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Themes Overrides */
/* Dark Mode General */
[data-mode="escuro"] {
    --taskbar-bg: rgba(30, 30, 30, 0.85);
    --taskbar-text: #fff;
    --taskbar-border: rgba(255, 255, 255, 0.1);
    --item-hover: rgba(255, 255, 255, 0.1);
    --window-bg: rgba(30, 30, 30, 0.95);
    --window-text: #fff;
    --window-border: rgba(255, 255, 255, 0.1);
    --start-bg: rgba(30, 30, 30, 0.9);
}

/* macOS Theme */
[data-theme="mac"] .window.maximized {
    top: 28px !important;
    height: calc(100% - 28px) !important;
}
[data-theme="mac"] .desktop-icons {
    display: none !important;
}
#mac-topbar { display: none; }
[data-theme="mac"] #mac-topbar {
    display: flex !important;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 28px;
    background: rgba(255, 255, 255, 0.2); /* MacOS light blur */
    backdrop-filter: blur(20px);
    z-index: 10005;
    padding: 0 15px;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #1a1a1a;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}
[data-mode="escuro"][data-theme="mac"] #mac-topbar {
    background: rgba(0, 0, 0, 0.4);
    color: #e0e0e0;
}
[data-theme="mac"] #mac-topbar .mac-topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}
[data-theme="mac"] #mac-topbar .mac-topbar-left span {
    cursor: pointer;
}
[data-theme="mac"] #mac-topbar .mac-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
[data-theme="mac"] {
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --os-background: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    --taskbar-position-bottom: 10px;
    --taskbar-width: max-content;
    --taskbar-margin: 0 auto;
    --taskbar-radius: 16px;
    --taskbar-bg: rgba(255, 255, 255, 0.4);
    --taskbar-border: 1px solid rgba(255, 255, 255, 0.2);
    /* Mac Launchpad configuration */
    --start-bg: rgba(0, 0, 0, 0.5);
    --start-radius: 0;
    --start-bottom-margin: 0;
    --start-left-margin: 0;
    --start-top-margin: 0;
    --start-transform: none;
    --start-hidden-transform: scale(1.05); /* launchpad zoom effect */
    --start-width: 100%;
    --start-height: 100%;
    --window-radius: 12px;
}
[data-theme="mac"] #mac-pinned-dock {
    display: flex !important;
    align-items: flex-end;
}
[data-theme="mac"] .taskbar-center {
    position: static;
    transform: none;
    left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 100%;
    overflow: visible;
}
[data-theme="mac"] #taskbar-apps {
    align-items: flex-end;
    padding-bottom: 2px;
}
[data-theme="mac"] .taskbar-app-icon {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: bottom center;
    background: transparent;
    padding: 5px;
    position: relative;
}
[data-theme="mac"] .taskbar-app-icon::before {
    content: attr(data-title);
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, bottom 0.2s;
    font-family: var(--font-family);
}
[data-theme="mac"] .taskbar-app-icon .icon-img,
[data-theme="mac"] .taskbar-app-icon i {
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
[data-theme="mac"] .taskbar-app-icon:hover {
    transform: scale(1.6);
    margin: 0 10px;
    z-index: 100;
}
[data-theme="mac"] .taskbar-app-icon:hover::before {
    opacity: 1;
    bottom: calc(100% + 10px);
}
[data-theme="mac"][data-mode="escuro"] {
    --taskbar-bg: rgba(0, 0, 0, 0.4);
    --taskbar-border: rgba(255, 255, 255, 0.1);
    --os-background: url('https://images.unsplash.com/photo-1579546929518-9e396f3cc809?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
}
[data-theme="mac"] .taskbar-right { display: none; }
[data-theme="mac"] .win-control.close { background: #ff5f56; color: #4c0000; order: 1; border-radius: 50%; width: 12px; height: 12px; margin: 0 4px; }
[data-theme="mac"] .win-control.minimize { background: #ffbd2e; color: #995700; order: 2; border-radius: 50%; width: 12px; height: 12px; margin: 0 4px; }
[data-theme="mac"] .win-control.maximize { background: #27c93f; color: #004d00; order: 3; border-radius: 50%; width: 12px; height: 12px; margin: 0 4px; }
[data-theme="mac"] .window-controls { order: -1; padding-right: 15px;}
[data-theme="mac"] .window-header { justify-content: flex-start; }
[data-theme="mac"] .win-control i { display: inline-block; font-size: 8px; font-weight: bold; opacity: 0; transition: opacity 0.2s; }
[data-theme="mac"] .window-controls:hover .win-control i { opacity: 0.8; }
[data-theme="mac"] .start-btn .win-icon { display: none; }
[data-theme="mac"] .start-btn .mac-icon { display: inline-block !important; font-size: 20px; color: #000; }
[data-mode="escuro"][data-theme="mac"] .start-btn .mac-icon { color: #fff; }

/* Mac Launchpad overrides inside Start Menu */
[data-theme="mac"] #start-menu .start-header, [data-theme="mac"] #start-menu .start-footer { display: none; }
[data-theme="mac"] #start-menu .start-content { display: flex; align-items: center; justify-content: center; overflow: hidden; }
[data-theme="mac"] #start-menu .pinned-section h3 { display: none; }
[data-theme="mac"] #start-menu .pinned-apps { grid-template-columns: repeat(7, 1fr); max-width: 1000px; gap: 40px; margin: 0 auto; }
[data-theme="mac"] #start-menu .app-item span { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.8); font-size: 14px; margin-top: 5px; }
[data-theme="mac"] #start-menu .app-item i { font-size: 55px; }

.mac-start-close { display: none; }
[data-theme="mac"] .mac-start-close, [data-theme="ubuntu"] .mac-start-close {
    display: flex;
    position: absolute;
    top: 40px;
    right: 40px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    cursor: pointer;
    font-weight: 300;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
}
[data-theme="mac"] .mac-start-close:hover, [data-theme="ubuntu"] .mac-start-close:hover { opacity: 1; transform: scale(1.1); }

/* Zorin OS Theme */
[data-theme="zorin"] {
    --font-family: 'Inter', sans-serif;
    --os-background: url('https://images.unsplash.com/photo-1579546929518-9e396f3cc809?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    --taskbar-bg: rgba(30,30,30,0.9);
    --taskbar-text: #fff;
    --accent: #2196f3;
    --start-bg: rgba(30,30,30,0.96);
    --start-text: #fff;
    --start-left-margin: 10px;
    --start-bottom-margin: 55px;
    --start-transform: translateY(0);
    --start-hidden-transform: translateY(20px);
    --start-width: 400px;
    --start-height: 550px;
    --start-radius: 12px;
    --window-bg: #fff;
    --window-text: #333;
    --window-radius: 6px;
    --taskbar-position-bottom: 0;
    --taskbar-width: 100%;
    --taskbar-margin: 0;
    --taskbar-radius: 0;
}
[data-theme="zorin"] .taskbar { justify-content: flex-start; }
[data-theme="zorin"] .taskbar-center {
    position: static;
    transform: none;
    left: auto;
    margin-left: 10px;
    flex: none;
    width: auto;
    justify-content: flex-start;
    max-width: calc(100% - 380px);
}
[data-theme="zorin"] .taskbar-right { margin-left: auto; }
[data-theme="zorin"] .start-btn .win-icon { display: none; }
[data-theme="zorin"] .start-btn .zorin-icon { display: inline-block !important; font-size: 20px; color: #fff; }
[data-theme="zorin"][data-mode="escuro"] {
    --window-bg: #1e1e1e;
    --window-text: #fff;
}

/* Ubuntu (GNOME) Theme */
[data-theme="ubuntu"] {
    --font-family: 'Ubuntu', 'Segoe UI', system-ui, sans-serif;
    --os-background: url('../img/ubuntu-bg.png') center/cover no-repeat;
    --taskbar-bg: rgba(44, 0, 30, 0.95);
    --taskbar-text: #fff;
    --taskbar-border: none;
    --accent: #E95420;
    --start-bg: rgba(35, 35, 35, 0.98);
    --start-width: 100%;
    --start-height: 100%;
    --start-bottom-margin: 0;
    --start-left-margin: 0;
    --start-transform: none;
    --start-text: #fff;
    --window-bg: #fff;
    --window-text: #333;
    --window-radius: 12px;
    --taskbar-position-bottom: auto;
    --taskbar-width: 65px;
    --taskbar-radius: 0px;
}

/* Ubuntu GNOME Full Layout (Top Bar + Left Dock) */

/* Transformar a barra de tarefas base num contendor invisível cheio */
[data-theme="ubuntu"] #taskbar {
    top: 0 !important; bottom: 0 !important; left: 0 !important; right: 0 !important;
    width: 100% !important; height: 100% !important;
    transform: none !important; /* <--- FIX: Removes the -50% translation from Win11 */
    background: transparent;
    backdrop-filter: none !important;
    flex-direction: column;
    padding: 0; margin: 0; /* Remove any margin */
    z-index: 1000;
    pointer-events: none; /* Deixa os cliques passarem para o desktop no meio visual */
}

/* Simular Top Bar (Barra Superior Preta GNOME) */
[data-theme="ubuntu"] #taskbar::before {
    content: '';
    position: absolute;  top: 0; left: 0;
    width: 100%; height: 32px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: var(--backdrop-filter);
    z-index: -1;
    pointer-events: auto;
}

/* Simular Left Dock (Doca Esquerda) */
[data-theme="ubuntu"] #taskbar::after {
    content: '';
    position: absolute; top: 32px; left: 0;
    width: 70px; height: calc(100% - 32px);
    background: rgba(44, 0, 30, 0.95);
    backdrop-filter: var(--backdrop-filter);
    z-index: -1;
    pointer-events: auto;
}

/* Ícones de Ambiente de Trabalho transformados nos Ícones de Doca Pinned */
[data-theme="ubuntu"] .desktop-icons {
    position: absolute;
    top: 32px; /* Logo abaixo da Top Bar */
    left: 0;
    width: 70px;
    height: calc(100% - 350px); /* Deixa espaço exato na base para Open Apps! Nunca sobressaem */
    padding: 10px 0;
    margin: 0;
    z-index: 10005; /* Fica acima da taskbar wrapper no contexto */
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    padding-left: 16px; 
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto; 
    scrollbar-width: none;
}
[data-theme="ubuntu"] .desktop-icons::-webkit-scrollbar { display: none; }

[data-theme="ubuntu"] .desktop-icons::-webkit-scrollbar { width: 0; display: none; }

[data-theme="ubuntu"] .desktop-icon {
    width: 38px !important; min-height: 38px !important; height: 38px !important;
    margin: 0 !important; padding: 0 !important;
    background: transparent; border: none; border-radius: 8px;
    display: flex !important; justify-content: center !important; align-items: center !important;
    position: relative;
    pointer-events: auto; /* restore clicks to the icons themselves */
}
[data-theme="ubuntu"] .desktop-icon:hover { background: rgba(255,255,255,0.1); }
[data-theme="ubuntu"] .desktop-icon span {
    display: block !important;
    position: fixed;
    margin-left: 60px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    font-size: 13px !important;
    z-index: 100000;
    font-weight: 400;
    text-shadow: none !important;
}
[data-theme="ubuntu"] .desktop-icon:hover span {
    opacity: 1;
    left: calc(100% + 10px);
}
[data-theme="ubuntu"] .desktop-icon .icon-img { 
    font-size: 28px !important; 
    margin: 0 !important; 
    text-shadow: none; 
    width: 28px !important; 
    height: auto !important; 
    object-fit: contain; 
    /* Garantir visibilidade dos ícones na doca escura */
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

[data-theme="ubuntu"] .window.maximized {
    top: 32px !important;
    left: 70px !important;
    width: calc(100% - 70px) !important;
    height: calc(100% - 32px) !important;
}

[data-theme="ubuntu"] .taskbar-left {
    display: flex;
    position: fixed;
    top: 0;
    left: 20px;
    height: 32px;
    align-items: center;
    color: white;
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto;
    z-index: 10001;
}
/* taskbar-center para ubuntu é gerido abaixo dentro de @media */
[data-theme="ubuntu"] .taskbar-right {
    display: flex !important;
    position: fixed !important;
    top: 0;
    right: 20px;
    height: 32px;
    align-items: center;
    color: white;
    font-size: 14px;
    pointer-events: auto;
    z-index: 10001;
    margin: 0 !important;
}

.ubuntu-activities { display: none; }
[data-theme="ubuntu"] .ubuntu-activities {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    height: 100%;
    padding: 0 10px;
    transition: background 0.2s;
    border-radius: 4px;
}
[data-theme="ubuntu"] .ubuntu-activities:hover {
    background: rgba(255, 255, 255, 0.1);
}
[data-theme="ubuntu"] .ubuntu-activities .ubuntu-small-icon {
    font-size: 16px;
}

/* Área das Apps Abertas e o botão Show Applications na Doca */
[data-theme="ubuntu"] .taskbar-center { 
    position: absolute;
    top: auto; bottom: 0; left: 0;
    width: 70px; height: 318px; /* Ocupa rigorosamente o espaço inferior que a Doca Pinned deixou vazio */
    flex-direction: column; flex: 0; align-items: center; justify-content: flex-end; 
    gap: 0px; margin: 0; padding: 0; padding-bottom: 15px; /* Espaço para o botão start */
    pointer-events: auto; /* Aceitar scroll e clique nesta secção */
    z-index: 10000;
}
[data-theme="ubuntu"] #taskbar-apps { flex-direction: column; width: 100%; align-items: center; gap: 10px; margin-top: 10px; overflow-y: auto; pointer-events: auto; padding-right: 5px; scrollbar-width: none; }
[data-theme="ubuntu"] #taskbar-apps::-webkit-scrollbar { display: none; }
[data-theme="ubuntu"] .taskbar-app-icon { min-width: 48px; height: 48px; border-radius: 8px; margin: 0; position: relative; }
[data-theme="ubuntu"] .taskbar-app-icon::after { content: ''; position: absolute; left: 2px; top: 50%; transform: translateY(-50%); width: 3px; height: 15px; background: #E95420; border-radius: 3px; }

[data-theme="ubuntu"] .start-btn { order: 99; margin: 10px 0; min-width: 48px; height: 48px; background: rgba(255,255,255,0.05); border-radius: 8px; position: sticky; bottom: 10px; z-index: 10; }

/* Barra Superior: Relógio Frontal */
[data-theme="ubuntu"] #system-clock { 
    position: fixed;
    top: 0; left: 50vw; transform: translateX(-50%);
    height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #fff;
    writing-mode: horizontal-tb; margin: 0; text-align: center; 
    pointer-events: auto;
}

/* Barra Superior: Opções de Sistema na Direita */
[data-theme="ubuntu"] .taskbar-right { 
    position: absolute;
    top: 0; right: 20px;
    height: 32px;
    flex-direction: row; align-items: center; justify-content: flex-end;
    margin: 0; padding: 0; gap: 15px; border: none; width: auto;
    pointer-events: auto;
}
[data-theme="ubuntu"] .system-tray { flex-direction: row; gap: 15px; }

.power-btn-ubuntu { display: none; }
[data-theme="ubuntu"] .power-btn-ubuntu { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 24px; 
    height: 24px; 
    cursor: pointer; 
    color: white; 
    transition: color 0.2s; 
}
[data-theme="ubuntu"] .power-btn-ubuntu:hover { color: #E95420; }

[data-theme="ubuntu"] .start-btn .win-icon { display: none; }
[data-theme="ubuntu"] .start-btn .ubuntu-icon { display: inline-block !important; font-size: 26px; color: #fff; }

/* Ubuntu GNOME App Drawer Fullscreen */
[data-theme="ubuntu"] #start-menu { border-radius: 0; box-shadow: none; display: flex; flex-direction: column; z-index: 10000; left:0; transform:none; }
[data-theme="ubuntu"] #start-menu.hidden { display: none !important; }
[data-theme="ubuntu"] #start-menu .start-header { background: transparent; border: none; padding-top: 50px; display: flex; justify-content: center; }
[data-theme="ubuntu"] #start-menu .start-header input { width: 50%; max-width: 600px; padding: 15px 25px; border-radius: 30px; background: rgba(0,0,0,0.5); color: #fff; border: 1px solid rgba(255,255,255,0.1); text-align: center; }
[data-theme="ubuntu"] #start-menu .pinned-section h3 { display: none; }
[data-theme="ubuntu"] #start-menu .start-content { flex: 1; margin-top: 30px; padding: 20px; overflow-y: auto; height: auto; }
[data-theme="ubuntu"] #start-menu .pinned-apps { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important; max-width: 1000px; margin: 0 auto; gap: 40px 20px; }
[data-theme="ubuntu"] #start-menu .app-item { align-items: center; justify-content: center; width: 100px; margin: 0 auto; padding: 15px 5px; border-radius: 12px; }
[data-theme="ubuntu"] #start-menu .app-item i { font-size: 55px; margin-bottom: 12px; }
[data-theme="ubuntu"] #start-menu .app-item span { font-size: 14px; font-weight: 500; text-align: center; color: #fff; }
[data-theme="ubuntu"] #start-menu .start-footer { display: none; }

[data-theme="ubuntu"][data-mode="escuro"] {
    --window-bg: #1e1e1e;
    --window-text: #fff;
}

/* Chrome OS Theme */
[data-theme="chromeos"] {
    --font-family: 'Roboto', 'Segoe UI', system-ui, sans-serif;
    --os-background: url('https://images.unsplash.com/photo-1550684848-fac1c5b4e853?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    --taskbar-bg: rgba(255, 255, 255, 0.85);
    --taskbar-border: none;
    --taskbar-position-bottom: 0;
    --taskbar-width: 100%;
    --taskbar-margin: 0;
    --taskbar-radius: 0;
    
    --start-width: 600px;
    --start-height: 450px;
    --start-bottom-margin: 60px;
    --start-left-margin: 50%;
    --start-transform: translateX(-50%);
    --start-hidden-transform: translateX(-50%) translateY(30px);
    --start-radius: 24px;
    --start-bg: rgba(255, 255, 255, 0.95);
    --start-text: #202124;
}
[data-theme="chromeos"] .start-header input { border-radius: 8px; background: #f1f3f4; border: none; }
[data-theme="chromeos"] .pinned-apps { grid-template-columns: repeat(5, 1fr) !important; gap: 20px; }
[data-theme="chromeos"] .start-btn .win-icon { display: none; }
[data-theme="chromeos"] .start-btn .chrome-icon { display: inline-block !important; font-size: 22px; color: #4285F4; }
[data-theme="chromeos"][data-mode="escuro"] {
    --taskbar-bg: rgba(32, 33, 36, 0.8);
    --start-bg: rgba(32, 33, 36, 0.95);
    --start-text: #fff;
}

/* Projecto35 OS Theme */
[data-theme="ajecos"] {
    --font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    --os-background: url('https://images.unsplash.com/photo-1475924156734-496f6cac6ec1?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    --taskbar-bg: rgba(15, 23, 42, 0.7);
    --taskbar-border: 1px solid rgba(56, 189, 248, 0.5);
    --taskbar-position-bottom: 20px;
    --taskbar-width: max-content;
    --taskbar-margin: 0 auto;
    --taskbar-radius: 30px;
    --taskbar-text: #fff;
    --backdrop-filter: blur(20px);
    
    --start-bg: rgba(15, 23, 42, 0.85);
    --start-border: 1px solid rgba(56, 189, 248, 0.6);
    --start-width: 450px;
    --start-height: 550px;
    --start-bottom-margin: 80px;
    --start-left-margin: 50%;
    --start-transform: translateX(-50%);
    --start-hidden-transform: translateX(-50%) scale(0.9);
    --start-radius: 30px;
    --start-text: #fff;
    --window-radius: 16px;
}
[data-theme="ajecos"] .taskbar { box-shadow: 0 0 20px rgba(56, 189, 248, 0.4); padding: 0 20px; justify-content: center; gap: 20px;}
[data-theme="ajecos"] .taskbar-center { position: static; transform: none; display: flex; align-items: center; justify-content: center; margin: 0 40px;}
[data-theme="ajecos"] #start-menu { box-shadow: 0 0 40px rgba(56, 189, 248, 0.3); }
[data-theme="ajecos"] .app-item:hover { background: rgba(56, 189, 248, 0.2); box-shadow: 0 0 10px rgba(56, 189, 248, 0.3); }
[data-theme="ajecos"] .start-btn .win-icon { display: none; }
[data-theme="ajecos"] .start-btn .ajec-icon { display: inline-block !important; font-size: 26px; color: #38bdf8; text-shadow: 0 0 10px #38bdf8;}

/* Windows XP Theme */
[data-theme="winxp"] {
    --font-family: 'Tahoma', 'Segoe UI', sans-serif;
    --os-background: url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat; /* Bliss-like hill */
    --taskbar-bg: linear-gradient(to bottom, #245edb 0%, #3f8cf3 9%, #245edb 18%, #245edb 92%, #333 100%);
    --taskbar-border: none;
    --taskbar-position-bottom: 0;
    --taskbar-width: 100%;
    --taskbar-margin: 0;
    --taskbar-radius: 0;
    --taskbar-text: #fff;
    --backdrop-filter: none;
    
    --start-bg: #fff;
    --start-border: 1px solid #003399;
    --start-width: 400px;
    --start-height: 550px;
    --start-bottom-margin: 40px;
    --start-left-margin: 0;
    --start-transform: none;
    --start-hidden-transform: translateY(20px);
    --start-radius: 5px 5px 0 0;
    --start-text: #333;
    --window-radius: 4px;
}
[data-theme="winxp"] .taskbar { justify-content: flex-start; }
[data-theme="winxp"] .taskbar-center { position: static; transform: none; display: flex; align-items: center; justify-content: flex-start; margin-left: 10px; flex: 1;}
[data-theme="winxp"] .taskbar-right { margin-left: auto; width: auto; background: #0f8ce8; box-shadow: inset 1px 0 3px rgba(0,0,0,0.3); padding: 0 15px; border-left: 1px solid #1a5ac6; }
[data-theme="winxp"] .start-btn { 
    background: linear-gradient(to bottom, #389d44 0%, #47b252 50%, #3a9741 100%);
    border-radius: 0 10px 10px 0;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.7), 2px 0 3px rgba(0,0,0,0.3);
    min-width: 100px;
    height: 100%;
    margin: 0;
}
[data-theme="winxp"] .start-btn .win-icon { display: none; }
[data-theme="winxp"] .start-btn::after { content: 'Iniciar'; font-weight: bold; font-style: italic; color: #fff; font-size: 16px; margin-left: 5px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
[data-theme="winxp"] .taskbar-app-icon { border-radius: 3px; min-width: 140px; justify-content: flex-start; background: #3c81f3; border: 1px solid #1a5ac6; margin-right: 5px; padding: 0 10px; }
[data-theme="winxp"] .taskbar-app-icon.active { background: #1e5dd3; box-shadow: inset 0 0 5px rgba(0,0,0,0.5); }
[data-theme="winxp"] .taskbar-app-icon::after { content: attr(title); font-size: 12px; margin-left: 8px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="winxp"] #start-menu .start-header { background: linear-gradient(to bottom, #245edb, #3f8cf3); padding: 15px; }
[data-theme="winxp"] #start-menu .start-header input { display: none; } /* XP didn't have huge search bar in header */

/* Windows 7 Theme (Aero Glass) */
[data-theme="win7"] {
    --font-family: 'Segoe UI', system-ui, sans-serif;
    --os-background: url('https://images.unsplash.com/photo-1557682250-33bd709cbe85?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    --taskbar-bg: rgba(200, 220, 240, 0.4);
    --taskbar-border: 1px solid rgba(255, 255, 255, 0.5);
    --taskbar-position-bottom: 0;
    --taskbar-width: 100%;
    --taskbar-margin: 0;
    --taskbar-radius: 0;
    --taskbar-text: #fff;
    --backdrop-filter: blur(15px);
    
    --start-bg: rgba(230, 240, 250, 0.85);
    --start-border: 1px solid rgba(255, 255, 255, 0.6);
    --start-width: 420px;
    --start-height: 580px;
    --start-bottom-margin: 45px;
    --start-left-margin: 0;
    --start-transform: none;
    --start-hidden-transform: translateY(20px);
    --start-radius: 8px 8px 0 0;
    --start-text: #000;
    --window-radius: 8px;
}
[data-theme="win7"] .taskbar { box-shadow: inset 0 2px 2px rgba(255,255,255,0.7), 0 -1px 5px rgba(0,0,0,0.2); justify-content: flex-start; height: 50px; }
[data-theme="win7"] .taskbar-center { position: static; transform: none; display: flex; align-items: center; justify-content: flex-start; margin-left: 10px; flex: 1; }
[data-theme="win7"] .taskbar-right { margin-left: auto; width: auto; background: rgba(0,0,0,0.1); box-shadow: inset 1px 0 1px rgba(255,255,255,0.4); padding: 0 15px; }
[data-theme="win7"] .start-btn { 
    background: transparent; border-radius: 50%;
    min-width: 54px; height: 54px; margin-left: 10px; margin-top: -8px;
    box-shadow: inset 0 0 15px rgba(255,255,255,0.8), 0 2px 5px rgba(0,0,0,0.5);
    overflow: hidden;
}
[data-theme="win7"] .start-btn:hover { box-shadow: inset 0 0 25px rgba(255,255,255,1), 0 2px 8px rgba(0,0,0,0.6); transform: scale(1.05); }
[data-theme="win7"] .start-btn .win-icon { color: #0078d7; text-shadow: 0 0 10px rgba(255,255,255,0.8); font-size: 28px; }
[data-theme="win7"] .taskbar-app-icon { border-radius: 5px; width: 48px; height: 48px; margin: 0 2px; border: 1px solid transparent; background: transparent; }
[data-theme="win7"] .taskbar-app-icon:hover { background: rgba(255,255,255,0.3); border: 1px solid rgba(255,255,255,0.5); box-shadow: inset 0 0 10px rgba(255,255,255,0.5); }
[data-theme="win7"] .taskbar-app-icon.active { background: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.8); box-shadow: inset 0 0 15px rgba(255,255,255,0.8); }
[data-theme="win7"] #start-menu { box-shadow: inset 0 0 10px rgba(255,255,255,0.8), 0 0 15px rgba(0,0,0,0.3); backdrop-filter: blur(20px); }

/* Chic / Elegance Theme */
[data-theme="elegance"] {
    --font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    --os-background: url('https://images.unsplash.com/photo-1518895949257-7621c3c786d7?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    --taskbar-bg: rgba(255, 240, 245, 0.85); /* rose light tint */
    --taskbar-border: 1px solid rgba(255, 182, 193, 0.4);
    --taskbar-position-bottom: 15px;
    --taskbar-width: max-content;
    --taskbar-margin: 0 auto;
    --taskbar-radius: 40px;
    --taskbar-text: #d3548e;
    --backdrop-filter: blur(20px);
    
    --start-bg: rgba(255, 250, 252, 0.95);
    --start-border: 1px solid rgba(255, 182, 193, 0.5);
    --start-width: 400px;
    --start-height: 520px;
    --start-bottom-margin: 80px;
    --start-left-margin: 50%;
    --start-transform: translateX(-50%);
    --start-hidden-transform: translateX(-50%) translateY(30px);
    --start-radius: 30px;
    --start-text: #5e3a47;
    --window-radius: 20px;
}
[data-theme="elegance"] .taskbar { box-shadow: 0 10px 25px rgba(211, 84, 142, 0.15); padding: 0 30px; justify-content: center; gap: 30px; }
[data-theme="elegance"] .taskbar-center { position: static; transform: none; display: flex; align-items: center; justify-content: center; margin: 0; }
[data-theme="elegance"] .start-btn { background: linear-gradient(135deg, #ffb6c1, #ff9a9e); box-shadow: 0 4px 10px rgba(255,154,158,0.4); border-radius: 50%; }
[data-theme="elegance"] .start-btn .win-icon { display: none; }
[data-theme="elegance"] .start-btn::before { content: '\f004'; font-family: 'Font Awesome 5 Free'; font-weight: 900; color: #fff; font-size: 20px; }
[data-theme="elegance"] .taskbar-app-icon { border-radius: 50%; transition: 0.3s; }
[data-theme="elegance"] .taskbar-app-icon:hover { background: rgba(255, 182, 193, 0.3); transform: scale(1.1); box-shadow: 0 4px 12px rgba(255,182,193,0.3); }
[data-theme="elegance"] #start-menu { box-shadow: 0 15px 35px rgba(211,84,142,0.15); border-radius: 35px; }
[data-theme="elegance"] .app-item { border-radius: 20px; }
[data-theme="elegance"] .app-item:hover { background: rgba(255, 182, 193, 0.2); transform: translateY(-3px); }
[data-theme="elegance"] .app-item i { color: #d3548e !important; }
[data-theme="elegance"] .desktop-icons {
    position: absolute;
    right: 20px;
    left: auto;
    direction: rtl; /* Build columns right-to-left */
}
[data-theme="elegance"] .desktop-icon {
    direction: ltr; /* Keep text left-to-right */
}
[data-theme="elegance"] .os-watermark {
    right: auto !important;
    left: 40px !important;
}
[data-theme="elegance"] .os-watermark > div {
    justify-content: flex-start !important;
}
[data-theme="elegance"] .os-watermark > div > div {
    text-align: left !important;
}

/* --- Modais de Confirmação de Logout por Tema --- */
/* --- Modais de Confirmação de Logout por Tema --- */
.confirm-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(10px); z-index: 20000;
    align-items: center; justify-content: center;
}
.confirm-box {
    background: rgba(40,40,40,0.8); border: 1px solid rgba(255,255,255,0.1);
    padding: 30px; border-radius: 16px; text-align: center; color: white; width: 350px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    font-family: inherit; transition: 0.3s; position: relative;
}
.confirm-icon { font-size: 40px; color: #ff5f56; margin-bottom: 20px; display:block; }
.confirm-title { margin-bottom: 10px; font-weight: 500; font-size: 20px; }
.confirm-desc { font-size: 14px; opacity: 0.8; margin-bottom: 25px; }
.confirm-actions { display: flex; gap: 15px; justify-content: center; }
.confirm-btn-cancel, .confirm-btn-exit {
    padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; flex: 1; font-weight: 600; font-family: inherit; transition: 0.2s;
}
.confirm-btn-cancel { border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); color: white; }
.confirm-btn-cancel:hover { background: rgba(255,255,255,0.2); }
.confirm-btn-exit { background: #ff5f56; color: white; }
.confirm-btn-exit:hover { background: #ff473e; }

/* Windows 11 / Default - Minimalist Left-Aligned Dialog */
[data-theme="win11"] .confirm-box { width: 400px; padding: 24px; text-align: left; backdrop-filter: blur(25px); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
[data-theme="win11"] .confirm-icon { display: none; }
[data-theme="win11"] .confirm-title { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
[data-theme="win11"] .confirm-desc { font-size: 14px; margin-bottom: 24px; opacity: 1; }
[data-theme="win11"] .confirm-actions { justify-content: flex-end; gap: 8px; }
[data-theme="win11"] .confirm-btn-cancel, [data-theme="win11"] .confirm-btn-exit { border-radius: 4px; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; padding: 8px 24px; flex: 0 0 auto; }
[data-theme="win11"][data-mode="claro"] .confirm-box { background: rgba(243,243,243,0.85); border: 1px solid rgba(0,0,0,0.1); color: #202020; }
[data-theme="win11"][data-mode="escuro"] .confirm-box { background: rgba(32,32,32,0.85); border: 1px solid rgba(255,255,255,0.1); color: #fff; }
[data-theme="win11"][data-mode="claro"] .confirm-btn-cancel { background: #fbfbfb; color: #111; border: 1px solid #d1d1d1; }
[data-theme="win11"][data-mode="claro"] .confirm-btn-cancel:hover { background: #f6f6f6; border-color: #c4c4c4; }
[data-theme="win11"][data-mode="escuro"] .confirm-btn-cancel { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.1); }
[data-theme="win11"][data-mode="escuro"] .confirm-btn-cancel:hover { background: rgba(255,255,255,0.1); }
[data-theme="win11"] .confirm-btn-exit { background: #0060F0; color: #fff; border: 1px solid transparent; }
[data-theme="win11"] .confirm-btn-exit:hover { background: #0050d0; }

/* Windows 7 - Aero Glass styling */
[data-theme="win7"] .confirm-modal-overlay { background: rgba(0,0,50,0.3); backdrop-filter: none; }
[data-theme="win7"] .confirm-box { background: linear-gradient(to bottom, #f2f6fb 0%, #c4e1ff 100%); color: #000; border: 1px solid #7592b2; border-radius: 6px; box-shadow: inset 0 0 2px #fff, 0 10px 20px rgba(0,0,0,0.5); padding: 25px; text-align: left; }
[data-theme="win7"] .confirm-icon { display: none; }
[data-theme="win7"] .confirm-title { color: #003399; font-size: 18px; font-weight: bold; font-family: 'Segoe UI', Tahoma, sans-serif; margin-bottom: 5px; }
[data-theme="win7"] .confirm-desc { color: #222; font-family: 'Segoe UI', Tahoma, sans-serif; margin-bottom: 25px; opacity: 1; }
[data-theme="win7"] .confirm-actions { justify-content: flex-end; gap: 10px; border-top: 1px solid #aebfd4; padding-top: 15px; margin-top: 10px; }
[data-theme="win7"] .confirm-btn-cancel, [data-theme="win7"] .confirm-btn-exit { background: linear-gradient(to bottom, #f2f2f2, #ebebeb); color: #000; border: 1px solid #707070; border-radius: 3px; box-shadow: inset 0 1px 1px #fff; padding: 6px 20px; font-size: 13px; font-family: 'Segoe UI', Tahoma, sans-serif; flex: 0 0 auto; min-width: 90px; }
[data-theme="win7"] .confirm-btn-cancel:hover, [data-theme="win7"] .confirm-btn-exit:hover { background: linear-gradient(to bottom, #eaf6fd, #d9f0fc); border: 1px solid #3c7fb1; }

/* Windows XP - Classic Alert Box */
[data-theme="winxp"] .confirm-modal-overlay { background: rgba(0,0,0,0.2); backdrop-filter: none; }
[data-theme="winxp"] .confirm-box { background: #ece9d8; color: #000; border: 1px solid #0054e3; padding: 0; border-radius: 3px 3px 0 0; width: 400px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); overflow:hidden; text-align: left; }
[data-theme="winxp"] .confirm-box::before { content: attr(data-title); display: block; background: linear-gradient(to right, #0058e6, #3a93ff); padding: 5px 10px; color: white; font-weight: bold; font-family: Tahoma, sans-serif; font-size: 13px; border-radius: 2px 2px 0 0; }
[data-theme="winxp"] .confirm-icon { display: none; }
[data-theme="winxp"] .confirm-title { color: #003399; font-family: Tahoma, sans-serif; font-size: 14px; font-weight: bold; padding: 20px 20px 5px 20px; margin: 0; }
[data-theme="winxp"] .confirm-desc { padding: 5px 20px 30px 20px; font-family: Tahoma, sans-serif; font-size: 13px; opacity: 1; margin: 0; }
[data-theme="winxp"] .confirm-actions { background: #f0f0ea; padding: 15px; border-top: 1px solid #dfdfdf; gap: 10px; justify-content: flex-end; }
[data-theme="winxp"] .confirm-btn-cancel, [data-theme="winxp"] .confirm-btn-exit { background: linear-gradient(to bottom, #fff, #ece9d8); color: #000; border: 1px solid #003c74; border-radius: 3px; font-family: Tahoma; font-size: 11px; padding: 4px 15px; flex: 0 0 auto; min-width: 80px; font-weight: normal; }
[data-theme="winxp"] .confirm-btn-exit:hover { border: 1px solid #ce7100; box-shadow: inset 0 0 0 1px #ffc23f; }

/* Mac OS - Finder alert style */
[data-theme="mac"] .confirm-box { display: grid; grid-template-columns: 80px 1fr; grid-template-rows: auto auto auto; background: rgba(250,250,250,0.85); backdrop-filter: blur(40px); color: #000; border-radius: 12px; box-shadow: 0 15px 50px rgba(0,0,0,0.3); border: 1px solid rgba(0,0,0,0.1); width: 380px; padding: 25px 20px; text-align: left; }
[data-theme="mac"][data-mode="escuro"] .confirm-box { background: rgba(30,30,30,0.85); color: #fff; border: 1px solid rgba(255,255,255,0.15); }
[data-theme="mac"] .confirm-icon { display: block; grid-column: 1; grid-row: 1 / span 3; margin: 0; font-size: 50px; color: #ff3b30; align-self: start; text-align: center; }
[data-theme="mac"] .confirm-icon::before { content: "\f071"; } /* Warning triangle */
[data-theme="mac"] .confirm-title { grid-column: 2; grid-row: 1; font-weight: bold; font-size: 14px; margin: 0 0 8px 0; color: inherit; }
[data-theme="mac"] .confirm-desc { grid-column: 2; grid-row: 2; font-size: 12px; color: #555; margin: 0 0 20px 0; opacity: 1; }
[data-theme="mac"][data-mode="escuro"] .confirm-desc { color: #aaa; }
[data-theme="mac"] .confirm-actions { grid-column: 2; grid-row: 3; flex-direction: row-reverse; gap: 10px; justify-content: flex-start; } 
[data-theme="mac"] .confirm-btn-cancel, [data-theme="mac"] .confirm-btn-exit { border-radius: 6px; font-weight: 500; font-size: 13px; padding: 6px 15px; border: 1px solid transparent; flex: 0 0 auto; outline: none; min-width: 80px; }
[data-theme="mac"] .confirm-btn-cancel { background: #fff; color: #333; border: 1px solid #d1d1d1; box-shadow: 0 1px 1px rgba(0,0,0,0.05); }
[data-theme="mac"] .confirm-btn-cancel:hover { background: #f2f2f2; }
[data-theme="mac"][data-mode="escuro"] .confirm-btn-cancel { background: #444; color: #fff; border: 1px solid #555; }
[data-theme="mac"][data-mode="escuro"] .confirm-btn-cancel:hover { background: #555; }
[data-theme="mac"] .confirm-btn-exit { background: #007aff; color: #fff; }

/* Ubuntu */
[data-theme="ubuntu"] .confirm-box { background: #333333; border: 1px solid #222; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
[data-theme="ubuntu"] .confirm-icon { color: #E95420; }
[data-theme="ubuntu"] .confirm-btn-cancel, [data-theme="ubuntu"] .confirm-btn-exit { border-radius: 4px; border: 1px solid rgba(0,0,0,0.5); }
[data-theme="ubuntu"] .confirm-btn-exit { background: #E95420; }
[data-theme="ubuntu"] .confirm-btn-exit:hover { background: #c84414; }

/* Chic Elegance - Soft Float */
[data-theme="elegance"] .confirm-box { background: rgba(255,255,255,0.95); backdrop-filter: blur(15px); color: #5e3a47; border: 2px solid #ffb6c1; border-radius: 30px; box-shadow: 0 20px 40px rgba(211,84,142,0.15); font-family: 'Great Vibes', sans-serif; padding: 40px 30px; text-align: center; }
[data-theme="elegance"] .confirm-icon { color: #ff9a9e; font-size: 35px; margin-bottom: 10px; }
[data-theme="elegance"] .confirm-icon::before { content: "\f004"; } /* Heart */
[data-theme="elegance"] .confirm-title { font-family: 'Great Vibes', serif; font-size: 28px; color: #d3548e; margin-bottom: 5px; }
[data-theme="elegance"] .confirm-desc { font-family: 'Inter', sans-serif; font-size: 13px; color: #8e5c70; font-weight: 300; opacity: 1; margin-bottom: 25px; }
[data-theme="elegance"] .confirm-btn-cancel, [data-theme="elegance"] .confirm-btn-exit { padding: 12px 25px; font-weight: 500; font-size: 14px; transition: 0.3s; font-family: 'Inter', sans-serif; }
[data-theme="elegance"] .confirm-btn-cancel { background: #ffe4e1; color: #d3548e; border: none; border-radius: 30px; }
[data-theme="elegance"] .confirm-btn-cancel:hover { background: #ffccd8; }
[data-theme="elegance"] .confirm-btn-exit { background: linear-gradient(135deg, #ffb6c1, #ff9a9e); border-radius: 30px; box-shadow: 0 4px 10px rgba(255,154,158,0.4); color: white; border: none; }
[data-theme="elegance"] .confirm-btn-exit:hover { background: linear-gradient(135deg, #ff9a9e, #ff758c); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(255,154,158,0.5); }

/* Chrome OS */
[data-theme="chromeos"] .confirm-box { display: flex; flex-direction: column; align-items: flex-start; background: #fff; color: #202124; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); border: none; padding: 25px; text-align: left; }
[data-theme="chromeos"] .confirm-icon { display: none; }
[data-theme="chromeos"] .confirm-title { font-size: 16px; font-weight: 500; margin-bottom: 10px; }
[data-theme="chromeos"] .confirm-desc { font-size: 14px; opacity: 0.8; margin-bottom: 24px; }
[data-theme="chromeos"] .confirm-actions { align-self: flex-end; justify-content: flex-end; gap: 8px; width: 100%; }
[data-theme="chromeos"] .confirm-btn-cancel, [data-theme="chromeos"] .confirm-btn-exit { font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 16px; flex: 0 0 auto; border: none; }
[data-theme="chromeos"] .confirm-btn-cancel { background: transparent; color: #1a73e8; border: 1px solid #dadce0; }
[data-theme="chromeos"] .confirm-btn-cancel:hover { background: #f8f9fa; }
[data-theme="chromeos"] .confirm-btn-exit { background: #1a73e8; color: #fff; }
[data-theme="chromeos"] .confirm-btn-exit:hover { background: #1557b0; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

/* Zorin OS */
[data-theme="zorin"] .confirm-box { background: rgba(30,30,30,0.9); backdrop-filter: blur(20px); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
[data-theme="zorin"] .confirm-btn-cancel, [data-theme="zorin"] .confirm-btn-exit { border-radius: 8px; padding: 10px 20px; font-weight: 500; }
[data-theme="zorin"] .confirm-btn-exit { background: #3498db; }
[data-theme="zorin"] .confirm-btn-exit:hover { background: #2980b9; }

/* Projecto35 OS Premium Theme */
[data-theme="ajecos"] .confirm-modal-overlay { background: rgba(0,10,30,0.85); backdrop-filter: blur(20px); }

/* Standard confirm box for AJecos */
[data-theme="ajecos"] .confirm-box { background: rgba(20, 30, 50, 0.9); border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.6); }

/* Logout Specific UI */
[data-theme="ajecos"] .confirm-box.logout-mode { background: transparent; border: none; box-shadow: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 500px; padding: 0; }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-icon { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #f1c40f, #f39c12); color: #fff; font-size: 35px; margin-bottom: 25px; box-shadow: 0 0 40px rgba(241,196,15,0.6); animation: pulse 2s infinite; }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-icon::before { content: "\f011"; } /* Power off icon instead of door */
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-title { font-size: 32px; font-weight: 700; color: #fff; margin-bottom: 15px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-desc { font-size: 16px; color: rgba(255,255,255,0.7); margin-bottom: 40px; font-weight: 300; }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 70%; }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-btn-cancel, [data-theme="ajecos"] .confirm-box.logout-mode .confirm-btn-exit { padding: 15px 0; border-radius: 12px; font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-btn-cancel { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid rgba(255,255,255,0.1); }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-btn-cancel:hover { background: rgba(255,255,255,0.1); transform: scale(1.05); }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-btn-exit { background: linear-gradient(90deg, #f1c40f, #f39c12); color: #1e3c72; border: none; box-shadow: 0 10px 25px rgba(241,196,15,0.3); }
[data-theme="ajecos"] .confirm-box.logout-mode .confirm-btn-exit:hover { background: linear-gradient(90deg, #f39c12, #e67e22); transform: scale(1.05); box-shadow: 0 15px 35px rgba(241,196,15,0.5); color: white; }

/* =========================================================
   Mobile Responsiveness (Telemóveis & Tablets < 768px)
========================================================= */
@media screen and (max-width: 1024px) {
    /* Esconder marca d'agua gigante para não tapar os apps no ecrã pequeno */
    .os-watermark {
        display: none !important;
    }

    /* Forçar janelas ativas em Full Screen Tabs */
    .window {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100% - 40px) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        resize: none !important;
        border: none !important;
        transform: none !important;
        margin: 0 !important;
    }
    [data-theme="mac"] .window {
        top: 25px !important;
        height: calc(100% - 65px) !important;
    }
    
    html[data-theme="ubuntu"] .window {
        top: 32px !important;
        height: calc(100% - 32px) !important;
    }

    /* Ocultar controlos de maximizar e minimizar para focar nas Tabs */
    .window-controls .minimize-btn,
    .window-controls .maximize-btn,
    .window-controls span:nth-child(1),
    .window-controls span:nth-child(2) {
        display: none !important;
    }

    /* Ubuntu specific adjustments to fit into the standard grid on mobile */
    html[data-theme="ubuntu"] .desktop-icons {
        position: absolute !important;
        width: 100% !important;
        height: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        justify-items: center !important;
        align-content: start !important;
        padding-left: 5px !important;
        padding-bottom: 250px !important;
        background: transparent !important;
        z-index: 10 !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Removing old Ubuntu sidebar columns rules so natural grid is preserved */

    /* Área dos programas abertos no fundo da doca */
    html[data-theme="ubuntu"] .taskbar-center {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 70px !important;
        height: 310px !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-end !important;
        padding-bottom: 10px !important;
        overflow-y: auto !important;
        pointer-events: auto !important;
        z-index: 10004 !important;
    }

    html:not([data-theme="ubuntu"]) .desktop-icon {
        flex: 0 0 auto !important;
        width: 75px !important;
        height: 85px !important;
        margin: 5px !important;
        padding: 5px !important;
        text-align: center;
    }

    /* O Menu Iniciar ocupa mais área */
    #start-menu {
        width: 90vw !important;
        max-width: 320px !important;
        height: 75vh !important;
        bottom: 45px !important;
        left: 5vw !important;
    }

    #start-menu .pinned-apps {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        max-width: 100% !important;
        margin: 0 auto;
        padding: 0 5px;
    }
    #start-menu .app-item {
        width: 100% !important;
        padding: 5px !important;
        box-sizing: border-box;
    }
    #start-menu .app-item span {
        font-size: 11px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
    }
    
    /* Mostrar botão de fechar Menu Iniciar (Launchpad) em todos os temas (Mobile Responsivo) */
    .mac-start-close {
        display: flex !important;
        position: absolute !important;
        top: 10px !important;
        right: 15px !important;
        width: 30px !important;
        height: 30px !important;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: var(--start-text, #fff) !important;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        cursor: pointer;
    }
    
    [data-theme="mac"] .mac-start-close, [data-theme="ubuntu"] .mac-start-close {
        top: 30px !important; right: 30px !important; /* Full screen menus get wider spacing */
    }

    .start-right {
        display: none !important; 
    }
    .start-left {
        width: 100% !important;
    }

    /* Scrolling horizontal na Taskbar */
    .taskbar {
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }
    .taskbar-apps {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        scrollbar-width: none;
    }
    .taskbar-apps::-webkit-scrollbar {
        display: none;
    }
    .taskbar-item {
        flex: 0 0 auto !important;
        margin-right: 5px !important;
    }

    /* Modais fluidos em mobile */
    .confirm-box {
        width: 90vw !important;
        max-width: 340px !important;
        padding: 20px !important;
    }
    .confirm-box.logout-mode {
        width: 95vw !important;
        max-width: none !important;
    }
}

/* =========================================================
   Mobile Patch 2: Taskbar cleanup e modais internos
========================================================= */
@media screen and (max-width: 1024px) {
    /* 1. Limpar Taskbar (Ocultar Wallet, VIP, Som, Wifi, Data/Relógio) */
    .taskbar-status-display,
    .system-tray i.fa-wifi,
    .system-tray i.fa-volume-up,
    .system-tray .clock,
    .mac-topbar-right .taskbar-status-display,
    .mac-topbar-right i.os-wifi-icon,
    .mac-topbar-right .clock {
        display: none !important;
    }

    /* 2. Responsividade Modal de Configurações (Definições) */
    #settings-window .window-content {
        flex-direction: column !important;
    }
    
    #settings-window .settings-sidebar {
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid var(--window-border, rgba(255,255,255,0.1));
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        padding: 10px !important;
        white-space: nowrap !important;
    }
    
    #settings-window .settings-sidebar div {
        flex: 0 0 auto !important;
        margin-bottom: 0 !important;
        margin-right: 15px !important;
        padding: 5px 15px !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    
    #settings-window .settings-content {
        padding: 15px !important;
    }

    /* Grelha de Themacards responsiva nas definições */
    .theme-card {
        margin-right: 10px !important;
        margin-bottom: 10px !important;
        width: 120px !important;
        flex: 0 0 auto !important;
    }

    /* Forçar apps nativos no FileManager a manter grids */
    .file-manager .main-content {
        flex-direction: column !important;
    }

    /* Reduzir escala da marca d'água no mobile para não ocupar toda a tela */
    .os-watermark {
        top: 10px !important;
        right: 10px !important;
        transform: scale(0.5);
        transform-origin: top right;
    }

    /* Alinhar todos ícones da taskbar à esquerda para evitar sobreposições (overflow behavior default) */
    html:not([data-theme="ubuntu"]) .taskbar-center {
        position: static !important;
        transform: none !important;
        margin-left: 5px;
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: none !important;
        flex: 1 !important;
    }

    #quick-launch-apps {
        border-right: none !important;
        padding-right: 0 !important;
        margin-right: 5px !important;
    }

    /* Fix Apple Theme Dock expanding beyond screen on mobile landscape/portrait */
    [data-theme="mac"] #taskbar {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    [data-theme="mac"] #taskbar::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }

    /* --- Ubuntu Mobile: Revert to standard desktop grid instead of side dock --- */
    
    /* Dock Background in mobile should be hidden, but FAB shown */
    html[data-theme="ubuntu"] #taskbar::after {
        display: none !important;
    }

    /* Hide FAB no mobile a pedido do utilizador */
    html[data-theme="ubuntu"] #ubuntu-dock-fab {
        display: none !important;
    }

    /* Reset individual icon sizes to standard desktop sizes for Ubuntu mobile */
    html[data-theme="ubuntu"] .desktop-icon {
        width: 75px !important; 
        min-height: 85px !important; 
        height: 85px !important;
        margin: 5px !important; 
        padding: 5px !important;
        background: transparent !important; 
        border-radius: 8px !important;
        display: flex !important; 
        flex-direction: column !important;
        justify-content: flex-start !important; 
        align-items: center !important;
        position: relative !important;
    }

    /* Show icon labels underneath the icons normally */
    html[data-theme="ubuntu"] .desktop-icon span {
        display: block !important;
        position: static !important;
        margin-left: 0 !important;
        background: transparent !important;
        color: white !important;
        padding: 0 !important;
        margin-top: 5px !important;
        white-space: pre-wrap !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        font-size: 11px !important;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
        text-align: center !important;
        width: 100% !important;
        line-height: 1.2 !important;
        z-index: 10 !important;
    }

    /* Reset icon image size to natural grid size */
    html[data-theme="ubuntu"] .desktop-icon .icon-img {
        font-size: 32px !important; 
        width: 32px !important; 
        height: 32px !important; 
        margin-bottom: 4px !important;
        filter: none !important; /* Removes the heavy white filter from dock */
    }

    /* Center taskbar items properly */
    html[data-theme="ubuntu"] .taskbar-center {
        display: flex !important;
        transform: translateX(0) !important;
        pointer-events: auto !important;
    }

    /* Optional: Ensure dark overlay doesn't trigger */
    html.ubuntu-dock-open[data-theme="ubuntu"] #desktop::before {
        display: none !important;
    }
}


/* QUICK LAUNCH FIX FOR WINXP */
[data-theme="winxp"] #quick-launch-apps .taskbar-app-icon { min-width: auto; padding: 0 4px !important; background: transparent !important; border: none !important; box-shadow: none !important; }
[data-theme="winxp"] #quick-launch-apps .taskbar-app-icon::after { content: none !important; }


/* Fix Left Alignment */
[data-theme="zorin"] .taskbar-left, 
[data-theme="win7"] .taskbar-left, 
[data-theme="win10"] .taskbar-left, 
[data-theme="winxp"] .taskbar-left,
[data-theme="mac"] .taskbar-left { 
    display: none !important; 
}

/* Fix Clock Wrap */
.clock, #system-clock { 
    white-space: nowrap !important; 
}

/* Correcoes Mobile para a Barra de Tarefas e Menu Iniciar */
@media (max-width: 1024px) {
    /* Impedir que o Menu Iniciar e os iconos desaparecam */
    html:not([data-theme="ubuntu"]) .taskbar-center {
        max-width: none !important;
        flex: 1 !important;
        overflow-x: auto !important;
    }
    
    /* Anular qualquer espaco/flutuacao de baixo da barra de tarefas em dispositivos moveis (colar ao fundo) */
    /* Aplicar position: fixed a todos para não sumir no scroll */
    #taskbar {
        position: fixed !important;
        z-index: 99999 !important; /* Garantir que fica sobre tudo */
        top: auto !important;
        height: 50px !important;
    }
    
    /* Impedir que margens exageradas ocultem o botão Iniciar em temas como Chic e Chrome OS */
    [data-theme="ajecos"] .taskbar-center,
    [data-theme="elegance"] .taskbar-center {
        margin: 0 auto !important;
        justify-content: center !important;
        max-width: none !important;
        flex: 1 !important;
    }

    /* Garantir que o Chrome OS, etc. perdem a margem que causa o espaco preto inferior, mas OMITIR O MAC (OSX) */
    html:not([data-theme="mac"]) #taskbar {
        bottom: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 1024px) {
    /* Forcar alinhamento a esquerda (ponta a ponta) e deslize no dock do Mac */
    html[data-theme="mac"] .taskbar-center,
    html[data-theme="mac"] #taskbar-apps,
    html[data-theme="mac"] #mac-pinned-dock {
        justify-content: flex-start !important;
    }
}

@media (max-width: 1024px) { .taskbar-item.start-btn { display: flex !important; width: 45px !important; height: 45px !important; min-width: 45px !important; align-items: center !important; justify-content: center !important; visibility: visible !important; opacity: 1 !important; } }
@media (max-width: 1024px) { .taskbar-item.start-btn { display: flex !important; width: 45px !important; height: 45px !important; min-width: 45px !important; align-items: center !important; justify-content: center !important; visibility: visible !important; opacity: 1 !important; flex-shrink: 0 !important; } }

/* Correcoes Mobile para a Barra de Tarefas e Menu Iniciar */
@media (max-width: 1024px) {
    /* Impedir que o Menu Iniciar e os iconos desaparecam */
    html:not([data-theme="ubuntu"]) .taskbar-center {
        max-width: none !important;
        flex: 1 !important;
        overflow-x: auto !important;
    }
    
    /* Anular qualquer espaco/flutuacao de baixo da barra de tarefas em dispositivos moveis (colar ao fundo) */
    #taskbar {
        bottom: 0 !important;
        top: auto !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 50px !important; /* Garantir boa area de toque */
    }
    
    /* Garantir que o Chrome OS, Mac, etc. perdem a margem que causa o espaco preto inferior */
    [data-theme="mac"] #taskbar,
    [data-theme="ajecos"] #taskbar,
    [data-theme="elegance"] #taskbar {
        bottom: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* Fix CSS Bug with overflow hidden and centered flex items collapsing left */
[data-theme="ajecos"] .taskbar-center,
[data-theme="elegance"] .taskbar-center {
    max-width: none !important;
    justify-content: flex-start !important;
}


@media (max-width: 1024px) {
    /* Correções Adicionais de Responsividade (05-04-2026) */
    #start-menu {
        /* Remove o salto à esquerda da translação centralizada da V1 */
        transform: none !important;
    }
    
    [data-theme="ubuntu"] .taskbar-center {
        /* Forçar dock ubuntu a ser horizontal em mobile! */
        flex-direction: row !important;
        height: auto !important;
        width: auto !important;
        position: static !important;
        background: transparent !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
    }
    
    [data-theme="elegance"] .taskbar,
    [data-theme="ajecos"] .taskbar {
        /* Menu elegance com exagerado gap de 30px prejudica o ecrã mobile */
        gap: 10px !important;
        padding: 0 5px !important;
    }
    
    [data-theme="elegance"] .taskbar-center,
    [data-theme="ajecos"] .taskbar-center {
        gap: 5px !important;
    }
}

/* Ocultar Quick Launch Apps nativos na barra top/bottom do Ubuntu, pois a doca lateral já tem todos eles */
[data-theme="ubuntu"] #quick-launch-apps {
    display: none !important;
}


@media (max-width: 768px) {
    #start-menu .pinned-apps {
        grid-template-columns: repeat(3, 1fr) !important;
    --start-bg: linear-gradient(145deg, #2b2e35, #1e1f24);
    --start-border: 1px solid #3a3c42;
    }

    /* Show icon labels underneath the icons normally */
    html[data-theme="ubuntu"] .desktop-icon span {
        display: block !important;
        position: static !important;
        margin-left: 0 !important;
        background: transparent !important;
        color: white !important;
        padding: 0 !important;
        margin-top: 5px !important;
        white-space: pre-wrap !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        font-size: 11px !important;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.8) !important;
        text-align: center !important;
        width: 100% !important;
        line-height: 1.2 !important;
        z-index: 10 !important;
    }

    /* Reset icon image size to natural grid size */
    html[data-theme="ubuntu"] .desktop-icon .icon-img {
        font-size: 32px !important; 
        width: 32px !important; 
        height: 32px !important; 
        margin-bottom: 4px !important;
        filter: none !important; /* Removes the heavy white filter from dock */
    }

    /* Center taskbar items properly */
    html[data-theme="ubuntu"] .taskbar-center {
        display: flex !important;
        transform: translateX(0) !important;
        pointer-events: auto !important;
    }

    /* Optional: Ensure dark overlay doesn't trigger */
    html.ubuntu-dock-open[data-theme="ubuntu"] #desktop::before {
        display: none !important;
    }
}


/* QUICK LAUNCH FIX FOR WINXP */
[data-theme="winxp"] #quick-launch-apps .taskbar-app-icon { min-width: auto; padding: 0 4px !important; background: transparent !important; border: none !important; box-shadow: none !important; }
[data-theme="winxp"] #quick-launch-apps .taskbar-app-icon::after { content: none !important; }


/* Fix Left Alignment */
[data-theme="zorin"] .taskbar-left, 
[data-theme="win7"] .taskbar-left, 
[data-theme="win10"] .taskbar-left, 
[data-theme="winxp"] .taskbar-left,
[data-theme="mac"] .taskbar-left { 
    display: none !important; 
}

/* Fix Clock Wrap */
.clock, #system-clock { 
    white-space: nowrap !important; 
}

/* Correcoes Mobile para a Barra de Tarefas e Menu Iniciar */
@media (max-width: 1024px) {
    /* Impedir que o Menu Iniciar e os iconos desaparecam */
    html:not([data-theme="ubuntu"]) .taskbar-center {
        max-width: none !important;
        flex: 1 !important;
        overflow-x: auto !important;
    }
    
    /* Anular qualquer espaco/flutuacao de baixo da barra de tarefas em dispositivos moveis (colar ao fundo) */
    /* Aplicar position: fixed a todos para não sumir no scroll */
    #taskbar {
        position: fixed !important;
        z-index: 99999 !important; /* Garantir que fica sobre tudo */
        top: auto !important;
        height: 50px !important;
    }
    
    /* Impedir que margens exageradas ocultem o botão Iniciar em temas como Chic e Chrome OS */
    [data-theme="ajecos"] .taskbar-center,
    [data-theme="elegance"] .taskbar-center {
        margin: 0 auto !important;
        justify-content: center !important;
        max-width: none !important;
        flex: 1 !important;
    }

    /* Garantir que o Chrome OS, etc. perdem a margem que causa o espaco preto inferior, mas OMITIR O MAC (OSX) */
    html:not([data-theme="mac"]) #taskbar {
        bottom: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 1024px) {
    /* Forcar alinhamento a esquerda (ponta a ponta) e deslize no dock do Mac */
    html[data-theme="mac"] .taskbar-center,
    html[data-theme="mac"] #taskbar-apps,
    html[data-theme="mac"] #mac-pinned-dock {
        justify-content: flex-start !important;
    }
}

@media (max-width: 1024px) { .taskbar-item.start-btn { display: flex !important; width: 45px !important; height: 45px !important; min-width: 45px !important; align-items: center !important; justify-content: center !important; visibility: visible !important; opacity: 1 !important; } }
@media (max-width: 1024px) { .taskbar-item.start-btn { display: flex !important; width: 45px !important; height: 45px !important; min-width: 45px !important; align-items: center !important; justify-content: center !important; visibility: visible !important; opacity: 1 !important; flex-shrink: 0 !important; } }

/* Correcoes Mobile para a Barra de Tarefas e Menu Iniciar */
@media (max-width: 1024px) {
    /* Impedir que o Menu Iniciar e os iconos desaparecam */
    html:not([data-theme="ubuntu"]) .taskbar-center {
        max-width: none !important;
        flex: 1 !important;
        overflow-x: auto !important;
    }
    
    /* Anular qualquer espaco/flutuacao de baixo da barra de tarefas em dispositivos moveis (colar ao fundo) */
    #taskbar {
        bottom: 0 !important;
        top: auto !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 50px !important; /* Garantir boa area de toque */
    }
    
    /* Garantir que o Chrome OS, Mac, etc. perdem a margem que causa o espaco preto inferior */
    [data-theme="mac"] #taskbar,
    [data-theme="ajecos"] #taskbar,
    [data-theme="elegance"] #taskbar {
        bottom: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* Fix CSS Bug with overflow hidden and centered flex items collapsing left */
[data-theme="ajecos"] .taskbar-center,
[data-theme="elegance"] .taskbar-center {
    max-width: none !important;
    justify-content: flex-start !important;
}


@media (max-width: 1024px) {
    /* Correções Adicionais de Responsividade (05-04-2026) */
    #start-menu {
        /* Remove o salto à esquerda da translação centralizada da V1 */
        transform: none !important;
    }
    
    [data-theme="ubuntu"] .taskbar-center {
        /* Forçar dock ubuntu a ser horizontal em mobile! */
        flex-direction: row !important;
        height: auto !important;
        width: auto !important;
        position: static !important;
        background: transparent !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
    }
    
    [data-theme="elegance"] .taskbar,
    [data-theme="ajecos"] .taskbar {
        /* Menu elegance com exagerado gap de 30px prejudica o ecrã mobile */
        gap: 10px !important;
        padding: 0 5px !important;
    }
    
    [data-theme="elegance"] .taskbar-center,
    [data-theme="ajecos"] .taskbar-center {
        gap: 5px !important;
    }
}

/* Ocultar Quick Launch Apps nativos na barra top/bottom do Ubuntu, pois a doca lateral já tem todos eles */
[data-theme="ubuntu"] #quick-launch-apps {
    display: none !important;
}


@media (max-width: 768px) {
    #start-menu .pinned-apps {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }
    #start-menu { max-width: 95vw !important; width: 95vw !important; left: 2.5vw !important; }
}

@media (max-width: 768px) { #start-menu .pinned-apps { grid-template-columns: repeat(4, 1fr) !important; gap: 5px !important; padding: 5px !important; } #start-menu .pinned-apps .app-item { width: auto !important; min-width: 0 !important; padding: 8px 2px !important; } #start-menu .pinned-apps .app-item span { font-size: 10px !important; white-space: normal !important; padding: 0 2px !important; overflow: hidden !important; text-overflow: ellipsis !important; } }

/* Black Edition (Neo-Skeuomorphic) Theme */
[data-theme="blackedition"] {
    --font-family: 'Inter', system-ui, sans-serif;
    --os-background: url('../img/black_edition_wallpaper.png') center/cover no-repeat;
    --taskbar-bg: linear-gradient(to top, rgba(21, 22, 26, 0.9), rgba(32, 34, 40, 0.95));
    --taskbar-border: none;
    --taskbar-position-bottom: 25px;
    --taskbar-width: 90%;
    --taskbar-margin: 0 auto;
    --taskbar-radius: 20px;
    --taskbar-text: #8a9bb0;
    --backdrop-filter: none;
    --start-bg: linear-gradient(145deg, #2b2e35, #1e1f24);
    --start-border: 1px solid #3a3c42;
    --start-width: 450px;
    --start-height: 550px;
    --start-bottom-margin: 95px;
    --start-left-margin: 50%;
    --start-transform: translateX(-50%);
    --start-hidden-transform: translateX(-50%) translateY(30px);
    --start-radius: 20px;
    --start-text: #c4d1e0;
    --window-radius: 18px;
}
[data-theme="blackedition"] .taskbar { box-shadow: 10px 10px 30px #090a0c, -10px -10px 30px #2f3239, inset 1px 1px 2px rgba(255,255,255,0.05); padding: 0 40px; justify-content: space-between; gap: 30px; }
[data-theme="blackedition"] .taskbar-center { position: static; transform: none; display: flex; align-items: center; justify-content: center; margin: 0; }
[data-theme="blackedition"] .start-btn { background: linear-gradient(135deg, #2b394a, #1a2330); box-shadow: 5px 5px 12px #090a0c, -3px -3px 8px #2f3239, inset 1px 1px 2px rgba(255,255,255,0.1); border-radius: 50%; border: 4px solid #282a31; margin-top: -15px; width: 60px; height: 60px; margin-left: 10px; margin-right: 10px; display: flex; align-items: center; justify-content: center; }
[data-theme="blackedition"] .start-btn .win-icon { display: none; }
[data-theme="blackedition"] .start-btn::before { content: 'M'; font-family: 'Cinzel', serif; font-weight: 900; font-style: normal; color: #000000; font-size: 34px; text-shadow: 0 1px 2px rgba(255,255,255,0.15), 0 -1px 2px rgba(0,0,0,0.8); }
[data-theme="blackedition"] .taskbar-app-icon { border-radius: 50%; transition: 0.1s; }
[data-theme="blackedition"] .taskbar-app-icon:hover { transform: scale(0.96); box-shadow: inset 4px 4px 8px rgba(0,0,0,0.6); background: rgba(0,0,0,0.2); border: 1px solid rgba(0,0,0,0.3); }
[data-theme="blackedition"] #start-menu { box-shadow: 15px 15px 45px #090a0c, -15px -15px 45px #2f3239, inset 1px 1px 2px rgba(255,255,255,0.05); }
[data-theme="blackedition"] .app-item, [data-theme="blackedition"] .desktop-icon { border-radius: 12px !important; background: transparent !important; transition: 0.2s !important; }
[data-theme="blackedition"] .app-item:hover, [data-theme="blackedition"] .desktop-icon:hover { background: #15161a !important; box-shadow: inset 2px 2px 6px #0d0e11, inset -2px -2px 6px #1d1e23 !important; border: 1px solid rgba(0,0,0,0.2); }
[data-theme="blackedition"] .app-item i, [data-theme="blackedition"] .desktop-icon i, [data-theme="blackedition"] .desktop-icon .icon-img { color: #5d6776 !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.5) !important; transition: 0.3s !important; }
[data-theme="blackedition"] .app-item:hover i, [data-theme="blackedition"] .desktop-icon:hover i, [data-theme="blackedition"] .desktop-icon:hover .icon-img { color: #4a90e2 !important; text-shadow: 0 0 8px rgba(74,144,226,0.4) !important; }
[data-theme="blackedition"] .desktop-icon span, [data-theme="blackedition"] .app-item span { color: #8a9bb0 !important; text-shadow: none !important; font-weight: 500 !important; font-size: 13px !important; opacity: 1 !important; display: block !important; position: static !important; background: transparent !important; margin: 5px 0 0 0 !important; padding: 0 !important; }
[data-theme="blackedition"] .desktop-icon:hover span, [data-theme="blackedition"] .app-item:hover span { color: #c4d1e0 !important; }
[data-theme="blackedition"] .desktop-icon { width: 100px !important; height: auto !important; min-height: 90px !important; flex-direction: column !important; justify-content: flex-start !important; padding: 15px 5px !important; align-items: center !important; text-align: center !important; margin: 10px !important; }
[data-theme="blackedition"] .desktop-icons { flex-direction: row; flex-wrap: wrap; align-items: flex-start; justify-content: flex-start; }
[data-theme="blackedition"] #taskbar-bell-badge { box-shadow: 0 0 5px #e74c3c, inset 1px 1px 2px rgba(255,255,255,0.3); background: #e74c3c; }
[data-theme="blackedition"] .confirm-box { background: linear-gradient(145deg, #2b2e35, #1e1f24); color: #c4d1e0; border: 1px solid #3a3c42; border-radius: 20px; box-shadow: 15px 15px 45px #090a0c, -15px -15px 45px #2f3239, inset 1px 1px 2px rgba(255,255,255,0.05); padding: 30px; }
[data-theme="blackedition"] .confirm-title { color: #8a9bb0; text-shadow: 1px 2px 3px rgba(0,0,0,0.8); text-transform: uppercase; letter-spacing: 1px; font-weight: 800; }
[data-theme="blackedition"] .confirm-btn-cancel, [data-theme="blackedition"] .confirm-btn-exit { border-radius: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; text-shadow: 1px 2px 3px rgba(0,0,0,0.8); padding: 12px 20px; transition: 0.1s; }
[data-theme="blackedition"] .confirm-btn-cancel { background: #15161a; border: none; color: #5d6776; box-shadow: inset 2px 2px 6px #0d0e11, inset -2px -2px 6px #1d1e23; }
[data-theme="blackedition"] .confirm-btn-cancel:hover { color: #c4d1e0; box-shadow: inset 3px 3px 8px #0d0e11, inset -3px -3px 8px #1d1e23; }
[data-theme="blackedition"] {
    --font-family: 'Inter', system-ui, sans-serif;
    --os-background: url('../img/black_edition_wallpaper.png') center/cover no-repeat; border: 2px solid #282a31; color: #4a90e2; box-shadow: 4px 4px 10px #121316, -2px -2px 8px #3a3d46, inset 1px 1px 2px rgba(255,255,255,0.1); }
[data-theme="blackedition"] .confirm-btn-exit:hover { transform: scale(0.96); box-shadow: inset 3px 3px 6px rgba(0,0,0,0.6); color: #fff; }
[data-theme="blackedition"] .window { box-shadow: 20px 20px 60px #090a0c, -20px -20px 60px #2f3239, inset 1px 1px 2px rgba(255,255,255,0.05); border: 1px solid #3a3c42; }

/* BlackEdition Desktop Icons Custom Layout (Margens Esquerda, Cima e Direita) */
@media (min-width: 1024px) {
    [data-theme="blackedition"] .desktop-icons {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)) !important;
        grid-template-rows: repeat(auto-fit, minmax(85px, 1fr)) !important;
        grid-auto-flow: row !important;
        gap: 5px !important;
        padding: 10px 15px !important;
        box-sizing: border-box !important;
        justify-content: space-between !important;
        align-content: stretch !important;
        height: calc(100% - 160px) !important;
    }
    
    [data-theme="blackedition"] .desktop-icons::before {
        content: "";
        grid-column: 2 / -2;
        grid-row: 2 / -1; /* Mantém apenas 1 linha no topo e depois desliza para as colaterais perfeitamente distribuídas */
        pointer-events: none;
    }
    
    [data-theme="blackedition"] .desktop-icon {
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100px !important;
    }
}

/* BlackEdition Settings App Overrides */
[data-theme="blackedition"] .settings-app-container {
    background: linear-gradient(145deg, #1e1f24, #15161a) !important;
    color: #c4d1e0 !important;
}
[data-theme="blackedition"] .settings-app-container .sidebar {
    background: #111215 !important;
    border-right: 1px solid #2f3239 !important;
    box-shadow: inset -1px 0px 5px rgba(0,0,0,0.5);
}
[data-theme="blackedition"] .settings-app-container .nav-item {
    color: #8a9bb0 !important;
}
[data-theme="blackedition"] .settings-app-container .nav-item.active {
    background: rgba(74, 144, 226, 0.15) !important;
    border-left: 3px solid #4a90e2 !important;
    color: #4a90e2 !important;
}
[data-theme="blackedition"] .settings-app-container .setting-group {
    background: #1e1f24 !important;
    border: 1px solid #2f3239 !important;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.05), 3px 3px 6px #090a0c, -3px -3px 6px #212329 !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}
[data-theme="blackedition"] .settings-app-container h2,
[data-theme="blackedition"] .settings-app-container h3 {
    color: #fff !important;
    text-shadow: 0 0 5px rgba(255,255,255,0.2) !important;
}
[data-theme="blackedition"] .settings-app-container .theme-card {
    border-color: #2f3239 !important;
    background: #15161a !important;
}
[data-theme="blackedition"] .settings-app-container .theme-card.active {
    border-color: #4a90e2 !important;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.4) !important;
}
[data-theme="blackedition"] .settings-app-container .mode-btn {
    background: #111215 !important;
    border: 1px solid #2f3239 !important;
    color: #8a9bb0 !important;
}
[data-theme="blackedition"] .settings-app-container .mode-btn.active {
    background: #4a90e2 !important;
    color: #fff !important;
    box-shadow: 0 0 10px rgba(74,144,226,0.6) !important;
    border: 1px solid #38bdf8 !important;
}

/* BlackEdition Centered Watermark */
[data-theme="blackedition"] .os-watermark {
    top: calc(50% + 140px) !important; /* Ancorado à base do Banner Principal */
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, 0) !important;
    width: 100% !important;
    text-align: center !important;
    opacity: 0.8 !important;
}

[data-theme="blackedition"] .os-watermark form,
[data-theme="blackedition"] .os-watermark > div {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

[data-theme="blackedition"] .os-watermark .fa-microchip {
    display: none !important; /* Oculta o microchip para manter o centro do ecra minimalista */
}

[data-theme="blackedition"] .os-brand-text {
    text-align: center !important;
}

[data-theme="blackedition"] .os-watermark h1 {
    font-family: 'Inter', sans-serif !important;
    font-size: 20px !important;
    letter-spacing: 10px !important;
    font-weight: 300 !important;
    text-transform: uppercase !important;
    color: #8a9bb0 !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8), 0 0 10px rgba(255,255,255,0.05) !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="blackedition"] .os-watermark p {
    display: none !important;
}

[data-theme="blackedition"] .os-watermark #os-sys-version-text {
    font-size: 14px !important;
    color: #4a90e2 !important;
    letter-spacing: 3px !important;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.4) !important;
}

[data-theme="blackedition"] .os-watermark .os-slogan {
    font-size: 11px !important;
    color: #5d6776 !important;
    letter-spacing: 4px !important;
    text-shadow: none !important;
    margin-top: 10px !important;
}

/* BlackEdition HTML Title Banner Dynamics */
[data-theme="blackedition"] .desktop-blackedition-banner {
    display: flex !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
    width: 100%;
}

[data-theme="blackedition"] .desktop-blackedition-banner .be-title {
    font-family: 'Cinzel', serif;
    font-size: 110px;
    font-weight: 700;
    letter-spacing: -1px;
    margin: 0;
    background: linear-gradient(180deg, #8a9bb0 0%, #3e4450 40%, #15171b 45%, #050608 55%, #2a303a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.1);
    filter: drop-shadow(0px 10px 15px rgba(0,0,0,0.9)) drop-shadow(0px 1px 1px rgba(255,255,255,0.2));
}

[data-theme="blackedition"] .desktop-blackedition-banner .be-author {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 4px;
    margin: -5px 0 0 0;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 2px 2px 8px #000;
    text-transform: uppercase;
}

[data-theme="blackedition"] .taskbar-center {
    overflow: visible !important;
}

[data-theme="blackedition"] .start-footer {
    background: #0f1013 !important;
    border-top: 1px solid #1a1c21 !important;
    box-shadow: inset 0 3px 10px rgba(0,0,0,0.4) !important;
    padding: 15px 20px !important;
}
[data-theme="blackedition"] .start-footer #menu-avatar {
    border-radius: 50% !important;
    border: 2px solid #2a2d35 !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.8), inset 0 0 4px rgba(255,255,255,0.1) !important;
    filter: none;
    padding: 2px;
    background: #1e2025;
}
[data-theme="blackedition"] .start-footer #menu-user-name {
    color: #e0e5ea !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
[data-theme="blackedition"] .start-footer .fa-wallet {
    color: #27ae60 !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}
[data-theme="blackedition"] .start-footer #os-wallet-display {
    color: #2ecc71 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-weight: 700 !important;
}
[data-theme="blackedition"] .start-footer .fa-history {
    color: #7f8fa6 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
[data-theme="blackedition"] .start-footer #os-productivity-display {
    color: #a4b0be !important;
    font-weight: 400 !important;
    letter-spacing: 0.5px;
}
[data-theme="blackedition"] .start-footer .fa-search,
[data-theme="blackedition"] .start-footer .fa-laptop-house,
[data-theme="blackedition"] .start-footer .fa-lock,
[data-theme="blackedition"] .start-footer .fa-power-off,
[data-theme="blackedition"] .start-footer .clock {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    transition: 0.2s;
}
[data-theme="blackedition"] .start-footer .fa-search:hover,
[data-theme="blackedition"] .start-footer .fa-laptop-house:hover,
[data-theme="blackedition"] .start-footer .fa-lock:hover,
[data-theme="blackedition"] .start-footer .fa-power-off:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px currentColor);
}

/* Modificação Premium do Botão Flutuante de Ajuda */
[data-theme="blackedition"] .fab-ajuda-os {
    background: linear-gradient(135deg, #1f2228, #0b0c0f) !important;
    color: #4a90e2 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.8), inset 1px 1px 2px rgba(255,255,255,0.05) !important;
    border: 1px solid #2f323a !important;
    animation: none !important; /* Remove o pulso de luz intrusivo */
}

[data-theme="blackedition"] .fab-ajuda-os:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.9), inset 1px 1px 2px rgba(255,255,255,0.1) !important;
    border-color: #4a90e2 !important;
    transform: scale(1.1) translateY(-3px) !important;
}

/* Remoção Global do Quick Launch na BlackEdition */
[data-theme="blackedition"] #quick-launch-apps {
    display: none !important;
}

/* Minimalismo Restrito a Mobile/Tablets na BlackEdition */
@media (max-width: 1400px) {
    [data-theme="blackedition"] .taskbar-center > *:not(.start-btn) {
        display: none !important;
    }
}

/* BlackEdition overrides for right floating widget */
[data-theme="blackedition"] #floating-status-box {
    background: linear-gradient(145deg, #181a1f, #0d0f12) !important;
    border-left: 5px solid #2f323a !important;
    box-shadow: -15px 0 45px #050608, inset 1px 1px 2px rgba(255,255,255,0.05) !important;
    color: #c4d1e0 !important;
}

[data-theme="blackedition"] #floating-status-handle {
    background: linear-gradient(145deg, #1e2025, #15161a) !important;
    border-left: 1px solid #3a3c42 !important;
    border-top: 1px solid #3a3c42 !important;
    border-bottom: 1px solid #3a3c42 !important;
    color: #c4d1e0 !important;
    box-shadow: -5px 0 15px #050608, inset 1px 1px 2px rgba(255,255,255,0.05) !important;
}

[data-theme="blackedition"] #floating-status-box span {
    color: #8a9bb0 !important;
}
[data-theme="blackedition"] #floating-status-box #floating-wallet-display, 
[data-theme="blackedition"] #floating-status-box #floating-plano-nome, 
[data-theme="blackedition"] #floating-status-box #floating-plano-exp, 
[data-theme="blackedition"] #floating-status-box #floating-storage-text {
    color: #c4d1e0 !important;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8) !important;
}
[data-theme="blackedition"] #floating-status-box .fa-wallet { color: #27ae60 !important; }
[data-theme="blackedition"] #floating-status-box .fa-crown { color: #f1c40f !important; }
[data-theme="blackedition"] #floating-status-box .fa-cloud { color: #4a90e2 !important; }

/* --- BlackEdition Arc Menu UI --- */
.be-arc-btn {
    display: none; /* hidden everywhere else */
}

[data-theme="blackedition"] .be-arc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 20px;
    color: #000000;
    text-shadow: 0 1px 2px rgba(255,255,255,0.1);
    background: linear-gradient(135deg, #2b303a, #1a1d24);
    border: 1px solid #111;
    border-radius: 8px;
    margin-left: 15px;
    cursor: pointer;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.1), 0 2px 6px rgba(0,0,0,0.8);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="blackedition"] .be-arc-btn:hover {
    transform: scale(1.05);
    box-shadow: inset 1px 1px 5px rgba(255, 255, 255, 0.1), 0 0 15px rgba(0, 0, 0, 0.8);
    color: #111111;
    border-color: #000;
}

#be-arc-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(5, 6, 8, 0.7);
    backdrop-filter: blur(10px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#be-arc-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#be-arc-container {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    z-index: 9999;
    pointer-events: none; /* children only */
}

.arc-app-item {
    position: absolute;
    width: 80px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: #c4d1e0;
    cursor: pointer;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0) rotate(-45deg);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    text-align: center;
    top: 0; left: 0; /* Base position */
}

.arc-app-item i {
    font-size: 32px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.8));
    transition: 0.2s;
}

.arc-app-item span {
    font-size: 11px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    word-break: break-word;
}

.arc-app-item:hover i {
    transform: scale(1.2) translateY(-5px);
    filter: drop-shadow(0 6px 12px rgba(255,255,255,0.2));
}

/* BlackEdition Arc Menu Text Banner */
.be-arc-center-text {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
}

#be-arc-overlay.active .be-arc-center-text {
    opacity: 1;
    transform: translate(-50%, -60%);
}

.be-arc-center-text h1 {
    font-family: 'Cinzel', serif;
    font-size: 80px;
    font-weight: 700;
    letter-spacing: -2px;
    margin: 0;
    color: #1a1c23;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.05);
    text-shadow: 0px 5px 15px rgba(0,0,0,0.8), -1px -1px 1px rgba(255,255,255,0.05);
    background: linear-gradient(180deg, #3e4450 0%, #15171b 40%, #050608 60%, #1a1d24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.be-arc-center-text p {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 15px;
    margin: 5px 0 0 0;
    color: #4a5463;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.8);
    text-transform: uppercase;
}

/* Force Arc App Items to inherit BlackEdition Icon Colors */
[data-theme="blackedition"] .arc-app-item i {
    color: #5d6776 !important;
    text-shadow: 0 4px 6px rgba(0,0,0,0.9) !important;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.8));
}

[data-theme="blackedition"] .arc-app-item:hover i {
    color: #8a9bb0 !important;
    filter: drop-shadow(0 4px 10px rgba(255,255,255,0.1));
}

[data-theme="blackedition"] .arc-app-item span {
    color: #8a9bb0 !important;
}

