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

* {
    box-sizing: border-box;
    font-family: 'Tahoma', sans-serif;
    user-select: none;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #004e98;
    /* Bliss-like wallpaper fallback */
    background: url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?q=80&w=2000&auto=format&fit=crop') no-repeat center center fixed;
    background-size: cover;
    cursor: url('https://win98icons.alexmeub.com/cursors/arrow.cur'), default;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.04) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 3px, 3px 100%;
    z-index: 99999;
    pointer-events: none;
}

#desktop {
    position: relative;
    width: 100%;
    height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 10px;
    gap: 15px;
}

.desktop-icon {
    width: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: url('https://win98icons.alexmeub.com/cursors/pointer.cur'), pointer;
    margin-bottom: 10px;
    transition: transform 0.1s ease-in-out;
}

.desktop-icon:hover {
    transform: scale(1.05);
}

.desktop-icon img {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
}

.desktop-icon span {
    color: white;
    font-size: 11px;
    text-align: center;
    text-shadow: 1px 1px 2px black;
    padding: 2px;
    border: 1px transparent dotted;
}

.desktop-icon:hover span {
    background-color: rgba(0, 0, 128, 0.4);
}

.desktop-icon.selected span {
    background-color: #0b61ff;
    border-color: #ffffff;
}

/* Taskbar */
#taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to bottom, #245edb 0%, #3f8cf3 9%, #245edb 18%, #245edb 92%, #333 100%);
    display: flex;
    align-items: center;
    z-index: 10000;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.3);
}

#start-button {
    height: 100%;
    background: linear-gradient(to bottom, #349e49 0%, #46ba5b 10%, #349e49 20%, #208735 100%);
    color: white;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    padding: 0 15px 0 10px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    cursor: pointer;
    box-shadow: inset 1px 1px 1px rgba(255,255,255,0.5), inset -1px -1px 1px rgba(0,0,0,0.4);
}

#start-button:hover {
    background: linear-gradient(to bottom, #42ad57 0%, #54c969 10%, #42ad57 20%, #29963f 100%);
}

#start-button:active {
    background: linear-gradient(to bottom, #208735 0%, #349e49 100%);
    box-shadow: inset 2px 2px 3px rgba(0,0,0,0.4);
}

.win-logo {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.5));
}

#taskbar-tasks {
    flex-grow: 1;
    display: flex;
    align-items: center;
    padding: 0 5px;
    gap: 3px;
    overflow-x: auto;
}

.taskbar-item {
    background: linear-gradient(to bottom, #3b74db 0%, #4c8bed 10%, #3b74db 20%, #2b5eb8 100%);
    color: white;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 3px;
    border: 1px solid #14408a;
    box-shadow: inset 1px 1px 1px rgba(255,255,255,0.3);
    min-width: 100px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: url('https://win98icons.alexmeub.com/cursors/pointer.cur'), pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

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

.taskbar-item.active {
    background: linear-gradient(to bottom, #1f4f9e 0%, #2860b8 10%, #1f4f9e 20%, #153975 100%);
    box-shadow: inset 2px 2px 3px rgba(0,0,0,0.4);
}

#taskbar-tray {
    background: linear-gradient(to bottom, #1197d1 0%, #13a6e6 10%, #1197d1 20%, #0c73a1 100%);
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: white;
    font-size: 11px;
    border-left: 1px solid #084c6b;
    box-shadow: inset 1px 0 1px rgba(255,255,255,0.3);
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 300px;
    background: #ffffff;
    border: 1px solid #0055e5;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    box-shadow: 2px -2px 5px rgba(0,0,0,0.4);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

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

.start-menu-banner {
    background: linear-gradient(to bottom, #1e52b5 0%, #2f6de5 100%);
    color: white;
    padding: 10px;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.start-menu-banner img {
    width: 32px;
    height: 32px;
    border: 2px solid white;
    border-radius: 3px;
    margin-right: 10px;
}

.start-menu-items {
    padding: 5px;
    display: flex;
    flex-direction: column;
}

.start-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: url('https://win98icons.alexmeub.com/cursors/pointer.cur'), pointer;
}

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

.start-item:hover span, .start-item:hover strong {
    color: white !important;
}

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

.start-item-text {
    display: flex;
    flex-direction: column;
}

.start-item-text strong {
    font-size: 11px;
}

.start-item-text span {
    font-size: 10px;
    color: #666;
}

.start-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, #ccc 10%, #ccc 90%, transparent);
    margin: 5px 0;
}

.start-menu-bottom {
    background: linear-gradient(to bottom, #e2edfb 0%, #c4dcf8 100%);
    padding: 10px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #95bcee;
}

.start-menu-bottom .start-item {
    padding: 2px 5px;
}

.start-menu-bottom span {
    font-size: 11px;
    color: black;
}

/* Windows */
.window {
    position: absolute;
    width: 400px;
    min-height: 200px;
    background: #ece9d8;
    border: 1px solid #0053e5;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.window.active {
    z-index: 1000 !important;
}

.title-bar {
    background: linear-gradient(to bottom, #0058e6 0%, #3a93ff 8%, #288eff 40%, #127dff 88%, #0366e8 100%);
    color: white;
    padding: 3px 3px 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    cursor: default;
    user-select: none;
}

.window.active .title-bar {
    background: linear-gradient(to bottom, #0058e6 0%, #3a93ff 8%, #288eff 40%, #127dff 88%, #0366e8 100%);
}

.window:not(.active) .title-bar {
    background: linear-gradient(to bottom, #7697e7 0%, #7e9ee3 8%, #94b2ec 40%, #7697e7 88%, #5b7ed6 100%);
}

.title-bar-text {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px #0f1089;
    letter-spacing: 0.5px;
}

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

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-controls button {
    width: 21px;
    height: 21px;
    border: 1px solid white;
    border-radius: 3px;
    background-color: #0058e6;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset 1px 1px 2px rgba(255,255,255,0.8), inset -1px -1px 2px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.title-bar-controls button:active {
    box-shadow: inset 2px 2px 3px rgba(0,0,0,0.6);
}

.btn-minimize::before { content: "—"; position: relative; top: 4px; font-weight: bold; }
.btn-maximize::before { content: "☐"; font-size: 14px; }
.btn-close { background: linear-gradient(to bottom, #e04343 0%, #c92b2b 100%) !important; }
.btn-close::before { content: "✕"; font-size: 12px; }
.btn-close:hover { background: linear-gradient(to bottom, #f25555 0%, #d83a3a 100%) !important; }

.window-content {
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
    font-size: 12px;
    background: white;
    border: 1px solid #7f9db9;
    margin: 2px;
}

/* Projects Explorer Style */
.explorer-toolbar {
    background: #ece9d8;
    padding: 5px;
    border-bottom: 1px solid #ccc;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 11px;
}

.explorer-toolbar select {
    font-size: 11px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
}

.project-item {
    display: flex;
    align-items: flex-start;
    padding: 5px;
    border: 1px solid transparent;
    cursor: pointer;
}

.project-item:hover {
    background-color: #f3f8fd;
    border-color: #b8d6fb;
}

.project-item img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.project-details {
    display: flex;
    flex-direction: column;
}

.project-name {
    font-weight: bold;
    color: #000;
}

.project-desc {
    color: #666;
    font-size: 10px;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-badge {
    background: #ffd700;
    color: #000;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: bold;
    border: 1px solid #c9aa00;
}

.content-inner {
    padding: 10px;
}

a {
    color: #0000ff;
    text-decoration: underline;
    cursor: url('https://win98icons.alexmeub.com/cursors/pointer.cur'), pointer;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .window {
        width: 95vw !important;
        /* Center roughly */
        left: 2.5vw !important;
    }
    
    #start-menu {
        width: 95vw;
    }
    
    .desktop-icon {
        width: 60px;
        margin-bottom: 5px;
    }
    
    .desktop-icon img {
        width: 28px;
        height: 28px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }
}
