/* Windows 3.1 Style CSS */
/* Based on classic-stylesheets win3x theme */

:root {
    /* Windows 3.1 Color Palette */
    --win-bg: #c0c0c0;
    --win-white: #ffffff;
    --win-black: #000000;
    --win-dark-gray: #808080;
    --win-light: #dfdfdf;
    --win-shadow: #808080;
    --win-highlight: #ffffff;
    --win-title-active: #000080;
    --win-title-inactive: #808080;
    --win-title-text: #ffffff;
    --win-button-face: #c0c0c0;
    --win-button-highlight: #ffffff;
    --win-button-shadow: #808080;
    --win-button-dark-shadow: #000000;
    --win-desktop: #008080;
    --win-selection: #000080;
    --win-selection-text: #ffffff;
}

* {
    box-sizing: border-box;
}

/* Window Styles */
.window {
    background: var(--win-bg);
    border: 2px solid;
    border-color: var(--win-highlight) var(--win-button-dark-shadow) var(--win-button-dark-shadow) var(--win-highlight);
    box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-shadow);
    font-family: "Fixedsys", "MS Sans Serif", Arial, sans-serif;
    font-size: 11px;
}

.title-bar {
    background: var(--win-title-active);
    padding: 2px 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 20px;
    user-select: none;
}

.title-bar.inactive {
    background: var(--win-title-inactive);
}

.title-bar-text {
    color: var(--win-title-text);
    font-weight: bold;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-controls button {
    width: 17px;
    height: 14px;
    padding: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
}

.window-body {
    padding: 8px;
}

/* Button Styles */
button, .button {
    background: var(--win-button-face);
    border: 2px solid;
    border-color: var(--win-button-highlight) var(--win-button-dark-shadow) var(--win-button-dark-shadow) var(--win-button-highlight);
    box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-shadow);
    padding: 3px 12px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    min-width: 75px;
}

button:active, .button:active {
    border-color: var(--win-button-dark-shadow) var(--win-button-highlight) var(--win-button-highlight) var(--win-button-dark-shadow);
    box-shadow: inset -1px -1px 0 var(--win-light), inset 1px 1px 0 var(--win-shadow);
}

button:focus, .button:focus {
    outline: 1px dotted var(--win-black);
    outline-offset: -4px;
}

button.default {
    border-width: 3px;
}

button:disabled {
    color: var(--win-dark-gray);
    text-shadow: 1px 1px var(--win-white);
}

/* Input Styles */
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    background: var(--win-white);
    border: 2px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
    box-shadow: inset 1px 1px 0 var(--win-button-dark-shadow);
    padding: 3px;
    font-family: inherit;
    font-size: 11px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4'%3E%3Cpath d='M0 0l4 4 4-4z' fill='%23000'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 16px;
}

/* Field Row */
.field-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.field-row label {
    min-width: 80px;
}

.field-row-stacked {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}

/* Checkbox and Radio */
input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    width: 13px;
    height: 13px;
    background: var(--win-white);
    border: 2px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
    box-shadow: inset 1px 1px 0 var(--win-button-dark-shadow);
    margin: 0;
    margin-right: 4px;
    vertical-align: middle;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked::after {
    content: "✓";
    display: block;
    font-size: 10px;
    line-height: 9px;
    text-align: center;
}

input[type="radio"]:checked::after {
    content: "";
    display: block;
    width: 5px;
    height: 5px;
    background: var(--win-black);
    border-radius: 50%;
    margin: 2px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: repeating-conic-gradient(var(--win-bg) 0% 25%, var(--win-white) 0% 50%) 50% / 2px 2px;
}

::-webkit-scrollbar-thumb {
    background: var(--win-button-face);
    border: 2px solid;
    border-color: var(--win-button-highlight) var(--win-button-dark-shadow) var(--win-button-dark-shadow) var(--win-button-highlight);
    box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-shadow);
}

::-webkit-scrollbar-button {
    background: var(--win-button-face);
    border: 2px solid;
    border-color: var(--win-button-highlight) var(--win-button-dark-shadow) var(--win-button-dark-shadow) var(--win-button-highlight);
    box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-shadow);
    display: block;
    width: 16px;
    height: 16px;
}

/* Menu Bar */
.menu-bar {
    display: flex;
    background: var(--win-bg);
    border-bottom: 1px solid var(--win-shadow);
    padding: 2px 0;
}

.menu-bar-item {
    padding: 2px 8px;
    cursor: pointer;
}

.menu-bar-item:hover,
.menu-bar-item.open {
    background: var(--win-selection);
    color: var(--win-selection-text);
}

/* List View */
.list-view {
    background: var(--win-white);
    border: 2px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
    box-shadow: inset 1px 1px 0 var(--win-button-dark-shadow);
    overflow: auto;
}

.list-view-item {
    padding: 2px 4px;
    cursor: pointer;
}

.list-view-item:hover {
    background: var(--win-selection);
    color: var(--win-selection-text);
}

.list-view-item.selected {
    background: var(--win-selection);
    color: var(--win-selection-text);
}

/* Tree View */
.tree-view {
    background: var(--win-white);
    border: 2px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
    box-shadow: inset 1px 1px 0 var(--win-button-dark-shadow);
    overflow: auto;
    padding: 4px;
}

/* Status Bar */
.status-bar {
    display: flex;
    background: var(--win-bg);
    border-top: 1px solid var(--win-highlight);
    padding: 2px;
    font-size: 11px;
}

.status-bar-field {
    padding: 2px 4px;
    border: 1px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
    flex: 1;
}

/* Group Box */
.group-box {
    border: 1px solid var(--win-shadow);
    padding: 12px 8px 8px;
    margin: 8px 0;
    position: relative;
}

.group-box-title {
    position: absolute;
    top: -8px;
    left: 8px;
    background: var(--win-bg);
    padding: 0 4px;
}

/* Sunken/Raised panels */
.sunken {
    border: 2px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
    box-shadow: inset 1px 1px 0 var(--win-button-dark-shadow);
}

.raised {
    border: 2px solid;
    border-color: var(--win-highlight) var(--win-button-dark-shadow) var(--win-button-dark-shadow) var(--win-highlight);
    box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-shadow);
}

/* Tabs */
.tabs {
    display: flex;
    flex-direction: column;
}

.tab-bar {
    display: flex;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
}

.tab {
    background: var(--win-bg);
    border: 2px solid;
    border-color: var(--win-highlight) var(--win-button-dark-shadow) var(--win-button-dark-shadow) var(--win-highlight);
    border-bottom: none;
    padding: 4px 12px;
    cursor: pointer;
    margin-right: 2px;
    position: relative;
    top: 2px;
}

.tab.active {
    border-bottom: 2px solid var(--win-bg);
    top: 0;
    z-index: 2;
}

.tab-content {
    border: 2px solid;
    border-color: var(--win-highlight) var(--win-button-dark-shadow) var(--win-button-dark-shadow) var(--win-highlight);
    padding: 8px;
    background: var(--win-bg);
}

/* Progress Bar */
.progress-bar {
    background: var(--win-white);
    border: 2px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
    height: 20px;
    padding: 2px;
}

.progress-bar-fill {
    background: var(--win-title-active);
    height: 100%;
    transition: width 0.3s ease;
}

/* Slider */
.slider-track {
    background: var(--win-bg);
    border: 2px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
    height: 4px;
    position: relative;
}

.slider-thumb {
    background: var(--win-button-face);
    border: 2px solid;
    border-color: var(--win-highlight) var(--win-button-dark-shadow) var(--win-button-dark-shadow) var(--win-highlight);
    width: 12px;
    height: 20px;
    position: absolute;
    top: -10px;
    cursor: pointer;
}
