/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */

/* total width */
body::-webkit-scrollbar,
#config .container::-webkit-scrollbar {
  background-color: #fff;
  width: 16px;
}

/* background of the scrollbar except button or resizer */
body::-webkit-scrollbar-track,
#config .container::-webkit-scrollbar-track {
  background-color: #fff;
}

/* scrollbar itself */
body::-webkit-scrollbar-thumb,
#config .container::-webkit-scrollbar-thumb {
  background-color: #babac0;
  border-radius: 16px;
  border: 4px solid #fff;
}

/* set button(top and bottom of the scrollbar) */
body::-webkit-scrollbar-button,
#config .container::-webkit-scrollbar-button {
  display: none;
}

#overlay {
  position: fixed;
  inset: 0;
  background-color: #fff;
  opacity: 0.6;
  display: none;
}

#config {
  box-sizing: border-box;

  position: fixed;
  left: 0;
  bottom: 0;
  top: 0;
  height: 100%;
  width: 220px;

  translate: -220px;
  transition: translate 0.3s ease-in-out;
  background: #fff;
  z-index: 9;
  border-right: 1px solid #ccc;
}

#config.open {
  translate: 0;
}

#config *,
#config *::before,
#config *::after {
  box-sizing: inherit;
  font-family: var(--crc-font-family);
}

/* Seperator */
#config hr {
  border: 0;
  width: 100%;
  height: 0.5px;
  min-height: 0.5px;
  background-color: #ccc;
}

#config .toggleBtn {
  position: absolute;
  top: 50px;
  right: -53px;
  border: 0;
  border-top: 4px solid #ccc;
  cursor: pointer;
  font-size: 12px;
  padding: 5px 8px;
  background-color: #fff;
  rotate: -90deg;
  word-spacing: 5px;
  letter-spacing: 2px;
}

/* Sidebar container */
#config .container {
  height: calc(100% - 63px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  font-family: sans-serif;
  overflow-y: auto;
}

#config label {
  font-size: 12px;
  margin-bottom: 5px;
  color: #666;
  display: block;
}

#config input {
  display: block;
  font-family: sans-serif;
  border: 1px solid #ccc;
  height: 30px;
  padding: 0 8px;
  width: 100%;
}

#config select {
  width: 100%;
  border: 1px solid #ccc;
  height: 30px;
  padding: 0 8px;
}

#config fieldset {
  padding: 0;
  margin: 0;
  border: 0;
  display: flex;
  gap: 16px;
}

#config .radio {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
}

#config .switch {
  appearance: none;
  position: relative;
  display: inline-block;
  box-sizing: content-box;
  width: 30px;
  height: 12px;
  padding: 0.2em;
  border: none;
  cursor: pointer;
  border-radius: 1.5em;
  overflow: hidden;
  background-color: #707070;
  transition: background ease 0.3s;
}

#config .switch::before {
  content: '';
  display: block;
  position: absolute;
  z-index: 2;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 1.5em;
  transition: transform cubic-bezier(0.3, 1.5, 0.7, 1) 0.3s;
}

#config .switch:checked {
  background-color: #4077f7;
}

#config .switch:checked::before {
  transform: translateX(18px);
}

#config .inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Save button at the bottom of the drawer */
#config .saveBtnContainer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 16px;
  border-top: 1px solid #ccc;
  background: white;
  z-index: 3;
}

#config .saveBtn {
  border: 1px solid #ccc;
  height: 30px;
  background: white;
  width: 100%;
  cursor: pointer;
}

#config .saveBtn:hover {
  border-width: 2px;
}
