/* Windows 98 Template CSS - Reusable components for Windows 98 games */

:root {
    --window-bg: #c0c0c0;
    --text-color: #000;
    --border-light: #ffffff;
    --border-dark: #808080;
    --border-darker: #404040;
    --button-face: #c0c0c0;
    --title-bar-bg: #000080;
    --title-text: #ffffff;
}

html {
    overflow: hidden;
}

body {
    background: #008080;
    margin: 0;
    padding: 0;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
    min-height: 100vh;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    font-feature-settings: "liga" 0, "kern" 0, "calt" 0;
    font-variant-ligatures: none;
    -webkit-font-feature-settings: "liga" 0, "kern" 0, "calt" 0;
    -moz-font-feature-settings: "liga" 0, "kern" 0, "calt" 0;
    -ms-font-feature-settings: "liga" 0, "kern" 0, "calt" 0;
}

/* Windows 98 Desktop Background Elements */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url('images/background-sideleft.png'),
        url('images/background-bottomleft.png'),
        url('images/background-bottomright.jpg');
    background-position: 
        top left,
        bottom left,
        bottom right;
    background-repeat: no-repeat;
    z-index: -1;
}

/* Windows 98 Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 26px;
    background-color: #C0C0C0;
    z-index: 9999;
    display: block !important;
    border-top: 2px solid #ffffff;
}

.taskbar::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 316px;
    height: 100%;
    background-image: url('images/background-bottomleft.png');
    background-repeat: no-repeat;
    background-position: bottom left;
    z-index: 2;
}

.taskbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background-image: url('images/background-bottomright.jpg');
    background-repeat: no-repeat;
    background-position: bottom right;
    z-index: 2;
}

.taskbar-top {
    height: 2px;
    background: #C0C0C0;
}

.taskbar-main {
    display: flex;
    height: 24px;
    background-color: #C0C0C0;
}

.taskbar-start {
    width: 316px;
    height: 100%;
    background-image: url('images/background-bottomleft.png');
    background-repeat: no-repeat;
    background-position: bottom left;
}

.taskbar-middle {
    flex: 1;
    height: 100%;
    background-color: #C0C0C0;
}

.taskbar-end {
    width: 200px;
    height: 100%;
    background-image: url('images/background-bottomright.jpg');
    background-repeat: no-repeat;
    background-position: bottom right -1px;
}

/* Window Component */
.window {
    margin-bottom: 30px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 1px 1px 0 #000000;
    position: relative;
    padding: 1px;
    user-select: none;
}

.window::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    pointer-events: none;
}

/* Title Bar */
.title-bar {
    background: #000080;
    color: white;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
    margin: 2px 2px 3px 2px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.title {
    font-weight: bold;
    font-size: 14px;
    margin: 0 3px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
}

.title-icon {
    width: 16px;
    height: 16px;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.title-buttons {
    display: flex;
    gap: 2px;
    margin-right: 2px;
}

.title-buttons button {
    width: 18px;
    height: 16px;
    font-size: 16px;
    line-height: 14px;
    text-align: center;
    padding: 0;
    color: black;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    min-width: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.title-buttons button.close {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 0px 0.5px 2px 0;
    font-size: 20px;
    font-weight: 200;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-stretch: ultra-condensed;
    margin-left: 2px;
    line-height: 12px;
    width: 18px;
    height: 16px;
}

.title-buttons button.maximize {
    align-items: center;
    justify-content: center;
    padding: 0;
}

.title-buttons button.maximize img {
    width: 11px;
    height: 11px;
    display: block;
    padding-top: 1px;
}

.title-buttons button.minimize {
    align-items: flex-start;
    padding-top: 1px;
    line-height: 10px;
    font-size: 13px;
    font-weight: bold;
}

.title-buttons button:active {
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 1px 0 0 1px;
}

/* Menu Bar */
.menu-bar {
    display: flex;
    padding: 2px;
}

.menu-item {
    position: relative;
    padding: 2px 8px;
    cursor: default;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.menu-item:hover {
    background: #000080;
    color: white;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #808080 #000000 #000000 #808080;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    min-width: 150px;
    z-index: 1000;
}

.menu-item:hover .menu-dropdown,
.menu-item.active .menu-dropdown {
    display: block;
}

.menu-option {
    padding: 4px 20px;
    cursor: default;
    color: black;
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.menu-option:hover {
    background: #000080;
    color: white;
}

/* Content Area */
.content {
    padding: 4px;
}

/* Buttons */
button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #404040 #dfdfdf;
    color: black;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
    padding: 2px 6px;
    cursor: pointer;
    min-width: 90px;
    position: relative;
}

button:active {
    border-color: #404040 #dfdfdf #dfdfdf #404040;
    padding: 3px 5px 1px 7px;
}

button:not(.current):not(:disabled):active::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px dotted black;
}

button:disabled {
    background: #c0c0c0;
    color: #808080;
    text-shadow: 1px 1px 0 #fff;
    cursor: default;
    pointer-events: none;
}

button:disabled:active {
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 2px 6px;
    text-shadow: 1px 1px 0 #ffffff;
}

/* Dialog Windows */
.dialog {
    position: fixed;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 1px 1px 0 #000000;
    z-index: 1000;
    padding: 1px;
}

.dialog::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid;
    border-color: #dfdfdf #404040 #404040 #dfdfdf;
    pointer-events: none;
}

.dialog-title-bar {
    background: #000080;
    color: white;
    padding: 3px 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 18px;
    margin: 2px 2px 3px 2px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dialog-title {
    font-weight: bold;
    font-size: 14px;
    margin: 0 3px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-close {
    width: 18px;
    height: 16px;
    font-size: 20px;
    font-weight: 200;
    font-family: "Segoe UI", Tahoma, sans-serif;
    font-stretch: ultra-condensed;
    line-height: 12px;
    text-align: center;
    padding: 0px 0.5px 2px 0;
    color: black;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    min-width: unset;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-left: 2px;
    cursor: pointer;
}

.dialog-close:active {
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 1px 0px 1px 1px;
}

.dialog-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-main-content {
    border: 1px solid #808080;
    padding: 12px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-message {
    margin-bottom: 12px;
    line-height: 1.4;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-input-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
}

.dialog-input {
    background: white;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 3px 5px;
    width: 130px;
    font-family: 'MS Sans Serif', Arial, sans-serif !important;
    font-size: 14px;
    color: black;
    cursor: default;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #ffffff;
}

.dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: absolute;
    right: 5px;
    top: calc(50% + 10px);
    transform: translateY(-50%);
    padding-left: 10px;
    background: #c0c0c0;
}

.dialog-button {
    width: 75px;
    height: 28px;
    padding: 0;
}

/* Input Fields */
input[type="text"],
input[type="number"] {
    background: white;
    border: 1px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 3px 5px;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 14px;
    color: black;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #ffffff;
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: 1px dotted black;
    outline-offset: -2px;
}

/* Windows-specific adjustments */
.windows-os .title-buttons button.close,
.windows-os .dialog-close {
    font-size: 25px !important;
    line-height: 10px !important;
    padding: 0 !important;
}

/* Dragging styles */
.window.dragging, .window.dragging * {
    cursor: default !important;
}

.dialog.dragging, .dialog.dragging * {
    cursor: default !important;
}

/* Fonts */
@font-face {
    font-family: 'MS Sans Serif';
    src: url('fonts/MS Sans Serif/MS Sans Serif.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    html {
        overflow: auto;
    }

    body {
        overflow: auto;
        padding-bottom: 40px;
        height: auto;
        min-height: 100vh;
    }

    .window {
        width: 100%;
        max-width: 320px;
        height: auto;
        min-height: calc(100vh - 40px);
        margin: 10px auto 30px !important;
        overflow: visible;
        display: flex;
        flex-direction: column;
    }

    .content {
        flex: 1;
        overflow: visible;
        padding: 8px;
    }

    .dialog {
        width: 90% !important;
        max-width: 300px !important;
        top: 42% !important;
    }
}


