@font-face {
    font-family: 'MSW98UI';
    src: url('./fonts/MSW98UI-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'MSW98UI';
    src: url('./fonts/MSW98UI-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Tex Gyre Heros';
    src: url('../assets/fonts/texgyreheros/texgyreheros-italic-webfont.woff') format('woff');
    font-weight: 400;
    font-style: italic;
  
  }
  
  @font-face {
    font-family: 'Tex Gyre Heros';
    src: url('../assets/fonts/texgyreheros/texgyreheros-bold-webfont.woff') format('woff');
    font-weight: 700;
    font-style: normal;
  }
  
  @font-face {
    font-family: 'Tex Gyre Heros';
    src: url('../assets/fonts/texgyreheros/texgyreheros-bolditalic-webfont.woff') format('woff');
    font-weight: 700;
    font-style: italic;
  }
  
  @font-face {
    font-family: 'Tex Gyre Heros';
    src: url('../assets/fonts/texgyreheros/texgyreheros-regular-webfont.woff') format('woff');
    font-weight: 400;
    font-style: normal;
  }

  @font-face {
    font-family: 'IBM BIOS';
    src: url('./fonts/Web437_IBM_VGA_8x14.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
  

:root {
    --background-teal: #008080;
    --background-gray: #C0C0C0;
    --border-light: #DFDFDF;
    --border-dark: #87888F;
    --border-white: white;
    --border-black: black;
    --highlight-blue: #0000A8;
    --highlight-text: #fff;
    --shadow-light: #fff;
    --shadow-dark: #0a0a0a;
    --shadow-medium-light: #dfdfdf;
    --shadow-medium-dark: grey;
    --icon-filter: sepia(100%) hue-rotate(180deg) saturate(2000%) brightness(0.6);
    --text-shadow: 1px 1px #222;
    --icon-label-font-size: 17px;
}

body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'MSW98UI', 'MS Sans Serif', Tahoma, sans-serif !important;
    background-color: var(--background-teal);
    image-rendering: pixelated;
    font-smooth: never;
    -webkit-font-smoothing: none;
}

.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    color: white;
    font-family: 'IBM BIOS', monospace;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: left;
    text-align: left;
    z-index: 9999;
    overflow: hidden;
    padding-bottom: 10vh;
    font-size: large;
}

.gif-screen {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading-banner {
    width: 100%;
    height: 20px;
    background: linear-gradient(90deg,
            #4E7BB8 0%,
            #ADB9C3 25%,
            #ADB9C3 50%,
            #4E7BB8 100%);
    background-size: 1000px 20px;
    animation: moving-banner 2s linear infinite;
    position: fixed;
    bottom: 0;
}

@keyframes moving-banner {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Media query for vertical/mobile screens */
@media (orientation: portrait) {
    .gif-screen img {
        height: 100%; /* Force full height */
        width: auto;   /* Maintain aspect ratio */
        max-width: none; /* Allow cropping on sides */
        object-fit: cover; /* Cover the container */
    }
}

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 10000;
}

.login-screen .window {
    top: 20%;
}

.login-screen .window .window-content {
    padding: 10px;
}

.login-screen form, .login-screen p
    {
    font-family: 'MSW98UI', sans-serif;
    display: flex;
    flex-direction: column;
}


/* Container for the three columns */
.login-columns {
    display: flex;
    flex-direction: row;
    align-items: flex-start; /* Ensures top alignment */
  }
  
  /* Left column (icon): width based on the image size */
  .icon-col {
    margin-right: 12px; /* spacing between columns */
  }
  
  /* Center column: takes available space */
  .form-col {
    flex-grow: 1;
  }
  
  /* For the fields: layout the label and input on the same line */
  .fields .field-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.5em;
  }
  
  /* Optionally, set a fixed width for labels */
  .field-row label {
    width: 70px;
    margin-right: 0.5em;
  }
  
  /* Right column (buttons): width based on button width */
  .buttons-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin: 0 1em;
  }

  .buttons-col button {
    margin: 2px;
  }
  

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.desktop-area {
    position: relative;
    overflow: hidden;
    /* Add padding inside to create space for window borders */
    padding: 4px; 
    box-sizing: border-box;
    height: calc(100vh - 28px - env(safe-area-inset-bottom) - 2px); /* Adjust height dynamically */
}

.window {
    min-width: 400px;
    max-width: 100vw;
    max-height: 100%;
    position: absolute;
    overflow: hidden;
    z-index: 1000;
    /* Ensure borders are included in the element's total width/height */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.app-window {
    resize: both;
}

.desktop {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-rows: repeat(auto-fill, minmax(68px, 1fr));
    grid-auto-columns: 105px;
    padding: 10px;
    gap: 8px;
}

.window-content {
    font-family: 'Tex Gyre Heros', Helvetica, Arial, sans-serif;
    padding: 0;
    overflow: auto; 
    max-height: none; 
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1; /* Takes up remaining space */
}

.window-content ul {
    font-family: 'Tex Gyre Heros', Helvetica, Arial, sans-serif;
}

.taskbar {
    position: fixed;         /* Changed from sticky to fixed */
    bottom: 0;               /* Ensure it's pinned to the bottom */
    left: 0;
    width: 100%;
    height: 28px;
    background: var(--background-gray);
    border-top: 1px solid var(--border-light);
    box-shadow: inset 0 1px white;
    padding: 2px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom); /* Ensures the taskbar isn’t obscured on mobile */
}

.taskbar-divider {
    width: 1px;
    height: 24px;
    background-color:var(--shadow-medium-dark);
    border-right: var(--border-white) 1px solid;
    margin: 0 0 0 2px;
}

.taskbar-divider-handler {
    width: 1px;
    height: 16px;
    background-color: var(--background-gray);
    border-top: var(--border-white) 1px solid;
    border-left: var(--border-white) 1px solid;
    border-right: var(--border-dark) 1px solid;
    border-bottom: var(--border-dark) 1px solid;
    padding-left: 0;
    margin: 2px;
}

.start-button,
.title-bar-text {
    display: flex;
    align-items: center;
    margin: 0;
    font-weight: bold;
}

.start-button {
    padding: 0 4px;
    min-width: 50px;
}

.start-button.active {
    box-shadow: inset -1px -1px var(--shadow-light), inset 1px 1px var(--shadow-dark), inset -2px -2px var(--shadow-medium-light), inset 2px 2px var(--shadow-medium-dark);
    text-shadow: var(--text-shadow);
}

.taskbar-icon-area {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    width: auto;
    justify-content: flex-start;
}

.taskbar-app-area {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    width: auto;
    flex-grow: 1;
    justify-content: flex-start;
}

.taskbar-button {
    display: flex;
    align-items: center;
    margin: 0;
    padding-left: 3px;
    min-width: 50px;
    max-width: 200px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-button.active {
    box-shadow: inset -1px -1px var(--shadow-light), inset 1px 1px var(--shadow-dark), inset -2px -2px var(--shadow-medium-light), inset 2px 2px var(--shadow-medium-dark);
    text-shadow: var(--text-shadow);
    background-image: url("/win98/checker.png");
    background-repeat: repeat;
}

.taskbar-button.active img {
    transform: translate(1px, 1px);
    /* Move the icon when the button is active */
}

button:not(:disabled):active img {
    transform: translate(1px, 1px);
}

.taskbar-icon {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 3px;
    min-width: 20px;
    min-height: 20px;
    border: none;
    background-color: transparent;
    box-shadow: none;
}

.taskbar-icon:hover {
    box-shadow: inset -1px -1px var(--shadow-dark), inset 1px 1px var(--shadow-light), inset -2px -2px var(--shadow-medium-dark), inset 2px 2px var(--shadow-medium-light);
}

.taskbar-icon img {
    height: 16px;
    user-select: none;
}

.start-button img,
.taskbar-button img {
    height: 16px;
    margin-right: 3px;
    user-select: none;
}

.title-bar-text img {
    height: 16px;
    margin-right: 4px;
}

.hidden {
    display: none !important;
}

.title-bar {
    user-select: none;
}

.desktop-icon {
    width: 120px;
    text-align: center;
    /* position: relative;  Remove relative positioning */
    color: white;
    margin: 11px 8px;
    /* Keep the margin */
}

.desktop-icon .icon {
    display: block;
    /* width: 32px;
    height: 32px; */
    margin: auto;
}

.desktop-icon .icon img {
    width: 48px;
    height: 48px;
}

.desktop-icon .icon-label {
    font-size: var(--icon-label-font-size);
}

.highlighted-icon {
    filter: var(--icon-filter);
}

.highlighted-label {
    background-color: var(--highlight-blue);
    color: var(--highlight-text);
}

.selected {
    border: 1px dotted white;
}

.start-menu {
    position: absolute;
    bottom: 0; /* Adjust this value to position the menu above the start button */
    left: 0;
    background-color: var(--background-gray);
    border: 1px solid black;
    border-top-color: var(--border-light);
    border-left-color: var(--border-light);
    box-shadow: inset -1px -1px 0 0 var(--border-dark), inset 1px 1px 0 0 var(--border-white);
    z-index: 1000;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    animation-duration: 0.2s;
    animation-fill-mode: forwards;
    pointer-events: auto;
}

.start-menu ul {
    list-style: none;
    padding: 0;
    margin: 1px;
    margin-left: 0;
}

.start-menu li {
    height: 22px;
    width: 132px;
    padding: 7px 10px;
    cursor: default;
    display: flex;
    align-items: center;
    font-size: 12px;
    margin:1px;
    margin-left: 0;
    text-decoration: none;
}
.start-menu li img {
    width: 24px;
    height: 24px;
    margin-right: 14px;
}
.start-menu li:hover {
    background-color: var(--highlight-blue);
    color: var(--highlight-text);
}

.blue-rectangle {
    width: 21px;
    background-color: var(--highlight-blue);
    margin: 2px;
    margin-right: 0;
  display: grid;
  align-items: end;
}

.start-menu-wrapper {
    position: fixed;
    top: 0;
    bottom: 25px;
    left: 0;
    right: 0;
    overflow: hidden; 
    pointer-events: none;
    z-index: 9999;
  }


.start-menu-divider {
    width: 146px;
    height: 1px;
    background-color:var(--shadow-medium-dark);
    border-bottom: var(--border-white) 1px solid;
    margin: 0 3px;
}

@keyframes scrollUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.system-tray {
    height: 22px;
    background: var(--background-gray);
    border: 1px solid var(--border-light);
    border-left: 1px solid var(--border-dark);
    border-top: 1px solid var(--border-dark);
    margin: 2px;
    display: flex;
    align-items: center;
}

.taskbar-clock {
    width: 64px;
    min-width: 64px;
    text-align: center;
    font-size: 11px;
    line-height: 1;
    color: #000;
    user-select: none;
}

#clock {
    display: inline-block;
    color: #000;
    font-family: 'MSW98UI', Tahoma, Arial, sans-serif;
}

.tooltip-custom {
    position: absolute;
    padding: 5px 10px;
    background: #333;
    color: yellow;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.toolbar-menu {
    background: silver;
    min-height: 23px
}
/* Force retro font on key UI elements */
.desktop-icon .icon-label,
.start-button,
.taskbar,
.taskbar-button,
.system-tray,
.taskbar-clock,
.window,
.title-bar,
.start-menu,
.start-menu-list li {
  font-family: 'MSW98UI', 'MS Sans Serif', Tahoma, sans-serif !important;
  font-size: 11px;
}
