@tailwind base;
@tailwind components;

html,
body,
#__next {
  @apply w-full h-full relative bg-cool-gray-700;
}

.CodeMirror {
  height: auto !important;

  .CodeMirror-code {
    @apply bg-blue-50 rounded border border-gray-400;
  }

  &.CodeMirror-focused {
    .CodeMirror-code {
      @apply bg-blue-100;
    }
  }
}

.table-widget {
  position: relative;

  .resizer {
    position: absolute;
    width: 10px;
    height: 100%;
    right: -6px;
    top: 0;
    left: auto;
    z-index: 1;
    /* prevents from scrolling while dragging on touch devices */
    touch-action: none;

    &.isResizing {
      .resizer-bar {
        @apply bg-gray-500;
      }
    }

    .resizer-bar {
      @apply relative top-0 left-1/2 block w-px h-full bg-gray-400 -ml-px;
    }
  }
}

.cm-content {
  padding: 0;
  line-height: inherit;
  color: inherit;
  margin: 0;

  width: 100%;
  min-width: 0px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  position: relative;
  -webkit-appearance: none;
  -moz-appearance: none;
  -ms-appearance: none;
  appearance: none;
  transition-property: var(--chakra-transition-property-common);
  transition-duration: var(--chakra-transition-duration-normal);
  /* padding-bottom: 1px; */
  line-height: var(--chakra-lineHeights-normal);
  font-size: var(--chakra-fontSizes-md);
  -webkit-padding-start: var(--chakra-space-4);
  padding-inline-start: var(--chakra-space-4);
  -webkit-padding-end: 2rem;
  padding-inline-end: 2rem;
  /* height: var(--chakra-sizes-10); */
  border-radius: var(--chakra-radii-md);
  border: 1px solid;
  border-color: inherit;
  background: inherit;

  @apply text-sm;

  &:focus {
  }
}
.cm-focused {
  outline: none !important;
  .cm-content {
    border-color: #3182ce;
    /* border-width: 2px; */
    z-index: 1;
    box-shadow: 0 0 0 1px #3182ce !important;
  }
}

/* .select__value-container {
  @apply scrollbar-hide;
} */

/* @todo: fix hack 👇 */
.react-datepicker {
  width: 328px;
}

/* Loader CSS */
svg.tea {
  --secondary: #33406f;
}
svg.tea #teabag {
  transform-origin: top center;
  transform: rotate(3deg);
  animation: swing 2s infinite;
}
svg.tea #steamL {
  stroke-dasharray: 13;
  stroke-dashoffset: 13;
  animation: steamLarge 2s infinite;
}
svg.tea #steamR {
  stroke-dasharray: 9;
  stroke-dashoffset: 9;
  animation: steamSmall 2s infinite;
}
@-moz-keyframes swing {
  50% {
    transform: rotate(-3deg);
  }
}
@-webkit-keyframes swing {
  50% {
    transform: rotate(-3deg);
  }
}
@-o-keyframes swing {
  50% {
    transform: rotate(-3deg);
  }
}
@keyframes swing {
  50% {
    transform: rotate(-3deg);
  }
}
@-moz-keyframes steamLarge {
  0% {
    stroke-dashoffset: 13;
    opacity: 0.6;
  }
  100% {
    stroke-dashoffset: 39;
    opacity: 0;
  }
}
@-webkit-keyframes steamLarge {
  0% {
    stroke-dashoffset: 13;
    opacity: 0.6;
  }
  100% {
    stroke-dashoffset: 39;
    opacity: 0;
  }
}
@-o-keyframes steamLarge {
  0% {
    stroke-dashoffset: 13;
    opacity: 0.6;
  }
  100% {
    stroke-dashoffset: 39;
    opacity: 0;
  }
}
@keyframes steamLarge {
  0% {
    stroke-dashoffset: 13;
    opacity: 0.6;
  }
  100% {
    stroke-dashoffset: 39;
    opacity: 0;
  }
}
@-moz-keyframes steamSmall {
  10% {
    stroke-dashoffset: 9;
    opacity: 0.6;
  }
  80% {
    stroke-dashoffset: 27;
    opacity: 0;
  }
  100% {
    stroke-dashoffset: 27;
    opacity: 0;
  }
}
@-webkit-keyframes steamSmall {
  10% {
    stroke-dashoffset: 9;
    opacity: 0.6;
  }
  80% {
    stroke-dashoffset: 27;
    opacity: 0;
  }
  100% {
    stroke-dashoffset: 27;
    opacity: 0;
  }
}
@-o-keyframes steamSmall {
  10% {
    stroke-dashoffset: 9;
    opacity: 0.6;
  }
  80% {
    stroke-dashoffset: 27;
    opacity: 0;
  }
  100% {
    stroke-dashoffset: 27;
    opacity: 0;
  }
}
@keyframes steamSmall {
  10% {
    stroke-dashoffset: 9;
    opacity: 0.6;
  }
  80% {
    stroke-dashoffset: 27;
    opacity: 0;
  }
  100% {
    stroke-dashoffset: 27;
    opacity: 0;
  }
}

.content-line {
  display: inline-block;
  height: 1rem;
  border-radius: 4px;
}

.shimmer-bg {
  animation-duration: 3.3s;
  animation-fill-mode: forwards;
  animation-iteration-count: infinite;
  animation-name: shimmer;
  animation-timing-function: linear;
  background: #ddd;
  background: linear-gradient(
    to right,
    var(--chakra-colors-gray-200) 8%,
    var(--chakra-colors-gray-300) 18%,
    var(--chakra-colors-gray-200) 33%
  );
  background-size: 1200px 100%;
}

[hidden] {
  display: none !important;
}

/* Hiding focus states from chakra buttons. */
.no-focus:focus {
  outline: 0 !important;
  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0) !important;
}

progress {
  @apply h-2 bg-white border border-gray-400 rounded shadow-inner;
}
progress[value]::-webkit-progress-bar {
  @apply bg-white border border-gray-500 rounded shadow-inner;
}
progress[value]::-webkit-progress-value {
  @apply bg-tech-blue rounded;
}
progress[value]::-moz-progress-bar {
  @apply bg-tech-blue rounded appearance-none;
}

@-webkit-keyframes shimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 100% 0;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1200px 0;
  }
  100% {
    background-position: 1200px 0;
  }
}

.text-stroke-white {
  --text-stroke-color: #ffffff;
}

.text-stroke-black {
  --text-stroke-color: #000000;
}

/* Real outline for modern browsers */
@supports ((text-stroke: 2px white) or (-webkit-text-stroke: 2px white)) {
  .text-stroked {
    color: transparent;
    -webkit-text-stroke: 2px var(--text-stroke-color);
    text-stroke: 2px var(--text-stroke-color);
    text-shadow: none;
  }
}

.bg-squares {
  background: url("/img/bg.svg");
}

@tailwind utilities;
