body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* desktop container */
#desktop {
    width: 100%;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* icons */
.icon {
    color: #ff2a2a;
    text-shadow: 0 0 4px #ff0000, 0 0 12px rgba(255, 0, 0, 0.6);
    width: 120px;
    text-align: center;
    margin-bottom: 30px;
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    user-select: none;
    /* prevent highlighting on double-click!!! */
}

.icon-art {
    font-size: 14px;
    margin-bottom: 5px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-art img {
    max-height: 100%;
    filter: drop-shadow(0 0 5px #ff2a2a);
}

.icon p {
    font-size: 14px;
    margin: 0;
}

.icon:hover p {
    background-color: #ff2a2a;
    color: #000;
    text-shadow: none;
}

/* window styles */
.window {
    display: none;
    /* keep hidden by default */
    position: absolute;
    width: 450px;
    min-height: 200px;
    min-width: 300px;
    background-color: #080808;
    border: 1px solid #ff2a2a;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    z-index: 10;
    display: flex;
    flex-direction: column;
    resize: none;
    overflow: hidden;
    transform-origin: center;
}

.window .content,
.window .title-bar {
    visibility: hidden;
    /* hide content until window is "opened" */
}

.window.is-open .content,
.window.is-open .title-bar {
    visibility: visible;
    /* show content when fully open */
}

@keyframes open-window-staged {
    from {
        transform: scale(0.1);
    }

    to {
        transform: scale(1);
    }
}

.window.is-opening {
    animation: open-window-staged 0.4s steps(3, end) forwards;
    /* hide browser's default overflow, child will scroll */
}

.window.is-closing {
    /* use a different animation for closing */
    animation: close-window-staged 0.4s steps(3, end) forwards;
}

@keyframes close-window-staged {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(0.1);
    }
}

.title-bar {
    background-color: #ff2a2a;
    color: #000;
    padding: 5px 10px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.title-bar .title {
    text-shadow: none;
}

.close-btn {
    background: #000;
    color: #ff2a2a;
    border: 1px solid #ff2a2a;
    cursor: pointer;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    padding: 0;
}

.close-btn:hover {
    background: #fff;
    color: #000;
}

.window .content {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
}

.window .content img {
    max-width: 100%;
    /* scale down img to fit */
    height: auto;
    /* keep aspect ratio */
    display: block;
}

.window .content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* image Effects Container */
.image-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    /* contain the scanline */
}

/* this prevents that flashing glitch thingy - DON'T REMOVE! */
.image-container[data-effects="retro-art"] img {
    visibility: hidden;
}

/* display image when filter applied */
.image-container[data-effects="retro-art"] img.is-filtered {
    visibility: visible;
}

/* image loading effect (just like when I was a kid oh god) */
@keyframes reveal-image-staged {
    from {
        clip-path: inset(0 0 100% 0);
    }

    to {
        clip-path: inset(0 0 0% 0);
    }
}

.image-container.is-loading img {
    /* apply image loading animation */
    animation: reveal-image-staged 1.2s steps(8, end) forwards;
}

/* gameboy style retro art filter effect thingy */
.image-container img.is-filtered {
    /* red monochrome, slightly blown-out look */
    filter: grayscale(1) sepia(1) hue-rotate(-55deg) saturate(8) brightness(0.7) contrast(1.2);
    /* pixel upscaling sim*/
    image-rendering: pixelated;
    /* cursor: pointer; */
}

/* image "upscale" effect*/
.image-container .reveal-scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #fff;
    box-shadow: 0 0 10px #fff, 0 0 20px #ff2a2a;
    opacity: 0.8;
    pointer-events: none;
    /* don't block clicks (whoops) */
    animation: scanline-reveal 0.6s ease-out forwards;
}

@keyframes scanline-reveal {
    from {
        top: 0;
    }

    to {
        top: 100%;
    }
}

/* custom scrollbar */
.window .content::-webkit-scrollbar {
    width: 12px;
}

.window .content::-webkit-scrollbar-track {
    background: #080808;
}

.window .content::-webkit-scrollbar-thumb {
    background-color: #ff2a2a;
    border: 2px solid #080808;
    border-radius: 6px;
}

/* custom resizer handle */
.resizer {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    cursor: url("../images/cursors/cursor_resize.png") 8 8, nwse-resize;
    background-image:
        linear-gradient(to right, #ff2a2a, #ff2a2a),
        linear-gradient(to right, #ff2a2a, #ff2a2a),
        linear-gradient(to top, #ff2a2a, #ff2a2a),
        linear-gradient(to top, #ff2a2a, #ff2a2a);
    background-size:
        12px 2px,
        8px 2px,
        2px 12px,
        2px 8px;
    background-position:
        bottom 0px right 0px,
        bottom 4px right 0px,
        bottom 0px right 0px,
        bottom 0px right 4px;
    background-repeat: no-repeat;
}

.window.is-text-window {
    height: 350px;
    width: 550px;
}

.window-content-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.window.active {
    z-index: 11;
    /* bring active window to front */
}

/* taskbar */
#taskbar {
    height: 30px;
    flex-shrink: 0;
    background-color: #080808;
    border-top: 1px solid #ff2a2a;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#volume-control {
    color: #ff2a2a;
    text-shadow: 0 0 4px #ff0000, 0 0 12px rgba(255, 0, 0, 0.6);
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

#user-info {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #ff2a2a;
    display: flex;
    gap: 20px;
    user-select: none;
}

/* system Info Box */
#system-info {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    border: 1px dashed #ff2a2a;
    z-index: 1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    animation: subtle-flicker 15s linear infinite;
}

#system-info .title-bar {
    background-color: transparent;
    color: #ff2a2a;
    text-align: center;
    padding: 2px;
    font-size: 12px;
    /* cursor: default; */
}