/* Windows 98 Main Styles */
@import url('https://fonts.googleapis.com/css2?family=Courier+New&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', 'Courier New', 'MS Sans Serif', sans-serif;
    font-size: 11px;
    background: #008080;
    overflow: hidden;
    cursor: default;
    user-select: none;
}

/* Desktop */
#desktop {
    width: 100vw;
    height: 100vh;
    background: #008080 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==') repeat;
    position: relative;
}

/* Desktop Icons */
.desktop-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 64px;
    padding: 4px;
    cursor: pointer;
    border-radius: 2px;
}

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

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

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

.desktop-icon span {
    font-size: 11px;
    text-align: center;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    line-height: 1.2;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: #c0c0c0;
    border-top: 1px solid #dfdfdf;
    display: flex;
    align-items: center;
    z-index: 1000;
}

.start-button {
    height: 22px;
    padding: 2px 6px;
    margin: 3px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-family: 'Courier New', 'MS Sans Serif', sans-serif;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.start-button:active {
    border: 1px inset #c0c0c0;
}

.start-button img {
    width: 16px;
    height: 16px;
}

#taskbar-buttons {
    flex: 1;
    display: flex;
    gap: 2px;
    margin-left: 4px;
}

.taskbar-button {
    height: 22px;
    padding: 2px 8px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    font-family: 'Courier New', 'MS Sans Serif', sans-serif;
    font-size: 11px;
    cursor: pointer;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-button:active,
.taskbar-button.active {
    border: 1px inset #c0c0c0;
}

#system-tray {
    margin-right: 4px;
    padding: 2px 6px;
    border: 1px inset #c0c0c0;
    background: #c0c0c0;
}

#clock {
    font-size: 11px;
    font-family: 'Courier New', 'MS Sans Serif', sans-serif;
}

/* Start Menu */
.start-menu {
    position: fixed;
    bottom: 28px;
    left: 0;
    width: 200px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    z-index: 1001;
}

.start-menu-header {
    background: linear-gradient(90deg, #0000ff 0%, #008080 100%);
    color: white;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 12px;
}

.start-menu-items {
    padding: 2px 0;
}

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

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

.start-menu-item img {
    width: 16px;
    height: 16px;
}

.start-menu-item .arrow {
    margin-left: auto;
    font-size: 8px;
}

.start-menu-separator {
    height: 1px;
    background: #808080;
    margin: 2px 8px;
    border-bottom: 1px solid #ffffff;
}

/* Submenus */
.submenu {
    position: fixed;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    z-index: 1002;
    min-width: 150px;
    padding: 2px 0;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Blue Screen of Death */
.bsod {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0000aa;
    color: white;
    font-family: 'Courier New', monospace;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bsod-content {
    text-align: left;
    line-height: 1.4;
}

.bsod-content h1 {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.bsod-content p {
    font-size: 14px;
    margin-bottom: 10px;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px inset #c0c0c0;
}

::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

::-webkit-scrollbar-corner {
    background: #c0c0c0;
}

/* Selection */
::selection {
    background: #316AC5;
    color: white;
}

::-moz-selection {
    background: #316AC5;
    color: white;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    /* Adjust desktop icons for mobile */
    .desktop-icons {
        gap: 15px;
    }
    
    .desktop-icon {
        width: 56px;
        padding: 3px;
    }
    
    .desktop-icon img {
        width: 28px;
        height: 28px;
    }
    
    .desktop-icon span {
        font-size: 10px;
    }
    
    /* Improve touch targets */
    .start-button {
        height: 26px;
        padding: 3px 8px;
        font-size: 12px;
    }
    
    .taskbar-button {
        height: 26px;
        padding: 3px 10px;
        font-size: 10px;
        min-width: 80px;
    }
    
    /* Start menu adjustments */
    .start-menu {
        width: 180px;
    }
    
    .start-menu-item {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    /* Submenu positioning */
    .submenu {
        min-width: 140px;
    }
    
    /* System tray */
    #system-tray {
        padding: 2px 4px;
    }
    
    #clock {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .desktop-icon {
        width: 48px;
    }
    
    .desktop-icon img {
        width: 24px;
        height: 24px;
    }
    
    .desktop-icon span {
        font-size: 9px;
    }
    
    .start-menu {
        width: 160px;
    }
    
    .start-menu-item {
        padding: 5px 6px;
        font-size: 11px;
    }
    
    .taskbar-button {
        max-width: 100px;
        min-width: 60px;
        padding: 2px 6px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Touch devices */
    .desktop-icon:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .start-menu-item:hover {
        background: #316AC5;
    }
    
    .taskbar-button:hover {
        background: #d0d0d0;
    }
    
    /* Prevent text selection on touch */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Allow text selection in input fields */
    input, textarea {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}