/*! Office2003.css - Windows Office 2003 Luna Blue Theme
 * Based on xp.css v0.2.6, enhanced with Office 2003 Luna Blue gradients
 * Reference: https://unpkg.com/xp.css@0.2.6/dist/XP.css
 */

@font-face {
  font-family: "Pixelated MS Sans Serif";
  src: url(https://unpkg.com/xp.css@0.2.6/dist/ms_sans_serif.woff)
      format("woff"),
    url(https://unpkg.com/xp.css@0.2.6/dist/ms_sans_serif.woff2)
      format("woff2");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Pixelated MS Sans Serif";
  src: url(https://unpkg.com/xp.css@0.2.6/dist/ms_sans_serif_bold.woff)
      format("woff"),
    url(https://unpkg.com/xp.css@0.2.6/dist/ms_sans_serif_bold.woff2)
      format("woff2");
  font-weight: 700;
  font-style: normal;
}

/* ==================== BASE STYLES ==================== */
body {
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-size: 12px;
  color: #222;
  background: #d0dff8;
}

.surface {
  background: #e8f0ff;
}

/* ==================== HEADINGS ==================== */
h1 {
  font-size: 5rem;
}
h2 {
  font-size: 2.5rem;
}
h3 {
  font-size: 2rem;
}
h4 {
  font-size: 1.5rem;
}

/* ==================== TEXT ELEMENTS ==================== */
u {
  text-decoration: none;
  border-bottom: 0.5px solid #222;
}

a {
  color: #00f;
}

a:focus {
  outline: 1px dotted #00f;
}

code,
code * {
  font-family: monospace;
}

pre {
  display: block;
  padding: 12px 8px;
  background-color: #000;
  color: silver;
  font-size: 1rem;
  margin: 0;
  font-family: "Perfect DOS VGA 437 Win", monospace;
}

/* ==================== FOCUS STATES ==================== */
summary:focus {
  outline: 1px dotted #000;
}

/* ==================== BUTTONS ==================== */
button {
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #f0f7ff 15%,
    #e8f0ff 50%,
    #c0d0f0 85%,
    #a0b8e8 100%
  );
  box-shadow: inset 1px 1px #ffffff, inset -1px -1px #606880;
  border-radius: 0;
  min-width: 75px;
  min-height: 23px;
  padding: 0 12px;
  font-family: "Pixelated MS Sans Serif", Arial;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

button:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #f8fbff 15%,
    #f0f7ff 50%,
    #d0dff8 85%,
    #b0c8f0 100%
  );
}

button:active:not(:disabled),
button.active:not(:disabled) {
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  background: linear-gradient(
    180deg,
    #d0dff8 0%,
    #c0d0f0 15%,
    #b0c0e8 50%,
    #8898d0 85%,
    #707cc0 100%
  );
  box-shadow: inset -1px -1px #ffffff, inset 1px 1px #404860;
}

button:focus,
button.focused {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

button:disabled {
  color: #a0a0a0;
  text-shadow: 1px 1px #fff;
}

/* ==================== FORM ELEMENTS ==================== */
input,
label,
textarea,
select {
  font-family: "Pixelated MS Sans Serif", Arial;
  font-size: 11px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  padding: 3px 4px;
  border: 1px solid #a0a0a0;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 50%, #f0f5ff 100%);
  box-sizing: border-box;
  appearance: none;
  border-radius: 0;
  height: 21px;
  line-height: 2;
  font-family: "Pixelated MS Sans Serif", Arial;
  font-size: 11px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: #0a50b8;
  background: linear-gradient(180deg, #e8f0ff 0%, #d0e0f8 50%, #c0d8f0 100%);
  box-shadow: inset 1px 1px #b0c8f0, inset -1px -1px #4070b0;
}

textarea {
  padding: 3px 4px;
  border: 1px solid #a0a0a0;
  background-color: #fff;
  box-sizing: border-box;
  appearance: none;
  border-radius: 0;
}

textarea:focus {
  outline: none;
  border-color: #0a246a;
  background-color: #ffffcc;
}

select {
  border: 1px solid #a0a0a0;
  background-color: #fff;
  box-sizing: border-box;
  height: 21px;
  appearance: none;
  position: relative;
  padding: 3px 32px 3px 4px;
  border-radius: 0;
}

select:focus {
  outline: none;
  color: #fff;
  background-color: #0a50b8;
}

select:focus option {
  color: #000;
  background-color: #fff;
}

option {
  font-family: "Pixelated MS Sans Serif", Arial;
  font-size: 11px;
}

/* ==================== CHECKBOXES & RADIO BUTTONS ==================== */
label {
  display: inline-flex;
  align-items: center;
}

input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  margin: 0;
  background: 0;
  position: fixed;
  opacity: 0;
  border: none;
}

input[type="radio"] + label {
  line-height: 13px;
  position: relative;
  margin-left: 19px;
}

input[type="radio"] + label:before {
  content: "";
  position: absolute;
  top: 0;
  left: -19px;
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  background: #fff;
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  border-radius: 50%;
}

input[type="radio"]:checked + label:after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  position: absolute;
  top: 3px;
  left: -15px;
  background: #000;
  border-radius: 50%;
}

input[type="checkbox"] + label {
  line-height: 13px;
  position: relative;
  margin-left: 19px;
}

input[type="checkbox"] + label:before {
  content: "";
  position: absolute;
  left: -19px;
  display: inline-block;
  width: 13px;
  height: 13px;
  background: #fff;
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  margin-right: 6px;
}

input[type="checkbox"]:focus + label {
  outline: 1px dotted #000;
}

input[type="checkbox"]:checked + label:after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  position: absolute;
  top: 3px;
  left: -15px;
  background: #000;
}

input:disabled,
input:disabled + label {
  color: #a0a0a0;
  text-shadow: 1px 1px #fff;
}

/* ==================== WINDOWS - PRIMARY ELEMENT ==================== */

.window {
  font-size: 11px;
  background: #e8f0ff;
  padding: 2px;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #808080;
  display: flex;
  flex-direction: column;
}

.window.active {
  /* Active window styling */
}

.window.inactive {
  opacity: 0.8;
}

/* ==================== TITLE BAR - LUNA BLUE GRADIENT ==================== */

.title-bar {
  background: linear-gradient(
    90deg,
    #000080 0%,
    #1084d7 20%,
    #308fe6 50%,
    #1084d7 80%,
    #000080 100%
  );
  padding: 1px 2px 1px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #0a246a;
  height: 14px;
  flex-shrink: 0;
  box-shadow: inset 1px 1px #1084d7;
}

.title-bar-text {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0;
  margin-right: 24px;
  text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
  font-size: 10px;
  flex: 1;
}

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

.title-bar-controls button {
  padding: 0;
  display: block;
  min-width: 18px;
  min-height: 9px;
  margin: 0;
  background: linear-gradient(
    180deg,
    #e8e8e8 0%,
    #d0d8e0 30%,
    #b8c0d0 70%,
    #808090 100%
  );
  border: 1px solid;
  border-color: #dfdfdf #0a0a0a #0a0a0a #dfdfdf;
  color: #000;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.1s;
  line-height: 1;
  box-shadow: inset 1px 1px #e8e8e8, inset -1px -1px #404050;
}

.title-bar-controls button:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    #f0f0f0 0%,
    #d8e0e8 30%,
    #c0c8d8 70%,
    #909098 100%
  );
}

.title-bar-controls button:active,
.title-bar-controls button:focus {
  outline: none;
  border-color: #0a0a0a #dfdfdf #dfdfdf #0a0a0a;
  background: linear-gradient(
    180deg,
    #707880 0%,
    #606870 30%,
    #505860 70%,
    #303840 100%
  );
  box-shadow: inset -1px -1px #e8e8e8, inset 1px 1px #202830;
}

/* Red gradient for close button */
.title-bar-controls button[aria-label="Close"] {
  background: linear-gradient(
    180deg,
    #ff9999 0%,
    #ff6b6b 30%,
    #ee5555 70%,
    #cc0000 100%
  );
  border-color: #ffaaaa #660000 #660000 #ffaaaa;
  color: #fff;
  font-weight: bold;
  box-shadow: inset 1px 1px #ffcccc, inset -1px -1px #770000;
}

.title-bar-controls button[aria-label="Close"]:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    #ffbbbb 0%,
    #ff8888 30%,
    #ff6666 70%,
    #dd1111 100%
  );
}

/* ==================== WINDOW BODY ==================== */

.window-body {
  margin: 8px;
  flex: 1;
  overflow: auto;
}

.window-body pre {
  margin: -8px;
}

/* ==================== STATUS BAR ==================== */

.status-bar {
  margin: 0 1px;
  display: flex;
  gap: 1px;
  border-top: 1px solid #dfdfdf;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #f0f7ff 20%,
    #e8f0ff 50%,
    #c0d0f0 80%,
    #a0b8e8 100%
  );
  padding: 2px 0;
  flex-shrink: 0;
  box-shadow: inset 1px 1px #ffffff, inset -1px -1px #606880;
}

.status-bar-field {
  box-shadow: inset -1px -1px #dfdfdf, inset 1px 1px #808080;
  flex-grow: 1;
  padding: 2px 3px;
  margin: 0;
  font-size: 11px;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), rgba(200,210,240,0.2));
}

/* ==================== FIELDSET ==================== */

fieldset {
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding: 10px;
  padding-block-start: 8px;
  margin: 0;
  background: #e8f0ff;
}

legend {
  background: #e8f0ff;
  padding: 0 2px;
}

/* ==================== TABS ==================== */

menu[role="tablist"] {
  position: relative;
  margin: 0 0 -2px;
  text-indent: 0;
  list-style-type: none;
  display: flex;
  padding-left: 3px;
  background: #e8f0ff;
  border-bottom: 2px solid;
  border-bottom-color: #808080;
}

menu[role="tablist"] button {
  z-index: 1;
  display: block;
  color: #222;
  text-decoration: none;
  min-width: unset;
  padding: 4px 16px;
  margin: -2px 2px 0 0;
  background: linear-gradient(180deg, #f0f7ff, #d0dff8);
  border-color: #dfdfdf #808080 #e8f0ff #dfdfdf;
}

menu[role="tablist"] button[aria-selected="true"] {
  padding-bottom: 4px;
  margin-top: 0;
  background: linear-gradient(180deg, #f0f7ff, #e8f0ff);
  position: relative;
  z-index: 8;
  border-bottom: 2px solid #e8f0ff;
}

menu[role="tablist"] button:focus {
  outline: 1px dotted #222;
  outline-offset: -4px;
}

menu[role="tablist"].justified button {
  flex-grow: 1;
  text-align: center;
}

[role="tabpanel"] {
  padding: 14px;
  clear: both;
  background: #e8f0ff;
  border: 1px solid #a0a0a0;
  position: relative;
  z-index: 2;
  margin-bottom: 9px;
}

/* ==================== TREE VIEW ==================== */

ul.tree-view {
  font-family: "Pixelated MS Sans Serif", Arial;
  font-size: 11px;
  display: block;
  background: #fff;
  padding: 6px;
  margin: 0;
  border: 1px solid #a0a0a0;
}

ul.tree-view li {
  list-style-type: none;
  margin-top: 3px;
}

ul.tree-view a {
  text-decoration: none;
  color: #000;
}

ul.tree-view a:focus {
  background-color: #0a50b8;
  color: #fff;
}

ul.tree-view ul {
  margin-top: 3px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px dotted #a0a0a0;
}

ul.tree-view ul > li {
  position: relative;
}

ul.tree-view ul > li:before {
  content: "";
  display: block;
  position: absolute;
  left: -16px;
  top: 6px;
  width: 12px;
  border-bottom: 1px dotted #a0a0a0;
}

ul.tree-view ul > li:last-child:after {
  content: "";
  display: block;
  position: absolute;
  left: -20px;
  top: 7px;
  bottom: 0;
  width: 8px;
  background: #fff;
}

ul.tree-view details {
  margin-top: 0;
}

ul.tree-view details > summary:before {
  text-align: center;
  display: block;
  float: left;
  content: "+";
  border: 1px solid #a0a0a0;
  width: 8px;
  height: 9px;
  line-height: 9px;
  margin-right: 5px;
  padding-left: 1px;
  background-color: #fff;
  cursor: pointer;
}

ul.tree-view details[open] summary {
  margin-bottom: 0;
}

ul.tree-view details[open] > summary:before {
  content: "-";
}

ul.tree-view ul details > summary:before {
  margin-left: -22px;
  position: relative;
  z-index: 1;
}

/* ==================== SCROLLBARS ==================== */

::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: #dfdfdf;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #08569d, #1084d7);
  border: 1px solid;
  border-color: #dfdfdf #0a246a #0a246a #dfdfdf;
  box-shadow: inset 1px 1px #2a94ff;
}

::-webkit-scrollbar-button:vertical:start,
::-webkit-scrollbar-button:vertical:end,
::-webkit-scrollbar-button:horizontal:start,
::-webkit-scrollbar-button:horizontal:end {
  display: block;
  background: linear-gradient(180deg, #dfdfdf, #808080);
  border: 1px solid;
  border-color: #dfdfdf #0a0a0a #0a0a0a #dfdfdf;
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-button:vertical:start {
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M8 3l5 6H3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 6px;
  background-color: #dfdfdf;
}

::-webkit-scrollbar-button:vertical:end {
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M8 13L3 7h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 8px 6px;
  background-color: #dfdfdf;
}

::-webkit-scrollbar-button:horizontal:start {
  width: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M3 8l6 5V3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 6px 8px;
  background-color: #dfdfdf;
}

::-webkit-scrollbar-button:horizontal:end {
  width: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M13 8L7 3v10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 6px 8px;
  background-color: #dfdfdf;
}

::-webkit-scrollbar-button:vertical:start {
  height: 17px;
}

::-webkit-scrollbar-button:vertical:end {
  height: 17px;
}

::-webkit-scrollbar-button:horizontal:start {
  width: 17px;
}

::-webkit-scrollbar-button:horizontal:end {
  width: 17px;
}

::-webkit-scrollbar-corner {
  background: #dfdfdf;
}

/* ==================== RANGE SLIDER ==================== */

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 21px;
  background: linear-gradient(90deg, #f5f5f5, #e0e0e0);
  border: 1px solid;
  border-color: #dfdfdf #0a246a #0a246a #dfdfdf;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, #f5f5f5, #ece9d8);
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  height: 4px;
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 21px;
  background: linear-gradient(90deg, #f5f5f5, #e0e0e0);
  border: 1px solid;
  border-color: #dfdfdf #0a246a #0a246a #dfdfdf;
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  background: linear-gradient(90deg, #f5f5f5, #ece9d8);
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  height: 4px;
}

/* ==================== MISC ==================== */

.vertical-bar {
  width: 4px;
  height: 20px;
  background: linear-gradient(90deg, #dfdfdf, #fff);
  border: 1px solid;
  border-color: #808080 #fff #fff #0a0a0a;
}

/* ==================== UTILITY CLASSES ==================== */

.frame {
  background: #ece9d8;
  border: 2px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding: 4px;
}

.inset {
  border: 1px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  padding: 2px;
}

.outset {
  border: 1px solid;
  border-color: #dfdfdf #808080 #808080 #dfdfdf;
  padding: 2px;
}
