@use 'sass:color';
@use '../../node_modules/quasar/src/css/variables.sass' as quasar;
@use 'theme';

// app global css in SCSS form
// ------------------------------------------------------------------
// SCROLLBAR
// ------------------------------------------------------------------

html {
  --scrollbarBG: #CCC;
  --thumbBG: #999;
}
body::-webkit-scrollbar {
  width: 7px;
}
body {
  scrollbar-width: thin;
  scrollbar-color: var(--thumbBG) var(--scrollbarBG);
}
body::-webkit-scrollbar-track {
  background: var(--scrollbarBG);
}
body::-webkit-scrollbar-thumb {
  background-color: var(--thumbBG);
  border-radius: 6px;
  border: 1px solid var(--scrollbarBG);
}

// ------------------------------------------------------------------
// FONTS
// ------------------------------------------------------------------

@font-face {
  font-family: 'Roboto Mono';
  src: url(/_assets/fonts/roboto-mono/roboto-mono.woff2);
}

.font-robotomono {
  font-family: 'Roboto Mono', Consolas, "Liberation Mono", Courier, monospace;
}

.text-wordbreak-all {
  word-break: break-all;
}

// ------------------------------------------------------------------
// THEME COLORS
// ------------------------------------------------------------------

:root {
  --q-header: #000;
  --q-sidebar: #1976D2;
}

.header, .bg-header {
  background: #000;
  background: var(--q-header);
}
.sidebar, .bg-sidebar {
  background: #1976D2;
  background: var(--q-sidebar);
}

.bg-dark-6 { background-color: #070a0d; }
.bg-dark-5 { background-color: #0d1117; }
.bg-dark-4 { background-color: #161b22; }
.bg-dark-3 { background-color: #1e232a; }
.bg-dark-2 { background-color: #292f39; }
.bg-dark-1 { background-color: #343b48; }

// ------------------------------------------------------------------
// FORMS
// ------------------------------------------------------------------

.v-textarea.is-monospaced textarea {
  font-family: 'Roboto Mono', 'Courier New', Courier, monospace;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.q-field.denser .q-field__control {
  height: 36px;

  .q-field__prepend {
    height: 36px;
  }
}

.q-field.fill-outline .q-field__control {
  background-color: #FFF;

  @at-root .body--light & {
    background-color: #FFF;
  }
  @at-root .body--dark & {
    background-color: theme.$dark;
  }
}

.q-field--dark .q-field__control:before {
  background-color: theme.$dark-5;
  border-color: rgba(255,255,255,.25);
}

// ------------------------------------------------------------------
// ICONS SIZE FIX
// ------------------------------------------------------------------

.q-btn .q-icon {
  &.fa-solid,
  &.fa-regular {
    font-size: 1.3em;
  }
}

.q-select__dropdown-icon {
  font-size: 16px;
}

// ------------------------------------------------------------------
// BUTTONS
// ------------------------------------------------------------------

.q-btn.acrylic-btn {
  .q-focus-helper {
    background-color: currentColor;
    opacity: .1;
  }

  &:hover .q-focus-helper {
    opacity: .3 !important;
  }
}

// ------------------------------------------------------------------
// ICONS
// ------------------------------------------------------------------

.blueprint-icon {
  &-alt {
    filter: hue-rotate(100);
  }
}

// ------------------------------------------------------------------
// DIALOGS
// ------------------------------------------------------------------

.card-header {
  display: flex;
  align-items: center;
  font-weight: 500;
  font-size: .9rem;
  background-color: theme.$dark-3;
  background-image: radial-gradient(at bottom right, theme.$dark-3, theme.$dark-5);
  color: #FFF;

  @at-root .body--light & {
    border-bottom: 1px solid theme.$dark-3;
    box-shadow: 0 1px 0 0 theme.$dark-6;
  }
  @at-root .body--dark & {
    border-bottom: 1px solid #000;
    box-shadow: 0 1px 0 0 color.adjust(theme.$dark-3, $lightness: 2%);
  }
}

.card-negative {
  display: flex;
  align-items: center;
  font-size: .9rem;

  @at-root .body--light & {
    background-color: quasar.$red-1;
    background-image: radial-gradient(at bottom center, color.adjust(quasar.$red-1, $lightness: 2%), color.adjust(quasar.$red-2, $lightness: 2%));
    border-bottom: 1px solid quasar.$red-3;
    text-shadow: 0 0 4px #FFF;
    color: quasar.$red-9;
  }
  @at-root .body--dark & {
    background-color: quasar.$red-9;
    background-image: radial-gradient(at bottom center, quasar.$red-7, quasar.$red-9);
    border-bottom: 1px solid quasar.$red-7;
    text-shadow: 0 0 4px color.adjust(quasar.$red-9, $lightness: -10%);
    color: #FFF;
  }
}

.card-actions {
  @at-root .body--light & {
    background-color: #FAFAFA;
    background-image: linear-gradient(to bottom, #FCFCFC, #F0F0F0);
    color: theme.$dark-3;
    border-top: 1px solid #EEE;
    box-shadow: inset 0 1px 0 0 #FFF;
  }
  @at-root .body--dark & {
    background-color: theme.$dark-3;
    background-image: radial-gradient(at top left, theme.$dark-3, theme.$dark-5);
    border-top: 1px solid #000;
    box-shadow: 0 -1px 0 0 color.adjust(theme.$dark-3, $lightness: 2%);
  }
}

// ------------------------------------------------------------------
// CARDS
// ------------------------------------------------------------------

.q-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12);

  &.q-card--dark {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12);
  }

  .q-separator--dark {
    background-color: rgba(0,0,0,.7);
  }
}

// ------------------------------------------------------------------
// DROPDOWN MENUS
// ------------------------------------------------------------------

.translucent-menu {
  backdrop-filter: blur(10px) saturate(180%);

  @at-root .body--light & {
    background-color: rgba(255,255,255,.8);
  }
  @at-root .body--dark & {
    background-color: rgba(theme.$dark,.7);
  }

  > .q-card {
    background-color: transparent !important;
  }
}

.q-menu--dark {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12);
}

// ------------------------------------------------------------------
// LOADING ANIMATIONS
// ------------------------------------------------------------------

.syncing-enter-active {
  animation: syncing-anim .1s;
}
.syncing-leave-active {
  animation: syncing-anim 1s reverse;
}
@keyframes syncing-anim {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.loading-darker {
  .q-loading__backdrop {
    opacity: .75;
  }
}
