/* Windows 98 Style - Combined with 98.css compatibility */

body {
    background-color: #008080; /* Classic Windows teal background */
    font-family: "Pixelated MS Sans Serif", Arial;
    margin: 0;
    padding: 0;
    overflow: hidden;
    user-select: none;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
    color: white;
}

.windows-logo {
    margin-bottom: 30px;
}

.windows-logo svg {
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.8));
}

.loading-text {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    color: white;
    letter-spacing: 2px;
}

.loading-bar {
    width: 400px;
    height: 24px;
    border: 3px solid #c0c0c0;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    background: #000080;
    position: relative;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #00cc00);
    width: 0%;
    transition: width 3s ease-in-out;
    animation: loadingAnimation 3s ease-in-out forwards;
}

@keyframes loadingAnimation {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Desktop with proper stacking */
.desktop {
    height: calc(100vh - 28px); /* Full height minus taskbar */
    position: relative;
    background: #008080;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
        );
}

/* 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;
    justify-content: space-between;
    padding: 0 2px;
    z-index: 1000;
}

.start-button {
    display: flex;
    align-items: center;
    padding: 2px 6px;
    border: 2px solid #c0c0c0;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    background: #c0c0c0;
    color: #000;
    font-family: "Pixelated MS Sans Serif", Arial;
    font-size: 11px;
    cursor: pointer;
    margin-right: 4px;
}

.start-button:hover {
    background: #000080;
    color: white;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}

.start-button img, .start-button i {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    font-size: 14px;
}

.start-button span {
    font-weight: bold;
}

/* Start Menu */
.start-menu {
    position: absolute;
    bottom: 28px; /* Position it above the taskbar */
    left: 0;
    width: 180px;
    background-color: #c0c0c0;
    border: 2px solid #c0c0c0;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 2px;
    z-index: 9999;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.start-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.start-menu li {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    font-family: "Pixelated MS Sans Serif", Arial;
    font-size: 11px;
    color: #000;
}

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

.start-menu li img, .start-menu li i {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    font-size: 16px;
}

.start-menu li span {
    font-weight: normal;
}

/* System Tray */
.system-tray {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tray-icons {
    display: flex;
    gap: 2px;
}

.tray-icon {
    width: 16px;
    height: 16px;
    background: #c0c0c0;
    border: 1px solid;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    color: #000;
}

.tray-icon:hover {
    background: #000080;
    color: white;
}

.clock {
    background: #c0c0c0;
    border: 1px solid;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 2px 6px;
    font-size: 11px;
    font-family: "Pixelated MS Sans Serif", Arial;
    cursor: pointer;
    min-width: 60px;
    text-align: center;
    color: #000;
}

.clock:hover {
    background: #000080;
    color: white;
}

/* Desktop Icons */
.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    margin: 20px;
    text-align: center;
    color: white;
    cursor: pointer;
    position: absolute;
    z-index: 100;
    user-select: none;
}

.desktop-icon.selected {
    background: #000080;
    color: white;
}

.desktop-icon.selected span {
    background: #000080;
    color: white;
}

.desktop-icon img, .desktop-icon i {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    pointer-events: none;
    font-size: 28px;
    color: white;
}

.desktop-icon span {
    background-color: transparent;
    padding: 2px 4px;
    font-size: 11px;
    word-wrap: break-word;
    pointer-events: none;
    font-family: "Pixelated MS Sans Serif", Arial;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Window z-index management */
.window {
    background: silver;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px grey, inset 2px 2px #fff;
    padding: 3px;
    position: absolute;
    z-index: 1000;
    min-width: 200px;
    min-height: 150px;
}

/* Context Menu */
.context-menu {
    position: absolute;
    background: #c0c0c0;
    border: 2px solid;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 2px;
    z-index: 10000;
    min-width: 150px;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-family: "Pixelated MS Sans Serif", Arial;
    font-size: 11px;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.context-menu li {
    padding: 4px 20px 4px 8px;
    cursor: pointer;
    font-size: 11px;
    font-family: "Pixelated MS Sans Serif", Arial;
    position: relative;
    color: #000;
}

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

.context-menu li[style*="background"] {
    background: #808080 !important;
    height: 1px;
    padding: 0;
    margin: 4px 0;
    cursor: default;
}

/* Add window maximize/minimize functionality */
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - 28px) !important;
    resize: none !important;
}

.window.minimized {
    display: none;
}

/* Add window focus styles */
.window:focus {
    z-index: 1000;
}

.window:not(:focus) .title-bar {
    background: linear-gradient(90deg, grey, #b5b5b5);
}

.window:not(:focus) .title-bar-text {
    color: #c0c0c0;
}

/* Taskbar items for minimized windows */
.taskbar-item {
    display: inline-block;
    margin: 0 2px;
}

.taskbar-item button {
    background: #c0c0c0;
    border: 1px solid;
    border-top-color: #ffffff;
    border-left-color: #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 2px 8px;
    font-size: 11px;
    font-family: "Pixelated MS Sans Serif", Arial;
    cursor: pointer;
    min-width: 80px;
    color: #000;
}

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

.taskbar-item button:active {
    border-top-color: #808080;
    border-left-color: #808080;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}

/* Window focus styles */
.window.focused {
    z-index: 2000;
}

.window.focused .title-bar {
    background: linear-gradient(90deg, navy, #1084d0);
}

.window.focused .title-bar-text {
    color: #fff;
}

/* Remove duplicate styles that were causing conflicts */
.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    margin: 20px;
    text-align: center;
    color: white;
    cursor: pointer;
    position: relative;
}

.desktop-icon.selected {
    background: #000080;
    color: white;
}

.desktop-icon.selected span {
    background: #000080;
    color: white;
}

.desktop-icon img, .desktop-icon i {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

.desktop-icon span {
    background-color: transparent;
    padding: 2px 4px;
    font-size: 11px;
    word-wrap: break-word;
}

/* Screensaver */
#screensaver {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100000;
    color: #fff;
    display: none; /* Hidden by default */
    overflow: hidden;
}

#scrolling-text {
    position: absolute;
    font-size: 3em;
    white-space: nowrap;
    animation: scroll-text 20s linear infinite;
}

@keyframes scroll-text {
    0% {
        transform: translateX(100vw);
    }
    100% {
        transform: translateX(-100%);
    }
}

#starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive fixes */
@media (max-width: 640px) {
    .loading-bar {
        width: 300px;
    }

    .loading-text {
        font-size: 20px;
    }

    .desktop-icon {
        width: 60px;
        margin: 15px;
    }

    .desktop-icon img, .desktop-icon i {
        width: 24px;
        height: 24px;
        font-size: 20px;
    }

    .desktop-icon span {
        font-size: 9px;
        padding: 1px 2px;
    }
}