/* styles.css */
@font-face {
    font-family: "Win95";
    src: url("fonts/W95FA.otf");
}
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: "Win95";
    user-select: none;
}
body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}
/* === PRESETS === */
.w95-blank {
    background: #f5f5f5;
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}
.w95-btn, .w95-box {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
}
/* "CSS no es un lenguaje de programación" 🗣🗣🔥🔥🥀🥀 */
.w95-btn {
    position: relative;
    padding: 2px 15px;
}
.w95-btn:not(.disabled):active {
    /* border: 2px inset #ffffff; */
    background: #b0b0b0;
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}
.w95-btn:not(.disabled):focus {
    outline: solid 1px #000;
}
.w95-btn:not(.disabled, .sysBtn):focus::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* background: #f004; */
    border: 0.5px dashed #000000;
    width: 90%;
    height: 75%;
}
.w95-details .key { /* .key = <summary> or <div> */
    display: flex;
    flex-direction: row;
    align-items: center;
    list-style: none;
}
.w95-details .key img {
    aspect-ratio: 1;
    height: 17px;
    margin-right: 5px;
}
.w95-details .key p {
    white-space: nowrap;
}
.w95-details .key p:focus {
    background: #00017f;
    outline: 1px dashed #ffffff;
    outline-offset: -1px;
    color: #ffffff;
}
.w95-details:has(div) > .key::before {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    content: "+";
    margin-right: 5px;
    border: 2px solid #808080;
    width: 16px;
    aspect-ratio: 1; 
    line-height: 0.5px;
    padding-bottom: 4px;
    box-sizing: border-box;
}
.w95-details:has(div)[open] > .key::before {
    content: "-";
}
.w95-table {
    width: "100%";
    border-spacing: 0;/* sin espacio entre elementos */
}
.w95-table th {
    background: #c0c0c0;
    border-top: 2px solid #c0c0c0;
    border-left: 2px solid #c0c0c0;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    font-weight: normal;
    text-align: start;
}
.w95-table th:not(:nth-child(1)) { /* Elementos seguidos del primero, tienen un "separador" notable */
    border-left: 2px solid #f5f5f5;
}
.w95-table td {
    white-space: nowrap;
}
.w95-scroll::-webkit-scrollbar {
    appearance: none;
    width: 20px;
    height: 20px;
}
.w95-scroll::-webkit-scrollbar-corner {
    background: #c0c0c0;
}
.w95-scroll::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
}
.w95-scroll::-webkit-scrollbar-track {
    background: #d5d5d5
}
.w95-scroll::-webkit-scrollbar-button {
    background: #c0c0c0;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    border-right: 2px solid #000000;
    border-bottom: 2px solid #000000;
    height: 20px;
    width: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 9px 9px;
}
.w95-scroll::-webkit-scrollbar-button:active {
    background: #b0b0b0;
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
}
.w95-scroll::-webkit-scrollbar-button:horizontal:decrement {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><text x="0" y="15" font-family="Arial" font-size="18" fill="black">◀</text></svg>');
}
.w95-scroll::-webkit-scrollbar-button:horizontal:increment {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><text x="0" y="15" font-family="Arial" font-size="18" fill="black">▶</text></svg>');
}
.w95-scroll::-webkit-scrollbar-button:vertical:decrement {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><text x="0" y="14" font-family="Arial" font-size="18" fill="black">▲</text></svg>');
}
.w95-scroll::-webkit-scrollbar-button:vertical:increment {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><text x="0" y="14" font-family="Arial" font-size="18" fill="black">▼</text></svg>');
}
.disabled {
    color: #808080;
}

/* === DESKTOP === */
.desktop {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    padding: 4px 0;
    /* El gridTemplate y gap se actualiza en el Desktop.refresh() (JavaScript) */
    /* El backgroundRepeat y backgroundSize también */
}
.desktopIcon {
    display: flex;
    aspect-ratio: 1/1;
    /* background: #ff04; */
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.desktopIcon img {
    height: auto;
    width: 70%;
    padding: 5px;
}
.desktopIcon p {
    color: #000000;
    text-shadow: #000 2px 2px;
    width: 90%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    padding: 2px;
}
.desktopIcon:focus p, .desktopIcon:focus img { /* lindo efecto w */
    color: #ffffff;
    background: #00017f;
    outline: 1px dashed #ffffff;
    outline-offset: -1px;
}
.desktopIcon input {
    font-family: "Win95";
    font-size: 14px;
    min-width: 10px;
    width: auto;
    outline: none;
    border: 1px solid #000000;
    text-align: center;
}
.desktopIcon input::selection {
    background: #00017f;
    color: #ffffff;
}

/* === TASKBAR === */
.taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    width: 100%;
    height: 30px;
    background: #c0c0c0;
    border: 2px outset #ffffff;
    padding: 2px;
}
.taskbar .start-button {
    display: flex;
    align-items: center;
    padding: 4px;
    gap: 4px;
}
.taskbar .start-button img {
    width: auto;
    height: 100%;
}
.taskbar .start-button p {
    font-size: 15px
}

/* === CONTEXT-MENU === */
.context-menu {
    position: absolute;
    top: 2px;
    left: 2px;
    min-height: 50px;
    min-width: 150px;
    background: #c1c1c1;
    color: #000000;
    border: 2px outset #ffffff;
    padding: 2px;
}
.context-menu .separator {
    height: 4px;
    width: 100%;
    border: 2px outset #ffffff;
    margin: 4px 0;
}
.context-menu .option {
    cursor: default;
    font-size: 14px;
    padding: 0 20px;
}
.context-menu .option:hover {
    background: #00017f;
}
.context-menu .option:not(.disabled):hover {
    color: #ffffff;
}
/* === WINDOW === */
.window {
    pointer-events: auto;
    position: absolute;
}
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.window .header {
    display: flex;
    justify-content: space-between;
    height: 22px;
    background: #00017f;
    color: #ffffff;
    padding: 2px;
}
.window .header .sysBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 14px;
    padding: 0 0px 4px 0;
    width: 18px;
    height: 18px
}
.window .header .buttons {
    display: flex;
}
.window .header .buttons :nth-last-child(1){
    margin-left: 4px;
}
.window .menus {
    display: flex;
    align-items: center;
    height: 22px;
    /* background: #f004; */
}
.window .menus button {
    background: #c0c0c0;
    border: none;
    border-top: 1px solid #c0c0c0;
    height: 100%;
    padding: 2px 5px;
    font-size: 14px;
}
.window .menus button:focus {
    background: #00017f;
    color: #ffffff
}
.window:has(.header) .content {
    /* background: #0ff4; */
    width: 100%;
    overflow: hidden;
    height: calc(100% - 22px); /* 22px -> headerHeight (22px)*/
}
.window:has(.menus) .content {
    height: calc(100% - 22px - 22px); /* 44px -> headerHeight + menusHeight (22 + 22) */
}
.window-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0002; /* esto no está en el w95 original */
}
.window-backdrop.hide {
    pointer-events: none;
    background: #00000000;
}