@font-face {
    font-family: 'VCR OSD Mono';
    src: url('../Fonts/VCR_OSD_MONO_1.001.ttf') format('truetype'); 
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'WingdingsCustom';
    src: url('../Fonts/wingding.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --xp-blue: #235d9f;
    --xp-green: #38b139;
    --xp-taskbar-bg: #2259a4;
    --xp-start-bg: #3292d3;
    --xp-window-header: linear-gradient(to right, #235d9f, #3292d3);
    --xp-window-bg: #f0f0f0;
    --desktop-bg-light: #ffffff;
    --desktop-bg-dark: #000000;
    --icon-label-light: #000000;
    --icon-label-dark: #ffffff;
}
body {
    margin: 0;
    font-family: 'VCR OSD Mono', 'Tahoma', 'Arial', sans-serif;
    overflow: hidden;
    height: 100vh;
    font-size: 16px;
    cursor: url('../Images/cursor for website.png') 10 0, auto;
}

@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
        font-size: 15px;
        cursor: default;
    }

    #desktop {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 16px;
        gap: 12px;
        height: auto;
    }

    .icon {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: calc(33.333% - 12px) !important;
        min-width: 88px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        cursor: pointer !important;
        user-select: none;
        transform: none !important;
    }

    .icon img {
        width: 64px;
        height: 64px;
        margin-bottom: 6px;
    }

    .icon .label {
        font-size: 12px;
        line-height: 1.1;
        word-break: break-word;
    }

    .icon[data-label="???"] .label {
        font-family: 'WingdingsCustom', 'VCR OSD Mono', sans-serif;
        font-size: 18px;
        line-height: 1;
    }

    .app-window {
        position: fixed;
        top: 8%;
        left: 4%;
        transform: none;
        width: 92% !important;
        height: auto !important;
        max-height: 84vh !important;
        z-index: 3000;
        resize: none;
        border-radius: 6px;
    }

    .window-header {
        font-size: 16px;
        padding: 8px 12px;
        height: 44px;
    }

    .window-content { padding: 12px; }

    #lightbox {
        padding: 8px;
        align-items: center;
        justify-content: center;
    }

    #lightbox-content {
        flex-direction: column;
    }

    #nav-prev, #nav-next {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        padding: 10px;
        font-size: 24px;
    }

    #nav-prev { left: 8px; }
    #nav-next { right: 8px; }

    #lightbox-controls {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10001;
    }

    #taskbar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 56px;
        padding: 6px 12px;
    }

    #lightbox-image {
        max-width: 100%;
        max-height: 70vh;
    }
}

#desktop {
    width: 100vw;
    height: 100vh;
    display: block; 
    transition: background-color 0.3s;
    position: relative;
}
.light-mode .icon .label {
    color: var(--icon-label-light);
    text-shadow: 1px 1px 0 #fff;
}
.light-mode .app-window {
    background-color: var(--xp-window-bg);
    border: 3px solid var(--xp-blue);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.light-mode .window-header {
    background: var(--xp-window-header);
    color: white;
}

.light-mode .cover-img {
    border: 1px solid #000;
}
.dark-mode {
    background-color: var(--desktop-bg-dark);
}

.dark-mode .icon .label {
    color: var(--icon-label-dark);
    text-shadow: 1px 1px 0 #000;
}

.dark-mode .app-window {
    background-color: #1a1a1a;
    border: 3px solid #ccc;
    box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.2);
}

.dark-mode .window-header {
    background: linear-gradient(to right, #444, #666);
    color: #eee;
}

.dark-mode .window-content {
    color: #eee;
}

.dark-mode .status-bar {
    color: #aaa;
}

.dark-mode .file-list .file-item {
    border: 1px solid transparent;
}
.dark-mode .file-list .file-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #aaa;
}

.dark-mode .cover-img {
    border: 1px solid #fff;
}
.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 18px; 
    user-select: none;
    padding: 10px;
    position: absolute; 
    width: 100px; 
    transition: box-shadow 0.1s ease;
    cursor: grab !important;
    pointer-events: all;
}
.icon.dragging {
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    cursor: grabbing !important;
}
.icon img, .icon .label {
    pointer-events: none;
}
.icon img {
    width: 80px; 
    height: 80px;
    image-rendering: pixelated;
    margin-bottom: 8px;
}
.app-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90vw, 650px);
    height: min(80vh, 500px);
    z-index: 1000;
    resize: both; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.promo-window-tall {
    height: min(80vh, 600px);
}
.window-header {
    height: 30px;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    cursor: move; 
    user-select: none;
}
.window-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.window-controls button {
    background: #c0c0c0;
    color: #333;
    border: 2px outset #fff;
    font-size: 16px;
    line-height: 1;
    width: 25px;
    height: 25px;
    margin-left: 5px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    transition: background 0.1s;
    cursor: url('../Images/cursor for website.png') 10 0, auto !important;
}
.window-controls button:hover {
    background: #e0e0e0;
}
.window-controls .close-btn {
    background: #ff0000;
    color: white;
    font-weight: bold;
}
.window-controls .close-btn:hover {
    background: #cc0000;
}
.window-content {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 14px;
}
.status-bar {
    padding-top: 10px;
    margin: 0;
    font-style: italic;
    font-size: 12px;
}
.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
    align-content: flex-start;
}
.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    cursor: url('../Images/cursor for website.png') 10 0, auto !important;
}
.file-item:hover {
    background-color: rgba(35, 93, 159, 0.1);
}
.cover-item {
    width: 55px;
}
.cover-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-bottom: 8px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}
.promo-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    flex-grow: 1;
}
.promo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}
.file-name {
    font-size: 14px;
    word-break: break-word;
}
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s;
}
#lightbox.hidden {
    display: none; 
    opacity: 0;
    pointer-events: none;
}
#lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
#lightbox-content > * {
    pointer-events: all;
}
#lightbox-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 100vh;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    object-fit: contain;
    transition: transform 0.2s ease-out;
    cursor: pointer; 
    cursor: url('../Images/cursor for website.png') 10 0, auto !important;
}
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px;
    font-size: 30px;
    cursor: pointer;
    z-index: 10000;
    user-select: none;
    transition: background 0.2s;
    line-height: 0.5;
}

.lightbox-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}
#nav-prev {
    left: -60px;
}
#nav-next {
    right: -60px;
}
#lightbox-controls {
    margin-top: 20px;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 5px;
    z-index: 10000;
}
.zoom-btn {
    background: #444;
    color: white;
    border: 1px solid #777;
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1;
    margin: 0 5px;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

.zoom-btn:hover:not(:disabled) {
    background: #666;
}

.zoom-btn:disabled {
    background: #222;
    cursor: default;
    color: #888;
}

#zoom-level {
    color: white;
    font-size: 16px;
    font-family: 'VCR OSD Mono', sans-serif;
    padding: 0 10px;
    min-width: 50px;
    text-align: center;
}
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--xp-taskbar-bg);
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-top: 3px solid #a3b5ce; 
    box-shadow: 0 -2px 0 #1b4984;
    z-index: 2000;
}
.mode-toggle {
    width: 60px; 
    height: 30px; 
    padding: 3px 0; 
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    cursor: url('../Images/cursor for website.png') 10 0, auto !important;
}
#mode-toggle-bottom {
    margin-left: 20px;
}
.toggle-track {
    width: 100%;
    height: 100%;
    background-color: var(--xp-blue);
    border: 2px solid black; 
    border-radius: 15px; 
    box-shadow: inset 2px 2px 0 #00000050; 
    position: relative;
    transition: background-color 0.3s;
}
.toggle-handle {
    width: 26px; 
    height: 26px;
    background-color: white;
    border: 2px solid black; 
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: transform 0.3s;
}

#desktop.dark-mode .mode-toggle .toggle-track {
    background-color: var(--xp-green);
}

#desktop.dark-mode .mode-toggle .toggle-handle {
    transform: translateX(28px);
}