/* Desktop Styles */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: white;
}

.boot-screen.active {
    display: flex;
}

.boot-logo {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.boot-progress {
    width: 300px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.boot-progress-bar {
    width: 0%;
    height: 100%;
    background: white;
    animation: bootProgress 2s ease-in-out forwards;
}

@keyframes bootProgress {
    to { width: 100%; }
}

.boot-status {
    font-size: 14px;
    opacity: 0.8;
}

.desktop {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

.desktop.hidden {
    display: none;
}

.desktop-wallpaper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 0;
}

/* Animated wallpaper canvas */
.animated-wallpaper {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    display: block;
}

.desktop-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    z-index: 1;
    overflow: hidden;
}

.desktop-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.desktop-icon:hover {
    background: rgba(255,255,255,0.1);
}

.desktop-icon.selected {
    background: rgba(255,255,255,0.2);
}

.desktop-icon.dragging {
    opacity: 0.5;
    z-index: 1000;
    cursor: grabbing;
}

.desktop-icon.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    opacity: 0.8;
    transform: scale(1.1);
    background: rgba(255,255,255,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.desktop-icon-image {
    font-size: 48px;
    margin-bottom: 8px;
}

.desktop-icon-label {
    color: white;
    font-size: 12px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    word-break: break-word;
}

.windows-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    z-index: 10;
    pointer-events: none;
}

.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notification-title {
    font-weight: bold;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.notification-body {
    font-size: 13px;
    opacity: 0.9;
}

.context-menu {
    position: fixed;
    background: var(--context-menu-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px;
    min-width: 200px;
    box-shadow: 0 4px 12px var(--shadow-color);
    z-index: 9998;
}

.context-menu.hidden {
    display: none;
}

.context-menu-item {
    padding: 8px 12px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: var(--hover-overlay);
}

.context-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.hidden {
    display: none !important;
}

/* Alt+Tab Switcher */
.alt-tab-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.alt-tab-container {
    display: flex;
    gap: 20px;
    padding: 30px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.alt-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    transition: all 0.2s;
    min-width: 120px;
    cursor: pointer;
}

.alt-tab-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(102, 126, 234, 0.8);
    transform: scale(1.1);
}

.alt-tab-icon {
    font-size: 48px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.alt-tab-title {
    color: white;
    font-size: 14px;
    text-align: center;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* -------------------------------------------------------------------------
 * CSS Custom Properties — default (dark) theme baseline.
 * ThemeEngine overrides these on :root at runtime via setProperty().
 * ------------------------------------------------------------------------ */
:root {
    /* Backgrounds */
    --bg-primary:        rgba(30, 30, 30, 0.95);
    --bg-secondary:      rgba(20, 20, 20, 0.90);
    --bg-tertiary:       rgba(40, 40, 40, 0.95);
    --bg-elevated:       rgba(50, 50, 50, 0.95);

    /* Text */
    --text-primary:      #ffffff;
    --text-secondary:    rgba(255, 255, 255, 0.75);
    --text-muted:        rgba(255, 255, 255, 0.45);

    /* Borders */
    --border-color:      rgba(255, 255, 255, 0.10);
    --border-active:     rgba(102, 126, 234, 0.35);

    /* Component-level aliases */
    --window-bg:         rgba(30, 30, 30, 0.95);
    --window-titlebar:   rgba(20, 20, 20, 0.88);
    --taskbar-bg:        rgba(20, 20, 20, 0.90);
    --context-menu-bg:   rgba(40, 40, 40, 0.97);
    --start-menu-bg:     rgba(30, 30, 30, 0.95);
    --input-bg:          rgba(255, 255, 255, 0.05);

    /* Accent */
    --accent-color:      #667eea;
    --accent-secondary:  #764ba2;

    /* Overlays */
    --hover-overlay:     rgba(255, 255, 255, 0.08);
    --active-overlay:    rgba(255, 255, 255, 0.14);

    /* Misc */
    --shadow-color:      rgba(0, 0, 0, 0.45);
    --scrollbar-track:   rgba(255, 255, 255, 0.05);
    --scrollbar-thumb:   rgba(255, 255, 255, 0.18);
    --ui-font-size:      14px;
}

[data-accent="blue"]   { --accent-color: #4a9eff; }
[data-accent="green"]  { --accent-color: #4caf50; }
[data-accent="red"]    { --accent-color: #f44336; }
[data-accent="purple"] { --accent-color: #9c27b0; }
[data-accent="orange"] { --accent-color: #ff9800; }
[data-accent="grey"]   { --accent-color: #607d8b; }

/* -------------------------------------------------------------------------
 * Drag & Drop — external files and internal FM moves
 * ------------------------------------------------------------------------ */

/* Desktop drop zone highlight */
.desktop.drag-over .desktop-wallpaper,
.desktop.drag-over .desktop-icons {
    outline: 2px dashed rgba(100, 149, 237, 0.5);
    outline-offset: -4px;
}

.desktop.drag-over::after {
    content: '📂  Přetáhněte soubory na plochu';
    position: fixed;
    inset: 0;
    background: rgba(100, 149, 237, 0.12);
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* File Manager drop zone highlight */
.file-list.drag-over {
    background: rgba(100, 149, 237, 0.10);
    outline: 2px dashed rgba(100, 149, 237, 0.5);
    outline-offset: -4px;
    border-radius: 4px;
}

/* Folder item — highlighted when a dragged file hovers over it */
.file-item.drop-target {
    background: rgba(100, 149, 237, 0.20);
    outline: 2px dashed rgba(100, 149, 237, 0.6);
    border-radius: 4px;
}

/* File item being dragged inside FM */
.file-item.dragging-item {
    opacity: 0.45;
    pointer-events: none;
}

/* Ghost element when dragging inside FM */
.fm-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    opacity: 0.85;
    background: var(--bg-elevated, rgba(50,50,50,0.95));
    border: 1px solid rgba(100, 149, 237, 0.5);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translate(-50%, -50%);
}

/* Night mode */
body.night-mode {
    filter: sepia(20%) brightness(85%) hue-rotate(-10deg);
}

body.night-mode .window {
    filter: none;
}

/* Disable animations */
.no-animations .window.opening,
.no-animations .window.closing,
.no-animations .window.minimizing,
.no-animations .window.restoring {
    animation: none !important;
}

.no-animations .window {
    transition: box-shadow 0.05s, border-color 0.05s !important;
}

.no-animations .toggle-switch,
.no-animations .toggle-switch-handle {
    transition: none !important;
}

/* -------------------------------------------------------------------------
 * Desktop Widgets
 * ------------------------------------------------------------------------- */

.desktop-widget {
    position: absolute;
    min-width: 160px;
    background: rgba(15, 15, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 5;
    overflow: hidden;
    color: #ccc;
    font-family: inherit;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: move;
    user-select: none;
}

.widget-title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.widget-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.widget-close:hover {
    color: #f66;
}

.widget-body {
    padding: 10px;
}
