@import url('https://fonts.googleapis.com/css2?family=Tahoma:wght@400;700&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
    --xp-blue: #245edb;
    --xp-blue-light: #3d6fe8;
    --xp-blue-dark: #1a47b8;
    --xp-green: #3a6e1f;
    --xp-taskbar-h: 40px;
    --xp-start-green: #3d9e1f;
    --xp-start-green-d: #2e7a14;
    --font: 'Tahoma', 'MS Sans Serif', sans-serif;
}

/* ─── Base ──────────────────────────────────────────────── */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    font-size: 11px;
    cursor: default;
    user-select: none;
}

/* ─── BLISS WALLPAPER (real photo) ──────────────────────── */
#desktop {
    position: fixed;
    inset: 0;
    bottom: var(--xp-taskbar-h);
    background-image: url('https://cdn.wallpaperhub.app/cloudcache/9/8/1/e/8/e/981e8e91f90c93bf5e715527e1922724645f1214.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #4a9edc;
    overflow: hidden;
}

/* ─── DESKTOP ICONS ─────────────────────────────────────── */
.icon-grid {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 76px;
    padding: 4px 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
}

.icon:hover {
    background: rgba(49, 106, 197, 0.35);
}

.icon.selected {
    background: rgba(49, 106, 197, 0.55);
    outline: 1px dotted rgba(255, 255, 255, 0.8);
}

/* XP folder SVG icon */
.icon-img {
    width: 48px;
    height: 48px;
    position: relative;
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.4));
    flex-shrink: 0;
}

.icon-label {
    margin-top: 4px;
    color: #fff;
    font-size: 11px;
    text-align: center;
    line-height: 1.3;
    text-shadow:
        1px 1px 2px #000,
        -1px -1px 2px #000,
        1px -1px 2px #000,
        -1px 1px 2px #000;
    max-width: 72px;
    word-break: break-word;
}

.icon.selected .icon-label {
    background: rgba(49, 106, 197, 0.8);
    outline: 1px dotted rgba(255, 255, 255, 0.7);
}

/* double-click ripple */
.icon.opening {
    animation: iconOpen 0.35s ease forwards;
}

@keyframes iconOpen {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    40% {
        transform: scale(1.15);
        opacity: 0.9;
    }

    100% {
        transform: scale(0.85);
        opacity: 0;
    }
}

/* ─── TASKBAR ───────────────────────────────────────────── */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--xp-taskbar-h);
    background: linear-gradient(180deg,
            #2f5dbd 0%, #3668d0 8%, #2a59c8 16%,
            #1e4dbf 24%, #1a47b8 36%,
            #1840aa 52%, #1640a8 65%,
            #1a4ab0 78%, #2358c0 90%, #2a5ecb 100%);
    border-top: 1px solid #1230a0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 -1px 3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: stretch;
    z-index: 1000;
}

/* START BUTTON */
#start-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px 0 6px;
    margin: 2px 4px 2px 2px;
    background: linear-gradient(180deg,
            #4dc42a 0%, #42b820 18%,
            #3aac16 35%, #33a00f 50%,
            #2e9a0a 65%, #2b9508 80%, #2e9a0a 100%);
    border: 1px solid #1a6608;
    border-radius: 12px;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25),
        0 1px 3px rgba(0, 0, 0, 0.5);
    transition: filter 0.1s;
    font-size: 13px;
    font-weight: bold;
    font-style: italic;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
    font-family: var(--font);
    white-space: nowrap;
}

#start-btn:hover {
    filter: brightness(1.12);
}

#start-btn:active {
    filter: brightness(0.9);
}

.start-logo {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* QUICK LAUNCH */
#quick-launch {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 1px solid rgba(0, 0, 0, 0.3);
}

.ql-icon {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.1s;
}

.ql-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ACTIVE AREA */
#active-area {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 2px;
}

/* SYSTEM TRAY */
#systray {
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
    background: linear-gradient(180deg,
            #1238a8 0%, #0e2e94 30%,
            #0c2a8c 50%, #0e2e94 70%, #1238a8 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 1px 0 2px rgba(0, 0, 0, 0.3);
}

.tray-icon {
    opacity: 0.85;
    cursor: default;
}

.tray-icon:hover {
    opacity: 1;
}

#clock {
    color: #fff;
    font-size: 11px;
    text-align: center;
    padding: 2px 8px;
    cursor: default;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    line-height: 1.4;
}

/* ─── DOUBLE-CLICK HINT ──────────────────────────────────── */
#hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    animation: hintPulse 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 5;
}

@keyframes hintPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* ─── LOADING OVERLAY ────────────────────────────────────── */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    animation: bootFadeOut 0.8s ease 1.8s forwards;
}

@keyframes bootFadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

.boot-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: bootFadeIn 0.6s ease 0.3s both;
}

@keyframes bootFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.boot-windows-flag {
    width: 72px;
    height: 72px;
}

.boot-title {
    font-size: 28px;
    font-weight: normal;
    color: #fff;
    font-family: var(--font);
    letter-spacing: -0.5px;
}

.boot-title span {
    color: #5ba8f5;
    font-weight: bold;
}

.boot-bar-wrap {
    width: 220px;
    height: 16px;
    background: #111;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    animation: bootFadeIn 0.4s ease 0.8s both;
}

.boot-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #1a5aca, #4d8fe0, #1a5aca);
    background-size: 200% 100%;
    animation: bootBarMove 0.9s linear 0.9s forwards;
    width: 0;
    border-radius: 8px;
}

@keyframes bootBarMove {
    0% {
        width: 0%;
        background-position: 0% 0;
    }

    100% {
        width: 100%;
        background-position: 100% 0;
    }
}

/* ─── DESKTOP FADE IN ────────────────────────────────────── */
#desktop,
#taskbar {
    animation: desktopAppear 0.6s ease 2.4s both;
    opacity: 0;
}

@keyframes desktopAppear {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ─── EXPLORER WINDOW ───────────────────────────────────────*/
#explorer-window {
    position: fixed;
    top: 40px;
    left: 80px;
    width: 860px;
    height: 580px;
    min-width: 480px;
    min-height: 280px;
    display: none;
    flex-direction: column;
    border: 1px solid #00007a;
    border-radius: 6px 6px 3px 3px;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    z-index: 500;
    overflow: hidden;
    background: #ece9d8;
}

#explorer-window.open {
    display: flex;
}

#explorer-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% - var(--xp-taskbar-h)) !important;
    border-radius: 0;
}

#explorer-window.minimized {
    display: none;
}

/* XP Title bar */
#exp-titlebar {
    height: 28px;
    background: linear-gradient(180deg,
            #4d9de8 0%, #4592e0 6%, #2d7fd8 15%, #1a6bcf 30%,
            #1460c8 50%, #1258c0 65%, #1460c8 80%, #2070d0 95%, #2878d8 100%);
    border-radius: 5px 5px 0 0;
    display: flex;
    align-items: center;
    padding: 0 4px 0 6px;
    gap: 5px;
    cursor: default;
    flex-shrink: 0;
    position: relative;
}

#exp-titlebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: 5px 5px 0 0;
    pointer-events: none;
}

#exp-titlebar .exp-title-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

#exp-titlebar .exp-title-text {
    flex: 1;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exp-win-btn {
    width: 21px;
    height: 21px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 60, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: filter 0.1s;
}

.exp-win-btn:hover {
    filter: brightness(1.18);
}

.exp-win-btn:active {
    filter: brightness(0.85);
}

#exp-btn-min {
    background: linear-gradient(180deg, #4eacf8 0%, #3890e0 40%, #2878d0 100%);
}

#exp-btn-max {
    background: linear-gradient(180deg, #4eacf8 0%, #3890e0 40%, #2878d0 100%);
}

#exp-btn-close {
    background: linear-gradient(180deg, #f87070 0%, #e84040 40%, #d02020 100%);
}

/* iframe fills the rest */
#explorer-iframe {
    flex: 1;
    border: none;
    display: block;
    width: 100%;
    background: #ece9d8;
}

/* Resize handle */
#exp-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: se-resize;
    z-index: 10;
}

/* Taskbar button for explorer */
.taskbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    height: 26px;
    background: linear-gradient(180deg, #2a5abf 0%, #1a3fa0 100%);
    border: 1px solid #0a246a;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.2);
    transition: filter 0.1s;
}

.taskbar-btn:hover {
    filter: brightness(1.15);
}

.taskbar-btn.active {
    background: linear-gradient(180deg, #1a3a90 0%, #0e2878 100%);
    border-color: #06185a;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.4);
}

/* ─── START MENU ─────────────────────────────────────────── */
#start-menu {
    position: fixed;
    bottom: var(--xp-taskbar-h);
    left: 0;
    width: 340px;
    background: #fff;
    border: 1px solid #0a246a;
    border-radius: 8px 8px 0 0;
    box-shadow: 3px -3px 12px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    overflow: hidden;
    font-family: var(--font);
    animation: menuSlideUp 0.15s ease;
}

#start-menu.open {
    display: block;
}

@keyframes menuSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header band */
.sm-header {
    background: linear-gradient(90deg, #1a5fc8 0%, #3a82e0 60%, #5aaaf8 100%);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 6px 6px 0 0;
}

.sm-avatar {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, #90caf9, #1565c0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sm-username {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Two-column body */
.sm-body {
    display: flex;
    min-height: 260px;
}

.sm-left {
    flex: 1;
    background: #fff;
    padding: 6px 0;
    border-right: 1px solid #d0d8e8;
}

.sm-right {
    width: 130px;
    background: #d6e4f7;
    padding: 6px 0;
}

/* Menu items */
.sm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 12px;
    color: #000;
    white-space: nowrap;
    border-radius: 0;
    transition: background 0.1s;
}

.sm-item:hover {
    background: linear-gradient(90deg, #2657c8, #4a80e0);
    color: #fff;
}

.sm-item:hover .sm-item-icon path,
.sm-item:hover .sm-item-icon rect,
.sm-item:hover .sm-item-icon circle,
.sm-item:hover .sm-item-icon polygon {
    fill: #fff !important;
    stroke: #fff !important;
}

.sm-item-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.sm-item-text {
    line-height: 1.3;
}

.sm-item-title {
    font-weight: bold;
    font-size: 12px;
}

.sm-item-sub {
    font-size: 10px;
    color: #666;
}

.sm-item:hover .sm-item-sub {
    color: rgba(255, 255, 255, 0.8);
}

.sm-divider {
    height: 1px;
    margin: 4px 0;
    background: linear-gradient(90deg, transparent, #b0bcd0, transparent);
}

.sm-right-label {
    font-size: 10px;
    font-weight: bold;
    color: #1a4a90;
    padding: 6px 12px 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.sm-footer {
    background: linear-gradient(90deg, #1a5fc8, #3a82e0);
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    padding: 5px 8px;
    border-top: 1px solid #0a3a9a;
}

.sm-footer-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: linear-gradient(180deg, #3a70d0, #1a50b8);
    border: 1px solid #0a3090;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-family: var(--font);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: filter 0.1s;
}

.sm-footer-btn:hover {
    filter: brightness(1.15);
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .icon-grid {
        gap: 4px;
    }

    .icon {
        width: 64px;
    }

    .icon-img {
        width: 40px;
        height: 40px;
    }

    .icon-label {
        font-size: 10px;
    }

    #start-btn {
        font-size: 12px;
        padding: 0 8px 0 5px;
    }
}

@media (max-width: 400px) {
    .start-logo {
        width: 18px;
        height: 18px;
    }

    #start-btn {
        font-size: 11px;
    }
}