@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Pixelify Sans', 'MS Sans Serif', Tahoma, sans-serif;
    background-color: var(--bg-color, #008080); /* Classic Win95 Teal */
    color: #000;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

body.dark-mode {
    --bg-color: #1a1a1a;
}

body.dark-mode .win95-outset,
body.dark-mode .win95-inset,
body.dark-mode .start-menu-items,
body.dark-mode .window-header.inactive {
    background: #404040;
    color: #e0e0e0;
}

body.dark-mode .win95-inset {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .window-header {
    background: #000040;
}

body.dark-mode .start-menu-sidebar {
    background: linear-gradient(to bottom, #000040, #084268);
}

body.dark-mode .desktop-icon .label {
    color: #e0e0e0;
}

/* Win95 Borders */
.win95-outset {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf;
}

.win95-inset {
    background: #ffffff;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    box-shadow: inset 1px 1px #000000, inset -1px -1px #dfdfdf;
}

.win95-outset:active:not(.window) {
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #dfdfdf;
}

/* Desktop */
#desktop {
    flex-grow: 1;
    position: relative;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.desktop-icon {
    width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.desktop-icon .icon {
    font-size: 32px;
    margin-bottom: 5px;
    text-shadow: 1px 1px 0 #000;
}

.desktop-icon .label {
    color: white;
    font-size: 12px;
    text-align: center;
    text-shadow: 1px 1px 0 #000;
    padding: 2px 4px;
}

.desktop-icon:active .label {
    background-color: #000080;
    border: 1px dotted #fff;
}

/* Taskbar */
#taskbar {
    height: 35px;
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 10000;
}

#start-btn {
    height: 100%;
    padding: 0 10px;
    font-family: inherit;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

#taskbar-windows {
    flex-grow: 1;
    display: flex;
    gap: 2px;
    padding: 0 5px;
}

.taskbar-item {
    height: 100%;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    cursor: pointer;
    min-width: 100px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-item.active {
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #dfdfdf;
    background: #e0e0e0;
}

#clock {
    height: 100%;
    padding: 0 10px;
    display: flex;
    align-items: center;
    font-size: 12px;
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 35px;
    left: 0;
    width: 200px;
    display: flex;
    z-index: 10001;
}

#start-menu.hidden {
    display: none;
}

.start-menu-sidebar {
    background: linear-gradient(to bottom, #000080, #1084d0);
    width: 30px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 5px;
}

.start-menu-sidebar span {
    color: white;
    font-weight: bold;
    font-size: 16px;
    transform: rotate(-90deg);
    transform-origin: left bottom;
    white-space: nowrap;
    margin-left: 20px;
    margin-bottom: 10px;
}

.start-menu-items {
    flex-grow: 1;
    padding: 2px;
    background: #c0c0c0;
}

.start-item {
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.start-divider {
    height: 2px;
    background: #808080;
    border-bottom: 1px solid #ffffff;
    margin: 2px 0;
}

/* Windows */
.window {
    position: absolute;
    width: 400px;
    height: 300px;
    display: flex;
    flex-direction: column;
    padding: 2px;
    z-index: 10;
}

.window-header {
    background: #000080;
    color: white;
    padding: 2px 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.window.inactive .window-header {
    background: #808080;
}

.window-title {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    font-size: 14px;
}

.window-controls button {
    width: 16px;
    height: 14px;
    font-size: 10px;
    font-weight: bold;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.window-menu {
    display: flex;
    gap: 10px;
    padding: 2px 5px;
    font-size: 12px;
}

.window-menu span:hover {
    background: #000080;
    color: white;
    cursor: pointer;
}

.window-content {
    flex-grow: 1;
    margin: 2px;
    padding: 10px;
    overflow: auto;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 15px;
}

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

.explorer-item .icon {
    font-size: 28px;
}

.explorer-item .label {
    font-size: 12px;
    text-align: center;
    margin-top: 2px;
}

.explorer-item:active .label {
    background-color: #000080;
    color: white;
    border: 1px dotted #000;
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, #808080 50%, #808080 60%, transparent 60%, transparent 70%, #808080 70%, #808080 80%, transparent 80%, transparent 90%, #808080 90%);
    z-index: 20;
}