/* ===== GLOBAL ===== */
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    overflow: hidden;

    background-image: url("../images/windows-11-blue-stock-white-background-light-official-3840x2400-5616.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===== DESKTOP ===== */
#desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* ===== TASKBAR (Windows 11 style) ===== */
#taskbar {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);

    height: 50px;
    width: 90%;
    max-width: 900px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.3);

    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* ===== START BUTTON ===== */
#start-button {
    position: absolute;
    left: 15px;

    font-size: 18px;
    cursor: pointer;

    padding: 6px 10px;
    border-radius: 8px;

    transition: background 0.2s;
}

#start-button:hover {
    background: rgba(255,255,255,0.4);
}

/* ===== TASKBAR APPS ===== */
#taskbar-apps {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.taskbar-app {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    border: none;

    background: transparent;
    font-size: 18px;

    cursor: pointer;
    transition: all 0.2s ease;
}

.taskbar-app:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
}

.taskbar-app.active {
    background: rgba(255,255,255,0.6);
}

/* Notification count */
.taskbar-app .count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: red;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== SYSTEM TRAY ===== */
#system-tray {
    position: absolute;
    right: 10px;
    display: flex;
    align-items: center;
}

/* Clock */
#clock {
    font-size: 13px;
    color: #222;
}

/* ===== DESKTOP ICONS ===== */
#desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;

    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    gap: 20px;
}

.icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    user-select: none;

    transition: transform 0.2s;
}

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

.icon-emoji {
    font-size: 48px;
    margin-bottom: 5px;
}

.icon span {
    text-align: center;
    font-size: 12px;
    color: white;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* ===== START MENU ===== */
#start-menu {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);

    width: 300px;

    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(25px);

    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.3);

    box-shadow: 0 10px 40px rgba(0,0,0,0.2);

    padding: 10px;
    z-index: 1000;
}

.start-menu-item {
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;

    transition: background 0.2s;
}

.start-menu-item:hover {
    background: rgba(0,0,0,0.05);
}

/* ===== WINDOWS ===== */
.window {
    position: absolute;

    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.4);

    box-shadow: 0 10px 40px rgba(0,0,0,0.2);

    overflow: hidden;
    z-index: 10;
}

/* Header */
.window-header {
    background: transparent;
    color: #222;

    padding: 8px 12px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    cursor: move;
    font-size: 14px;
    font-weight: 500;
}

/* Controls */
.window-controls {
    display: flex;
}

.window-control {
    width: 32px;
    height: 28px;

    border-radius: 6px;
    border: none;
    background: transparent;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    color: #333;

    cursor: pointer;
    transition: background 0.2s;
}

.window-control.minimize::before {
    content: "—";
}

.window-control.maximize::before {
    content: "□";
}

.window-control.close::before {
    content: "✕";
}

.window-control:hover {
    background: rgba(0,0,0,0.1);
}

.window-control.close:hover {
    background: #e81123;
    color: white;
}

/* Content */
.window-content {
    padding: 10px;
    height: calc(100% - 40px);
    overflow: auto;
}

/* States */
.window.minimized {
    display: none;
}

.window.maximized {
    width: 100vw !important;
    height: calc(100vh - 60px) !important;
    top: 0 !important;
    left: 0 !important;
    border-radius: 0 !important;
}

/* ===== WINDOW LIST POPUP ===== */
#window-list-popup {
    position: absolute;

    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);

    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.3);

    box-shadow: 0 10px 30px rgba(0,0,0,0.2);

    display: flex;
    z-index: 1001;
}

.window-list-item {
    padding: 8px 16px;
    cursor: pointer;
    white-space: nowrap;

    transition: background 0.2s;
}

.window-list-item:hover {
    background: rgba(0,0,0,0.05);
}

/* ===== UTILITY ===== */
.hidden {
    display: none;
}
/* ===== TASKBAR HOVER PREVIEW ===== */
#window-list-popup {
    position: absolute;
    bottom: 60px;

    display: flex;
    gap: 10px;
    padding: 10px;

    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(20px);

    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);

    z-index: 1001;
}

/* Each preview */
.window-preview-item {
    width: 150px;
    height: 90px;

    background: rgba(255,255,255,0.6);
    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.window-preview-item:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.9);
}

.preview-title {
    font-size: 12px;
    color: #222;
    text-align: center;
}
#window-list-popup {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.2s ease;
}
#window-list-popup::before {
    content: "";
    position: absolute;
    bottom: -20px; /* extends downward toward taskbar */
    left: 0;
    width: 100%;
    height: 20px;

    /* invisible but still hoverable */
    background: transparent;
}
#window-list-popup:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}