/* General Reset */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #008080; /* Classic Teal */
    font-family: 'VT323', monospace; /* Pixel font */
    font-size: 38px; /* Larger size for pixel font readability */
    overflow: hidden; /* Prevent scrollbars on desktop */
    user-select: none;
    image-rendering: pixelated; /* Force pixelated rendering for everything */
}

/* Desktop */
#desktop {
    width: 100vw;
    height: calc(100vh - 28px); /* Minus taskbar height */
    position: relative;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-wrap: wrap;
    align-content: flex-start;
}

/* Desktop Icons */
.desktop-icon {
    width: 70px;
    text-align: center;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.desktop-icon:hover .icon-img {
    filter: brightness(0.8);
}

.desktop-icon .icon-img {
    width: 48px; /* Larger to show off pixels */
    height: 48px;
    background-size: contain;
    background-repeat: no-repeat;
    margin-bottom: 5px;
    image-rendering: pixelated;
}

.desktop-icon .icon-text {
    font-size: 16px;
    text-shadow: 2px 2px 0px black;
}

/* Placeholder Icons using CSS or external URLs */
.computer-icon {
    background-image: url('https://win98icons.alexmeub.com/icons/png/computer_explorer-4.png');
}
.console-icon {
    background-image: url('https://win98icons.alexmeub.com/icons/png/console_prompt-0.png');
}
.winamp-icon {
    background-image: url('https://win98icons.alexmeub.com/icons/png/cd_audio_cd_a-4.png');
}

/* Window Styling */
.window {
    position: absolute;
    background-color: #c0c0c0;
    border-top: 2px solid #dfdfdf;
    border-left: 2px solid #dfdfdf;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    box-shadow: 1px 1px 0px #ffffff inset, -1px -1px 0px #808080 inset;
    display: flex;
    flex-direction: column;
    padding: 2px;
}

.title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: normal; /* VT323 is bold enough */
    font-size: 20px;
    cursor: default;
    letter-spacing: 1px;
}

.title-bar-text {
    flex-grow: 1;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-controls button {
    width: 18px;
    height: 16px;
    background-color: #c0c0c0;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    font-size: 14px;
    line-height: 12px;
    padding: 0;
    font-weight: bold;
    cursor: pointer;
    font-family: 'VT323', monospace;
}

.title-bar-controls button[aria-label="Minimize"]::after { content: "_"; position: relative; top: -3px; }
.title-bar-controls button[aria-label="Maximize"]::after { content: "□"; }
.title-bar-controls button[aria-label="Close"]::after { content: "×"; }

.window-body {
    padding: 10px;
    flex-grow: 1;
    overflow: auto;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 9999;
}

.start-button {
    height: 22px;
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    font-weight: bold;
    display: flex;
    align-items: center;
    padding: 0 5px;
    cursor: pointer;
    margin-right: 5px;
    box-shadow: 1px 1px 0px black;
}
.start-button:active {
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: translate(1px, 1px);
    box-shadow: none;
}

.taskbar-divider {
    width: 2px;
    height: 20px;
    background-color: #808080;
    border-right: 1px solid #ffffff;
    margin: 0 5px;
}

#taskbar-apps {
    flex-grow: 1;
    display: flex;
    gap: 2px;
}

.taskbar-app {
    width: 150px;
    height: 22px;
    background-color: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    display: flex;
    align-items: center;
    padding: 0 5px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: black; /* Explicitly set text color to black */
    font-weight: bold;
}
.taskbar-app.active {
    background-color: #e0e0e0; /* Highlight active */
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    font-weight: bold;
}

.tray {
    background-color: #c0c0c0;
    border: 1px solid #808080;
    border-bottom: 1px solid #ffffff;
    border-right: 1px solid #ffffff;
    padding: 2px 5px;
    font-size: 12px;
    margin-left: 5px;
}

/* Console Specific */
.console-body {
    background-color: #000000;
    color: #c0c0c0;
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 5px;
    height: 300px;
}
.console-input-line {
    display: flex;
}
#console-input {
    background: transparent;
    border: none;
    color: #c0c0c0;
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
    outline: none;
}

/* Winamp Specific */
#winamp .window-body {
    background-color: #202020;
    color: #00ff00;
    font-family: 'VT323', monospace;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 16px; /* Override global body size for player controls */
}

.winamp-display {
    background-color: #000000;
    border: 2px inset #808080;
    padding: 10px;
    margin-bottom: 5px;
    font-size: 20px; /* Slightly larger for display text */
    position: relative;
}

#song-title {
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 5px;
}

.winamp-controls {
    display: flex;
    gap: 5px;
    justify-content: center;
}
.winamp-controls button {
    min-width: 30px;
    font-size: 10px;
}

.winamp-progress {
    width: 100%;
}
.winamp-progress input {
    width: 100%;
}

#visualizer {
    width: 100%;
    height: 100%; /* Slightly taller for video */
    margin-top: 5px;
    background-color: #000000;
    overflow: hidden;
    border: 1px solid #404040;
}

#viz-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the box, crop if needed */
    opacity: 0.8; /* Slight retro dimming */
}
