/* Basic Reset & Fonts */
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Pixelated', 'Segoe UI', sans-serif;
    background-color: #008080;
    /* Classic Win98 Teal */
    user-select: none;
    height: 100vh;
}

/* Desktop */
#desktop {
    position: relative;
    width: 100%;
    height: calc(100vh - 28px);
    /* Height minus taskbar */
    padding: 10px;
    /* Removed flex to allow free dragging */
}

/* Icons */
.desktop-icon {
    position: absolute;
    /* Changed to absolute for dragging */
    width: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: white;
    text-shadow: 1px 1px 0px black;
    text-align: center;
    border: 1px solid transparent;
}

.desktop-icon:active,
.desktop-icon.selected {
    background-color: #000080;
    border: 1px dotted yellow;
}

.desktop-icon img {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
}

.desktop-icon span {
    font-size: 12px;
    line-height: 1.2;
}

/* Windows */
.window-98 {
    position: absolute;
    top: 50px;
    left: 50px;
    width: 400px;
    background-color: #c0c0c0;
    border: 2px solid #dfdfdf;
    border-right-color: #000000;
    border-bottom-color: #000000;
    box-shadow: 1px 1px 0px 0px #000000;
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
}

.title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    padding: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-weight: bold;
    cursor: default;
}

.title-bar-text {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    padding-left: 2px;
}

.title-bar-controls button {
    width: 16px;
    height: 14px;
    min-width: 16px;
    padding: 0;
    font-size: 10px;
    line-height: 10px;
    background-color: #c0c0c0;
    border: 1px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #808080;
    margin-left: 2px;
    font-weight: bold;
}

.title-bar-controls button:active {
    border: 1px solid #808080;
    border-right-color: #dfdfdf;
    border-bottom-color: #dfdfdf;
    box-shadow: none;
    padding-top: 1px;
    padding-left: 1px;
}

/* Window Body Types */
.window-body {
    margin: 2px;
    padding: 2px;
    background-color: #c0c0c0;
    /* Default grey for container */
    color: black;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 2px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    overflow: hidden;
}

/* Menu Bar (File Edit View...) */
.menu-bar {
    display: flex;
    padding: 2px 0;
    margin-bottom: 2px;
}

.menu-item {
    padding: 2px 5px;
    cursor: default;
}

.menu-item:hover {
    background-color: #000080;
    color: white;
}

/* Explorer Layout (My Computer) */
.explorer-body {
    display: flex;
    flex-grow: 1;
    background-color: white;
    border: 2px solid #808080;
    /* Sunken look */
    border-right-color: #fff;
    border-bottom-color: #fff;
    padding: 5px;
    gap: 10px;
    align-content: flex-start;
    flex-wrap: wrap;
}

.explorer-item {
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.explorer-item:hover span {
    background-color: #000080;
    color: white;
}

.explorer-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 2px;
}

.explorer-item span {
    font-size: 11px;
    padding: 0 2px;
}

/* Notepad Layout */
.notepad-body {
    flex-grow: 1;
    width: 100%;
    resize: none;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 5px;
    outline: none;
    overflow: auto;
    white-space: pre-wrap;
}

/* Address Bar (Optional for explorer) */
.address-bar {
    display: flex;
    gap: 5px;
    padding: 2px;
    align-items: center;
    border-bottom: 1px solid #808080;
    margin-bottom: 2px;
}

.address-input {
    flex-grow: 1;
    border: 2px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    background: white;
    padding: 1px 3px;
}


/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background-color: #c0c0c0;
    border-top: 2px solid #fff;
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 1000;
}

#start-button {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 5px;
    margin-right: 5px;
    font-weight: bold;
    font-style: italic;
    background-color: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #808080;
}

#start-button:active,
#start-button.active {
    border: 2px solid #000;
    border-right-color: #fff;
    border-bottom-color: #fff;
    box-shadow: none;
    background-color: #c0c0c0;
    /* stays grey */
}

#start-button img {
    height: 16px;
}

.divider {
    width: 2px;
    height: 20px;
    background-color: #808080;
    border-right: 2px solid #fff;
    margin: 0 5px;
}

#quick-launch {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 5px;
    padding-left: 2px;
}

.quick-launch-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid transparent;
}

.quick-launch-icon:hover {
    border: 1px solid #fff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    box-shadow: 1px 1px 0px black;
}

.quick-launch-icon:active {
    border: 1px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    box-shadow: none;
    transform: translate(1px, 1px);
}

.quick-launch-icon img {
    width: 16px;
    height: 16px;
}

#taskbar-apps {
    flex-grow: 1;
    display: flex;
    gap: 2px;
    padding-left: 2px;
}

.taskbar-app {
    height: 22px;
    padding: 0 5px;
    min-width: 100px;
    max-width: 150px;
    display: flex;
    align-items: center;
    background-color: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    cursor: pointer;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.taskbar-app.active {
    background-color: #e0e0e0;
    /* Dithering effect simulated by lighter grey */
    border: 2px solid #000;
    border-right-color: #fff;
    border-bottom-color: #fff;
    background-image: linear-gradient(45deg, #c0c0c0 25%, #ffffff 25%, #ffffff 50%, #c0c0c0 50%, #c0c0c0 75%, #ffffff 75%, #ffffff 100%);
    background-size: 4px 4px;
}

.taskbar-app img {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

#taskbar-tray {
    display: flex;
    align-items: center;
    padding: 0 10px;
    border: 2px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    background-color: #c0c0c0;
    /* inset look */
    height: 22px;
    margin-left: auto;
}

.tray-icon {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

#clock {
    font-size: 12px;
}

/* Start Menu */
/* Start Menu */
#start-menu {
    position: fixed;
    bottom: 28px;
    left: 2px;
    background-color: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    display: flex;
    z-index: 2000;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    font-family: 'Segoe UI', sans-serif;
    font-size: 11px;
    min-width: 170px;
    /* Ensure content determines height or min-height */
}

.start-side-banner {
    width: 25px;
    background: linear-gradient(to bottom, #000080, #1084d0 5%, #000080 15%);
    position: relative;
    /* We will position text absolutely inside */
}

.vertical-text {
    position: absolute;
    bottom: 0;
    left: 0;
    transform: rotate(-90deg);
    transform-origin: bottom left;
    color: white;
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap;
    padding: 0 0 5px 5px;
    /* Adjust padding to move it off the edge */
}

/* Specific stronger bold for 98 */
.vertical-text b {
    font-weight: 900;
}

.start-items {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 2px;
}

.start-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: default;
    position: relative;
    /* For submenu positioning */
}

.start-item:hover {
    background-color: #000080;
    color: white;
}

.start-item img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
}

.start-item span.label {
    flex-grow: 1;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 10px;
}

.start-item hr {
    margin: 2px 0;
    border: 0;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
    width: 100%;
}

/* Submenu */
.submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    min-width: 150px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 2001;
}

.start-item:hover>.submenu {
    display: block;
}

/* Separators in start menu are currently divs with HRs.
   Let's target HRs directly inside start-items container if possible, 
   but above HTML used divs. Let's fix the HTML structure assumptions in CSS.
   The HTML had <hr> as direct children of .start-items.
*/
.start-items>hr {
    margin: 3px 2px;
    border: 0;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
}


/* Shutdown Dialog Specifics */
.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.win98-btn {
    min-width: 75px;
    height: 23px;
    background-color: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    font-family: inherit;
    font-size: 11px;
}

.win98-btn:active {
    border: 2px solid #000;
    border-right-color: #fff;
    border-bottom-color: #fff;
}