:root {
    --glass-sheen: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05) 30%);
    --glass-tint: rgba(20, 45, 75, 0.32);
    --glass-blur: blur(12px);
}

body {
    margin: 0;
}


/* Desktop Styling */
/* _________________________________________________________________ */

.desktop > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.desktop-space {
    position: fixed;
    inset: 0 0 45px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, 80px);
    grid-template-rows: repeat(auto-fill, 90px);
    grid-auto-flow: column;
    gap: 10px;
    padding: 12px;
    pointer-events: none; /* empty cells don't block clicks on the desktop */
}

.desktop-icon {
    box-sizing: border-box;
    width: 76px;
    height: 76px;
    padding: 6px;
    justify-self: center;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 3px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

.desktop-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
}

.desktop-icon.selected {
    background: rgba(120, 180, 255, 0.35);
    border-color: rgba(190, 225, 255, 0.75);
}

.desktop-icon.dragging {
    position: relative;
    z-index: 10;
    opacity: 0.75;
}

.desktop-icon span {
    color: white;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    text-shadow: 1px 1px 2px black;
    max-width: 80px;
    overflow-wrap: anywhere;
}

/* Taskbar Styling */
/* _________________________________________________________________ */

.taskbar {
    position: fixed;
    z-index: 9000;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45px;

    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    box-sizing: border-box;

    background: var(--glass-sheen), var(--glass-tint);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
}

.taskbar-btn
{
    
    background: linear-gradient(
    to bottom,
    rgba(180, 210, 235, 0.35),
    rgba(80, 115, 155, 0.55),
    rgba(30, 55, 85, 0.75)
    );


    backdrop-filter: blur(12px);


    contain: content;

    cursor: pointer;

    margin: 3.5px;
    width: 40px;
    height: calc(100% - 4px);
    box-sizing: border-box;

    

}

.start-orb {
    background: none;
    backdrop-filter: none;
    width: 40px;
    height: calc(100% - 4px);
    box-sizing: border-box;

    
}

.start-orb:hover {
    filter: brightness(1.3) drop-shadow(0 0 6px rgba(120, 200, 255, 0.9));
}

.os-taskbar-btn {
    width: 58px;
    height: calc(100% - 6px);
    margin: 1 1px;
    padding: 3 3px;
    box-sizing: border-box;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.25),
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.12)
    );
}

.os-taskbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Browsers turn <image> tags into <img>, so the logo is styled as an img. */
.taskbar-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.taskbar button:hover {
    background: rgba(255, 255, 255, 0.3);
}


.taskbar-clock {
    margin-left: auto;
    height: calc(100% - 6px);
    min-width: 85px;
    padding: 0 8px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;

    color: white;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
    text-shadow: 0 1px 2px black;
    cursor: default;

    line-height: 1.25;
    border-radius: 3px;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.show-desktop {
    width: 14px;
    height: 100%;
    margin-right: -4px;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.show-desktop:hover {
    background: rgba(255, 255, 255, 0.25);
}

.taskbar-clock:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Start Menu Styling */
/* _________________________________________________________________ */

.start-menu {
    display: none;
    position: fixed;
    bottom: 45px;
    left: 0px;

    width: 400px;

    z-index: 9001; /* above the taskbar and every window, like Windows 7 */
    max-height: calc(100vh - 100px);
    box-sizing: border-box;
    padding: 6px;

    background: var(--glass-sheen), var(--glass-tint);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);

    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px 6px 0 0;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 14px rgba(0, 0, 0, 0.5);

    grid-template-columns: 250px 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;

    
}

.start-menu.open {
    display: grid;
}

.start-left,
.start-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.start-menu button {
    padding: 10px;
    color: white;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}

.start-menu button:hover {
    background: rgba(120, 180, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
}

.start-left {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    padding: 6px;
    gap: 2px;
}

.start-left button {
    color: #000;
    font: 12px "Segoe UI", Tahoma, sans-serif
}

.start-left button:hover {
    background: linear-gradient(to bottom, #f2f8fd, #dcebfc);
    border-color: #7da2ce;
}

.start-left button img {
    width: 32px;
    height: 32px;
    margin-right: 6px;
}

.start-right {
    padding: 8px 4px;
    gap: 2px;
}

.start-right button {
    font: 13px "Segoe UI", Tahoma, sans-serif;
    padding: 7px 10px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
}

.start-right button:hover {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.4);
}

.start-right hr {
    width: 100%;
    margin: 4px 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.start-bottom {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
    min-width: 0;
    box-sizing: border-box;
}

.start-bottom button {
    justify-self: start;
    margin-left: 6px;
    padding: 4px 16px;
    font: 12px "Segoe UI", Tahoma, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.35),
        rgba(255, 255, 255, 0.1) 50%,
        rgba(0, 0, 0, 0.15) 50%,
        rgba(0, 0, 0, 0.05)
    );
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Search results (index.js): replace the two columns while you type */
.start-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 0;
    overflow-y: auto;
}

.start-menu:not(.searching) .start-results,
.start-menu.searching .start-left,
.start-menu.searching .start-right {
    display: none;
}

.start-results-heading {
    padding: 6px 4px 2px;
    color: rgba(255, 255, 255, 0.8);
    font-family: Tahoma, sans-serif;
    font-size: 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.start-results button:first-of-type {
    background: rgba(120, 180, 255, 0.25); /* the one Enter opens */
}

/* Search bar container */
.search-box {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    height: 25px;
    padding: 0 8px;
    box-sizing: border-box;

    background: linear-gradient(
        to bottom,
        #fff,
        #edf5fc
    );

    border: 1px solid #7f9db9;
    border-radius: 3px;
}

/* Text input */
.search-box input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0 4px;
    box-sizing: border-box;

    border: none;
    outline: none;
    background: transparent;

    font-family: Tahoma, sans-serif;
    font-size: 12px;
}

/* Search icon */
.search-box span {
    flex-shrink: 0;
    margin-left: 6px;
    font-size: 13px;
}

/* Icons beside program names */
.start-menu button img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}

/* ---- Windows (made by makeWindow in index.js) ---- */

/* Window Styling */
/* _________________________________________________________________ */


.os-window {
    position: fixed;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 0 7px 7px;
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-radius: 8px 8px 4px 4px;
    background: var(--glass-sheen), var(--glass-tint);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 12px 32px rgba(0, 0, 0, 0.5);
    font: 12px "Segoe UI", Tahoma, sans-serif;
    animation: os-window-open 0.18s ease-out;
}

.os-window.os-minimised {
    display: none !important;
}
.os-window.os-maximised { border-radius: 0; }

@keyframes os-window-open {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes os-window-close {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.94); }
}

.os-window.os-closing {
    animation: os-window-close 0.15s ease-in forwards;
    pointer-events: none;
}

@keyframes os-window-minimise {
    to { opacity: 0; transform: translate(var(--min-x), var(--min-y)) scale(0.1); }
}

.os-window.os-minimising {
    animation: os-window-minimise 0.25s ease-in forwards;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .os-window,
    .os-window.os-closing,
    .os-window.os-minimising {
        animation-duration: 1ms;
    }
}

.os-titlebar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 150px 0 2px;
    user-select: none;
    touch-action: none;
}

.os-title-icon { width: 16px; height: 16px; object-fit: contain; }

.os-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 0 0 8px #fff, 0 0 8px #fff, 0 0 4px #fff;
}

.os-caption { position: absolute; top: -1px; right: 0; display: flex; }

.os-caption button {
    display: grid;
    place-items: center;
    height: 20px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.55);
    border-top: 0;
    border-left-width: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.2) 45%, rgba(0, 0, 0, 0.08) 50%, rgba(255, 255, 255, 0.25));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    cursor: pointer;
}

.os-caption button:first-child { border-left-width: 1px; border-bottom-left-radius: 4px; }
.os-caption button:last-child { border-bottom-right-radius: 4px; }
.os-caption svg { width: 10px; height: 10px; fill: #fff; filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
.os-min { width: 26px; }
.os-max { width: 27px; }
.os-min:hover, .os-max:hover { background: linear-gradient(#cfe7fa, #92c5ef 45%, #5ea7e6 50%, #a6d8f8); }
.os-close { width: 46px; background: linear-gradient(#e8a493, #d27b62 45%, #c4462a 50%, #d98b6c) !important; }
.os-close:hover { background: linear-gradient(#f5b9a8, #ec7a5a 45%, #e04a24 50%, #f39c78) !important; }

.os-window-body {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.45);
    background: #fff;
}

.os-window-message { padding: 24px; line-height: 1.5; color: #1e395b; }
.os-window-message b { font-size: 14px; }

.os-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    touch-action: none;
}

.os-maximised .os-resize { display: none; }

.os-taskbar-btn.active { box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.7); }
