@import '@/_sass_shared/_theme.scss';

/*------------------------------------*\
   Base
\*------------------------------------*/
html {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Helvetica Neue', Helvetica, Arial, 'Hiragino Sans GB',
    'Hiragino Sans GB W3', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
}

/*------------------------------------*\
   Components
\*------------------------------------*/

@import '@/content/components/DictPanel/DictPanelStandalone.scss';

.popup-root {
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  width: 100vw;
  height: 550px;
  font-size: 14px;
}

.qrcode-panel {
  position: fixed;
  z-index: $global-zindex-dictpanel;
  bottom: 10px;
  left: 10px;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.8) 0px 4px 23px -6px;
}

.qrcode-panel-title {
  text-align: center;
  margin: 5px 0 0 0;

  input {
    width: 100%;
  }
}

.page-no-response-panel {
  position: fixed;
  z-index: 100;
  bottom: 60px;
  right: 25px;
  padding: 0 10px;
  background: #fff;
  border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.8) 0px 4px 23px -6px;
}

.switch-container {
  overflow: hidden;
  background: #f9f9f9;
}

.active-switch {
  display: flex;
  align-items: center;
  position: relative;
  height: 49px;
  border-bottom: 1px solid #d8d8d8;
  padding: 0 20px;
  user-select: none;

  &:last-child {
    border-bottom-color: transparent;
  }
}

.icon-qrcode {
  width: 20px;
  margin-top: 3px;
}

.switch-title {
  flex: 1;
  font-size: 1.2em;
  padding: 0 15px;
  text-align: left;
  color: #333;
}

$switch-button-width: 55px;
$switch-button-height: 35px;
.btn-switch {
  // hide input
  position: absolute;
  z-index: -200000;
  opacity: 0;

  & + label {
    display: inline-block;
    width: $switch-button-width;
    height: $switch-button-height;
    position: relative;
    margin: auto;
    background-color: #ddd;
    border-radius: $switch-button-height;
    cursor: pointer;
    outline: 0;
    user-select: none;
  }

  & + label:before {
    content: '';
    display: block;
    position: absolute;
    top: 1px;
    left: 1px;
    bottom: 1px;
    right: 1px;
    background-color: #f1f1f1;
    border-radius: $switch-button-height;
    transition: background 0.4s;
  }

  & + label:after {
    content: '';
    display: block;
    position: absolute;
    height: $switch-button-height - 2px;
    width: $switch-button-height - 2px;
    background-color: #fff;
    border-radius: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: margin 0.4s;
  }

  &:checked + label:before {
    background-color: #8ce196;
  }

  &:checked + label:after {
    margin-left: $switch-button-width - $switch-button-height + 2px;
  }

  &:active + label,
  &:focus + label {
    outline: 5px auto rgb(59, 153, 252);
    outline: 5px auto -webkit-focus-ring-color;
  }

  & + label:hover {
    outline: none !important;
  }
}

.fade-enter {
  opacity: 0;
  transition: opacity 0.5s;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.5s;
}

.dark-mode {
  background: #222;

  .switch-container {
    background: #414141;
  }

  .active-switch {
    border-bottom-color: #666;
  }

  .switch-title {
    color: #ddd;
  }

  .icon-qrcode {
    fill: #ddd;
  }

  .btn-switch + label:before {
    background-color: #666;
  }

  .btn-switch:checked + label:before {
    background-color: #8ce196;
  }

  .btn-switch + label:after {
    background-color: #ddd;
  }

  .qrcode-panel {
    background-color: #ddd;
  }
}
