.container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap; /* allow error to wrap to next line */
}

.form-group label {
    width: 80px;
    margin-right: 10px;
}

input[type="text"],
.ss-main {
    height: 38px;
    box-sizing: border-box;
    flex: 1;
}

#userForm button {
    margin-top: 0;
    margin-left: 90px;
}

.marker-container {
    position: absolute;
    height: 100%;
    width: 2px;
    background-color: #ff4444;
    cursor: move;
}

.time-bar-container {
    position: relative;
    height: 100px;
    background: linear-gradient(to right,
        #1a237e, /* midnight */
        #1a237e, /* early morning */
        #64b5f6, /* morning */
        #90caf9, /* day */
        #64b5f6, /* afternoon */
        #1a237e  /* evening */
    );
    border-radius: 5px;
    /* unified spacing and border */
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
}

.time-markers {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    position: absolute;
    width: 100%;
    top: 0;
}

.time-markers span {
    font-size: 12px;
    transform: translateX(-50%);
    color: #fff;
}

.time-divider {
    position: absolute;
    width: 1px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.3);
    top: 0;
    transform: translateX(-50%);
}

.user-marker {
    position: absolute;
    width: 2px;
    height: 100%;
    background-color: red;
    cursor: pointer;
}

.user-label {
    position: absolute;
    background: #ffffcc;
    border: 1px solid black;
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
    transform: translateX(-50%);
    top: auto;
    bottom: -5px;
    margin-top: 0;
    box-shadow: 1px 1px 0 black;
    z-index: 1;
    font-family: 'Tahoma', sans-serif;
}

/* Add styles for timezone select */
.timezone-select {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
}

/* Style for user list items */
.user-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px;
    padding: 6px 10px;
}

.delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    padding: 0;
    line-height: 1;
}

.time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.time-title {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
    color: black;
}

.time-title-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-title-wrapper h2 {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
    color: black;
}

.tooltip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    cursor: help;
    border: 1.5px solid #000000;
    background-color: #c0c0c0;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    color: #000000;
    line-height: 1;
    padding: 0;
}

.tooltip-icon-text {
    pointer-events: none;
}

.tooltip-icon .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    background-color: #ffffcc;
    border: 1px solid #000000;
    color: #000000;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: normal;
    font-style: normal;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 1px 1px 0 black;
    transition: opacity 0.1s;
    pointer-events: none;
}

.tooltip-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.reset-button {
    margin: 0;
    background: none;
    border: none;
    color: #0000ff;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    min-width: auto;
    height: auto;
    display: inline;
}

.reset-button:disabled {
    color: #808080;
    text-decoration: underline;
    cursor: default;
}

/* Base typography: Tahoma 12px */
body {
    background-color: #008080; /* Classic teal */
    font-family: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.3;
    color: #000;
}

/* Simulate Windows 2000 (no ClearType) */
body.cleartype-off {
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: auto;
    text-rendering: optimizeSpeed;
}

/* Simulate ClearType-like antialiasing */
body.cleartype-on {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    padding: 0;
}

/* Small toolbar row below title bar */
.toolbar-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 8px 8px;
    font-size: 12px;
}

.toggle-label input {
    vertical-align: middle;
    margin-right: 4px;
}

.window-title {
    background: linear-gradient(to right, #000080, #51adeb);
    color: white;
    font-weight: bold;
    padding: 4px 4px 4px 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.window-title-text {
    white-space: nowrap;
}

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

.title-btn {
    width: 18px;
    height: 16px;
    padding: 0;
    background-color: #c0c0c0;
    color: black;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 12px;
    cursor: default;
}

.title-btn:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

.title-btn .glyph {
    pointer-events: none;
    transform: translateY(-1px);
}

.title-btn.close .glyph {
    font-weight: bold;
}

input[type="text"],
select {
    background-color: #ffffff;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    padding: 3px 5px;
    border-radius: 0;
}

/* Windows-style error box for form validation */
.form-error {
    display: block;
    margin: 6px 0 0 90px; /* align under input after 80px label + 10px gap */
    background-color: #ffffcc;
    border: 1px solid #000000;
    box-shadow: 1px 1px 0 #000000;
    padding: 4px 8px;
    font-size: 12px;
    color: #000000;
}

/* Ensure error spans full row under inputs */
.form-group .form-error {
    flex-basis: 100%;
    order: 3;
}

/* Invalid control 3D red border look */
input.is-invalid,
.ss-main.is-invalid {
    border-color: #ff0000 #800000 #800000 #ff0000;
    background-color: #fff0f0;
}

button {
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    border-radius: 0;
    padding: 4px 8px;
    color: black;
    font-family: 'Tahoma', sans-serif;
    font-size: 14px;
}

button:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

.user-input-section, .time-section{
    margin: 24px;
    padding: 10px 10px 10px 10px;
}

.group-box {
    margin: 0;
    padding: 10px 10px 12px 10px;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080; /* 3D etched look */
}

.group-box legend {
    font-size: 14px;
    background-color: #c0c0c0; /* match container */
    font-weight: bold;
}

.user-item {
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    margin: 4px;
}

.user-label {
    background-color: #ffffcc;
    border: 1px solid black;
    box-shadow: 1px 1px 0 black;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
}

h2 {
    font-size: 14px;
    margin: 8px 0;
    font-weight: bold;
    color: black;
}

.title-strip {
    background-color: #ffffff;
    padding: 32px 12px;
}

.title-strip h1 {
    margin: 0;
    text-align: center;
}

/* Input styles */
input[type="text"] {
    height: 38px; /* Match SlimSelect height */
    box-sizing: border-box;
}

.action-button {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary-button {
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    color: black;
}

.user-list {
    display: block;
    margin-top: 50px;
}

.no-users-message {
    color: #808080;
    font-style: italic;
    padding: 10px 0;
}

.user-list.has-users .no-users-message {
    display: none;
}

.user-list:not(.has-users) #usersList {
    display: none;
}

.user-item {
    margin-left: 0;
}

#usersList {
    padding-left: 0;
}

.ss-main {
    border-radius: 0;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080;
    background-color: #ffffff;
    width: 100%;
    box-sizing: border-box;
    margin: 0; /* eliminate outside gaps */
}

/* Remove SlimSelect's inner borders/shadows that create gray seams */
.ss-main .ss-single-selected {
    background-color: #ffffff;
    border: 0;
    box-shadow: none;
    height: 100%;
    padding: 8px 28px 8px 10px;
    position: relative;
}

.ss-main .ss-single-selected .ss-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    transition: transform 120ms ease-in-out;
    right: 8px;
    width: 0;
    height: 0;
    background: none;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #000000; /* solid black triangle */
    pointer-events: none;
}

/* Hide any default SVG/child used by SlimSelect for the arrow */
.ss-main .ss-single-selected .ss-arrow *,
.ss-main .ss-single-selected .ss-arrow::before,
.ss-main .ss-single-selected .ss-arrow::after { display: none !important; content: none; border: 0; }

/* Rotate triangle when dropdown is open */
.ss-main.ss-open .ss-single-selected .ss-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.ss-main:focus,
.ss-main:focus-within {
    outline: none;
}

/* Windows-style error dialog */
.error-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.error-dialog[aria-hidden="false"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
}

.dialog-window {
    position: relative;
    z-index: 10001;
    background-color: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    max-width: 500px;
}

.dialog-title-bar {
    background: linear-gradient(to right, #000080, #51adeb);
    color: white;
    font-weight: bold;
    padding: 4px 4px 4px 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dialog-title-text {
    white-space: nowrap;
}

.dialog-close-btn {
    width: 18px;
    height: 16px;
    padding: 0;
    background-color: #c0c0c0;
    color: black;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 12px;
    cursor: default;
    margin-left: 4px;
}

.dialog-close-btn:active {
    border-color: #808080 #ffffff #ffffff #808080;
}

.dialog-content {
    padding: 16px;
    background-color: #c0c0c0;
}

.dialog-message {
    font-size: 12px;
    color: #000000;
    line-height: 1.4;
    white-space: pre-line;
}

.dialog-buttons {
    padding: 10px 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background-color: #c0c0c0;
}

.dialog-ok-btn {
    min-width: 75px;
    height: 23px;
    font-size: 11px;
}

/* Media query for smaller screens */
@media (max-width: 540px) {
    .time-markers span {
        font-size: 8px;
    }
}
