@import url('https://fonts.googleapis.com/css2?family=Science+Gothic:wght@100..900&display=swap');

[v-cloak] {display: none;}
body {margin: 0; padding: 0; overflow: hidden;}
* {font-family: 'Science Gothic', Arial, sans-serif;}

:root {
    --taskbar-height: 35px;
    --taskbar-window-list-width: 150px;
    --titlebar-height: 30px;
    --taskbar-hover-color: #444;
    --taskbar-app-width: 30px;
}


/* Windows */
#windowManager {
    width: 0;
    height: 0;
}

.window {
    position: fixed;
    border: 2px solid #000;
    background-color: #fff;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    overflow: hidden;
    box-sizing: border-box;
    z-index: 1;
}

.window iframe {
    position: absolute;
    top: var(--titlebar-height);
    left: 0;
    width: 100%;
    height: calc(100% - var(--titlebar-height));
    border: none;
    display: block;
}

.window #titlebar {
    background-color: #333;
    color: #fff;
    padding: 5px;
    height: 20px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window #titlebar img {
    max-width: 100%;
    max-height: calc(var(--titlebar-height) - 10px);
    width: auto;
    height: auto;
    display: block;
}

.window #titlebar h2 {
    font-weight: bold;
    margin: 0;
    margin-left: 5px;
}

#windowButtons {
    display: flex;
    gap: 5px;
    margin-right: 5px;
}

#windowButtons button {
    cursor: pointer;
    padding: 2px 8px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 2px;
}

#windowButtons .close {
    background-color: #eb3030;
    border: none;
    color: white;
}

#windowButtons .minimize {
    background-color: #f2d024;
    border: none;
    color: white;
}

.opening {
    animation: fade;
    animation-delay: 0.1s;
    animation-duration: 0.2s;
    animation-direction: reverse;
    animation-fill-mode: forwards;
    animation-timing-function: steps(2);
}


.closing {
    animation: fade;
    animation-delay: 0.1s;
    animation-duration: 0.2s;
    animation-direction: normal;
    animation-fill-mode: forwards;
    animation-timing-function: steps(2);
}

.minimizing {
    animation: shrink;
    animation-delay: 0.1s;
    animation-duration: 0.2s;
    animation-direction: normal;
    animation-fill-mode: forwards;
    animation-timing-function: linear;
}

.unminimizing {
    animation: shrink-reverse;
    animation-duration: 0.2s;
    animation-direction: normal;
    animation-fill-mode: forwards;
    animation-timing-function: linear;
}

@keyframes shrink-reverse {
    from {
        transform: scale(0);
        opacity: 0;
        top: calc(100vh - var(--taskbar-height));
        left: calc(50vw - 200px);
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    right: 1px;
    bottom: 1px;
    cursor: se-resize;
    z-index: 10;

    /* AI generated triangle shape lol*/
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.25) 50%) no-repeat center/12px 12px;
}

@keyframes fade {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes shrink {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
        top: calc(100vh - var(--taskbar-height));
        left: calc(50vw - 200px);
    }
}


/* Taskbar */
#screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: #0780e3;
}

#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: var(--taskbar-height);
    padding: 0;
    background-color: #222;
    z-index: 10;

    display: flex;
    justify-content: space-between;
}

#taskbar > div {
    display: flex;
    align-items: center;
}


#search {
    display: flex;
    align-items: center;
    margin-left: 5px;
    height: var(--taskbar-height);
}

#linuxButton {
    margin-left: 5px;
    width: 45px;
    height: var(--taskbar-height);
    background-color: #00000000;
    background-image: url("./linux.png");
    background-size: 60% 75%;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    cursor: pointer;
    transition-duration: 0.3s;
}

#linuxButton:hover {
    background-color: var(--taskbar-hover-color);
}

#searchBox {
    margin: 0;
    width: 200px;
    padding-left: 10px;
    height: calc(var(--taskbar-height) * 0.95);
    background-color: #333;
    border: none;
    color: #fff;
    font-size: 14px;
    outline: none;
    cursor: text;
    transition-duration: 0.3s;
}

#searchBox:hover {
    background-color: #444;
}

#searchBox:focus {
    background-color: #555;
}

#searchResults {
    position: fixed;
    bottom: var(--taskbar-height);
    left: 5px;
    width: 300px;
    max-height: 300px;
    background-color: #333;
    border: 2px solid #000;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    overflow-y: auto;
    z-index: 99999;
}

#searchResults .appCategory {
    margin-bottom: 12px;
    padding: 8px 0 0 0;
    border-top: 2px solid #444;
}

#searchResults .categoryTitle {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 5px 0;
    padding-left: 5px;
    letter-spacing: 0.5px;
}

#searchResults .appCategory .app {
    background: #222;
    color: #ccc;
    margin: 3px 8px 3px 16px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition-duration: 0.2s;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
}
#searchResults .appCategory .app img {
    max-width:30px;
    max-height:100%;
    width:auto;
    height:auto;
    display:block;
}

#searchResults .appCategory .app:hover {
    background: var(--taskbar-hover-color);
    color: #fff;
}

#searchResults p {
    margin: 8px 0;
    font-size: 14px;
    text-align: left;
}

#searchResults .noResults {
    color: #eb3030;
    font-weight: bold;
    text-align: center;
    padding: 20px 0;
    font-size: 15px;
}



/* taskbar apps list */

#appList {
    height: var(--taskbar-height);
    padding: 0 5px;
    display: flex;
    align-items: center;
}

#appList > div > .appIcon {
    color: #ccc;
    height: var(--taskbar-height);
    width: var(--taskbar-app-width);
    text-align: center;
    text-overflow: ellipsis;
    padding: 0 7px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition-duration: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#appList > div > .appIcon > img {
    vertical-align: middle;
    max-width:100%;
    max-height:100%;
    width:auto;
    height:auto;
}

#appList > div > .appIcon.open {
    height: calc(var(--taskbar-height) - 3.5px);
    border-bottom: 3.5px solid #fff;
    color: #fff;
}

#appList > div > .appIcon:hover {
    background-color: var(--taskbar-hover-color);
    color: #fff;
}

.windowList {
    position: fixed;
    bottom: var(--taskbar-height);
    z-index: 99999;
}

.windowListItem {
    margin: 0;
    padding: 0;
    transform: translateX(5px);
    height: 23px;
    width: var(--taskbar-window-list-width);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.windowListItem > p {
    margin: 0;
    padding: 2px 5px;
    color: #fff;
    font-size: 12px;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.windowListItem:hover {
    background-color: var(--taskbar-hover-color);
}

.windowListItem > button {
    margin-right: 2px;
    padding: 2px 5px;
    height: 20px;
    border: none;
    background-color: #eb3030;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: center;
    align-items: center;
}




/* left section of taskbar */

#timeDisplay {
    height: var(--taskbar-height);
    padding: 0 7px;
    color: #777;
    font-size: 14px;
    user-select: none;
    transition-duration: 0.3s;
    display: flex;
    align-items: center;
}

#timeDisplay:hover {
    background-color: var(--taskbar-hover-color);
}