/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "MS Sans Serif", Arial, sans-serif;
}

body {
    overflow: hidden;
    height: 100vh;
}

/* Desktop Styles */
.desktop {
    position: relative;
    width: 100vw;
    height: calc(100vh - 30px);
    background-color: #008080; /* Classic Windows teal background */
    overflow: hidden;
}

/* Taskbar Styles */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: #c0c0c0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #ffffff;
    box-shadow: inset 0 1px 0 0 #dfdfdf;
    z-index: 1000;
}

.start-button {
    height: 22px;
    margin-left: 2px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    background-color: #c0c0c0;
    border: 2px outset #dfdfdf;
    font-weight: bold;
    cursor: pointer;
}

.start-button:active {
    border: 2px inset #dfdfdf;
}

.time {
    margin-right: 10px;
    font-size: 12px;
}

/* Desktop Icon Styles */
.desktop-icon {
    position: absolute;
    width: 75px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    z-index: 1;
}

.desktop-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.desktop-icon:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.desktop-icon.dragging {
    opacity: 0.8;
    cursor: move;
}

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

.icon-text {
    color: white;
    text-align: center;
    font-size: 12px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
    word-break: break-word;
}

/* Window Styles */
.window {
    position: absolute;
    min-width: 300px;
    min-height: 200px;
    background-color: #c0c0c0;
    border: 2px outset #dfdfdf;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
    display: flex;
    flex-direction: column;
    resize: both;
    overflow: auto;
}

.window-title-bar {
    height: 22px;
    background-color: #000080; /* Classic Windows blue title bar */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
    cursor: move; /* Indicates the title bar can be used to move the window */
}

.window-title {
    font-weight: bold;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window-controls {
    display: flex;
}

.window-control {
    width: 16px;
    height: 14px;
    margin-left: 2px;
    background-color: #c0c0c0;
    border: 1px outset #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
}

.window-control:active {
    border: 1px inset #ffffff;
}

.window-content {
    flex: 1;
    padding: 10px;
    overflow: auto;
    background-color: white;
    margin: 3px;
}

/* Add resizer styles */
.resizer {
    position: absolute;
    width: 10px;
    height: 10px;
    background: transparent;
    z-index: 100;
}

.resizer.n {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
    width: 100%;
    height: 10px;
}

.resizer.e {
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: e-resize;
    width: 10px;
    height: 100%;
}

.resizer.s {
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize;
    width: 100%;
    height: 10px;
}

.resizer.w {
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: w-resize;
    width: 10px;
    height: 100%;
}

.resizer.ne {
    right: -5px;
    top: -5px;
    cursor: ne-resize;
}

.resizer.nw {
    left: -5px;
    top: -5px;
    cursor: nw-resize;
}

.resizer.se {
    right: -5px;
    bottom: -5px;
    cursor: se-resize;
}

.resizer.sw {
    left: -5px;
    bottom: -5px;
    cursor: sw-resize;
}

/* Start Menu Styles */
.start-menu {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 200px;
    background-color: #c0c0c0;
    border: 2px outset #dfdfdf;
    z-index: 1001;
    display: none;
}

.start-menu.active {
    display: block;
}

.start-menu-header {
    height: 40px;
    background-color: #000080; /* Classic Windows blue */
    color: white;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-weight: bold;
}

.start-menu-item {
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

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

.start-menu-item img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Taskbar program buttons */
.taskbar-programs {
    display: flex;
    flex: 1;
    height: 100%;
    margin: 0 5px;
    overflow: hidden;
}

.taskbar-program {
    min-width: 120px;
    max-width: 200px;
    height: 22px;
    margin-left: 2px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    background-color: #c0c0c0;
    border: 2px outset #dfdfdf;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.taskbar-program.active {
    border: 2px inset #dfdfdf;
}

/* For minimized windows */
.window.minimized {
    display: none;
}

/* For maximized windows */
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 30px) !important;
}