@font-face {
    font-family: 'Material Symbols Rounded';
    font-style: normal;
    src: url(gfx/fonts/material-symbols-rounded.woff2) format('woff2');
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
      to { opacity: 1; }
}

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

@-webkit-keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;  /* Preferred icon size */
    display: inline-block;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
    word-wrap: normal;
    white-space: nowrap;
    direction: ltr;
}

body, html {
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
    background: #000;
}

hr {
    border: none;
    border-top: 1px solid #555;
    margin: 4px 8px;
    border-radius: 2px;
}

#desktop {
    position: fixed;
    width: 100vw;
    height: 100vh;
    background-color: #131313;
    overflow: hidden;
    border-radius: 12px;
}

#desktop-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('gfx/wallpapers/jm-moon.jpg'); /* wallpaper image */
    background-size: cover;
    background-repeat: no-repeat;
    background-position-x: center;
    background-position-y: center;
}

#desktop-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* margin: 32px; */
}

.icon {
    position: absolute;
    width: 96px; /* previously 80px */
    height: 96px;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 8px;
}

.icon.selected {
    background-color: #60606020;
    border: 1px solid #60606030;
}

.icon.active {
    background-color: #ffffff10;
    border: 1px dashed #ffffff30!important;
}

.icon:hover {
    border: 1px solid #60606020;
}

.icon img {
    width: 64px;
    height: 64px;
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.6));
    /* background-color: #ffffff10; */
}

.icon span {
    font-family: "Inter", sans-serif;
    font-weight: 300;
    font-optical-sizing: none; /* none for now */
    font-size: 8pt;
    color: #fff;
    margin-top: 5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* truncate text if too long */
    filter: drop-shadow(0 0 2px black);
    cursor: default;
    max-width: 76px;
}

#selection-box {
    position: absolute;
    border: 1px solid #ffffff80;
    background-color: #b5b5b520;
    border-radius: 3px;
    pointer-events: none; /* allows pointer events to pass through the selection box */
    display: none;
    box-shadow: inset 0 0 6px #00000060;
    filter: drop-shadow(0 0 6px #00000060);
    -webkit-animation: fadeIn 0.2s;
    animation: fadeIn 0.2s;
}

#selection-box.fade-out {
    -webkit-animation: fadeOut 0.2s forwards;
    animation: fadeOut 0.2s forwards;
}

.program-window {
    position: absolute;
    top: 100px;
    left: 50%;
    width: 320px;
    min-height: 20px;
    height: 200px;
    background-color: #232323;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgb(51 51 51), 0 0 12px 1px rgba(0, 0, 0, 0.3);
    user-select: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0; /* Start hidden */
}

.program-window.open {
    opacity: 1; /* Fade in */
    transform: scale(1); /* Scale to normal size */
}

.program-window.close {
    opacity: 0; /* Fade out */
    transform: scale(0.9); /* Scale down */
}

.program-window.minimized {
    transform: scale(0.5); /* Scale down when minimized */
    opacity: 0.5; /* Slightly transparent */
}

.program-window.maximized {
    transform: scale(1); /* Normal size when maximized */
}

.close-button {
    top: unset;
    /*position: absolute;
    right: 5px;
    cursor: pointer;*/
}

#dock {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 52px;
    height: 56px;
    background-color: #232323bf;
    /* border: 1px solid #323232; */
    color: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 10px;
    box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.1);
    padding: 0 2px;
    z-index: 99999999; /* Ensure dock is always on top */
}

.dock-icon {
    padding: 0;
    margin: 2px;
    border-radius: 8px;
    background: rgb(255 255 255 / 3%);
    vertical-align: middle;
    /* border: 1px solid #ffffff0d; */
}

#dockIcons {
    margin: 0;
}

#o-button {
    position: unset;
    vertical-align: middle;
    cursor: default;
    transition: 0.3s ease-out;
}

#o-button:hover {
    font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.o-menu {
    position: absolute;
}

#dockItems {
    display: flex;
}

.close-button, .minimize-button, .maximize-button, .unmaximize-button {
    position: absolute;
    top: 0;
    cursor: default;
    width: 12px;
    height: 12px;
    padding: 0;
    color: transparent;
    border-radius: 24px;
    outline: none;
    border: none;
    font-size: 12px;
    line-height: 1;
    vertical-align: middle;
    font-weight: 600;
    font-family: 'Material Symbols Rounded';
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 200, 'opsz' 20;
    background: #323232;
}

.close-button:hover, .minimize-button:hover, .maximize-button:hover, .unmaximize-button:hover {
    color: #000000bf;
}

.close-button {
    background: rgb(255 255 255 / 25%);
    left: 0;
}

.minimize-button, .unminimize-button {
    background: rgb(255 255 255 / 25%);
    left: 18px;
}

.maximize-button, .unmaximize-button {
    background: rgb(255 255 255 / 25%);
    left: 36px;
}

.focused>.control-buttons>.close-button {
    background: #eb5b53;
}

.focused>.control-buttons>.minimize-button, .focused>.control-buttons>.unminimize-button {
    background: #f5bb47;
}

.focused>.control-buttons>.maximize-button, .focused>.control-buttons>.unmaximize-button {
    background: #63c943;
}

.maximized {
    position: absolute;
    top: 4px !important;
    left: 4px !important;
    width: calc(100% - 8px);
    height: calc(100% - 76px);
    border: none;
    /* border-radius: 0 !important; */
}

.minimized>div {
    display: none;
}

.minimized {
    width: 60px !important;
    border-radius: 20px;
    display: none;
}

.program-window>div {
    padding: 30px 8px 30px 8px;
    color: lightgrey;
    text-align: center;
}

.title-bar {
    background-color: #282828;
    box-shadow: 0 1px 0 #333333;
    color: #808080 !important;;
    padding: 0 !important;
    height: 35px;
    border-radius: 12px 12px 0 0;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.focused>.title-bar {
    color: #bbb !important;
}

.control-buttons {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 5px;
    padding: 0 !important;
    margin: 0;
    width: 48px;
    height: 12px;
}

.context-menu {
    position: absolute;
    background-color: #333333;
    font-size: 14px;
    color: #eee;
    border: none;
    border-radius: 8px;
    box-shadow: 0 0 0px 1px #111, 0 0 8px rgba(0, 0, 0, 0.2);
    z-index: 999999999;
    padding: 4px;
    min-width: max-content;
}

.context-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.context-menu li {
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 6px;
}

.context-menu li:hover {
    background-color: #555;
}

.context-menu.submenu {
    position: absolute;
    background-color: #333333;
    z-index: 999999999;
    padding: 4px;
    border-radius: 8px;
}

.context-menu.submenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.context-menu.submenu li {
    padding: 2px 8px;
    cursor: pointer;
    border-radius: 6px;
}

.context-menu.submenu li:hover {
    background-color: #555;
}

.context-menu hr {
    border: none;
    border-top: 1px solid #555;
    margin: 4px 0;
}