@import url("../../font.css");
@import url("../../root/index.css");
@import url("../../text/index.css");

body {
  user-select: none;
  margin: 0;
  font-family: Manrope, "Noto Sans TC", sans-serif;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--light);
  border: 1px solid #ffffff42;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-button,
::-webkit-scrollbar-track-piece {
  background: transparent;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgb(0 0 0 / 40%);
  border: 1px solid #727272;
}
::-webkit-scrollbar-track {
  box-shadow: transparent;
}

.container {
  margin: 0;
  background-color: var(--container-bg);
  display: flex;
  flex-direction: column;
  height: 99.7vh;
  -webkit-app-region: drag;
}
.editor-container {
  display: grid;
  gap: 20px;
  padding: 20px;
  flex: 1;
  overflow: hidden;
}

.section {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  -webkit-app-region: no-drag;
}
.section-title {
  margin: 0 0 10px 0;
  padding: 0;
}

.editor,
.preview {
  font-family: monospace;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--input-bg);
  color: var(--light);
  resize: none;
  white-space: pre;
  tab-size: 2;
  flex: 1;
  overflow: auto;
  outline: none;
}

.status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 20px;
  border-radius: 4px;
  display: none;
  opacity: 0;
  z-index: 1000;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translateY(20px);
}
.success,
.error {
  color: var(--light);
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.success {
  background-color: var(--success);
}
.error {
  background-color: var(--danger);
}

.field {
  margin: 10px 0;
  padding: 15px;
  background-color: var(--field-bg);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.field-label {
  font-weight: bold;
  color: var(--primary);
}

.input {
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--light);
  padding: 8px;
  border-radius: 4px;
  width: calc(100% - 18px);
  margin: 2px 0;
  outline: none;
}
select.input {
  width: 100%;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: var(--light);
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(26px);
}

.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--light);
  margin: 5px;
}
.btn-add {
  background-color: var(--success);
}
.btn-remove {
  background-color: var(--danger);
}

.nested {
  margin-left: 20px;
  padding-left: 10px;
  border-left: 2px solid var(--primary);
}
.type-indicator {
  font-size: 0.8em;
  color: #888;
  margin-left: 10px;
}
.disabled {
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}
.hidden {
  display: none;
}

.version {
  position: fixed;
  bottom: 10px;
  left: 10px;
  color: #919090;
  font-size: 13px;
  padding: 5px;
  background-color: var(--bg-color);
  border-radius: 5px;
  font-weight: bold;
}

.windows-wrapper {
  position: absolute;
  right: 0.8em;
  display: flex;
  justify-content: space-between;
  width: auto;
  flex-direction: row;
  flex-wrap: wrap;
  top: 0.6em;
  font-weight: bold;
  -webkit-app-region: no-drag;
  z-index: 1002;
}
.minimize,
.maximize,
.close {
  margin-top: 2px;
  color: var(--light);
  align-items: center;
  justify-content: center;
}
.minimize:hover,
.maximize:hover {
  background: #868484;
}
.close:hover {
  background: var(--danger);
}
.windows-buttons {
  border: 1px solid #616161;
  width: 25px;
  text-align: center;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  margin-right: 5px;
  align-items: flex-start;
}
