@tailwind base;
@tailwind components;
@tailwind utilities;
/**
* Add css variables here as well for light mode in addition to tailwind.config to avoid FOUC
*/
:root {
  /* Spacing Scale */
  --cal-spacing-0: 0px;
  --cal-spacing-px: 1px;
  --cal-spacing-0_5: 0.125rem; /* 2px */
  --cal-spacing-1: 0.25rem;   /* 4px */
  --cal-spacing-1_5: 0.375rem; /* 6px */
  --cal-spacing-2: 0.5rem;    /* 8px */
  --cal-spacing-2_5: 0.625rem; /* 10px */
  --cal-spacing-3: 0.75rem;   /* 12px */
  --cal-spacing-3_5: 0.875rem; /* 14px */
  --cal-spacing-4: 1rem;      /* 16px */
  --cal-spacing-5: 1.25rem;   /* 20px */
  --cal-spacing-6: 1.5rem;    /* 24px */
  --cal-spacing-7: 1.75rem;   /* 28px */
  --cal-spacing-8: 2rem;      /* 32px */
  --cal-spacing-9: 2.25rem;   /* 36px */
  --cal-spacing-10: 2.5rem;   /* 40px */
  --cal-spacing-11: 2.75rem;  /* 44px */
  --cal-spacing-12: 3rem;     /* 48px */
  --cal-spacing-14: 3.5rem;   /* 56px */
  --cal-spacing-16: 4rem;     /* 64px */
  --cal-spacing-20: 5rem;     /* 80px */
  --cal-spacing-24: 6rem;     /* 96px */
  --cal-spacing-28: 7rem;     /* 112px */
  --cal-spacing-32: 8rem;     /* 128px */
  --cal-spacing-36: 9rem;     /* 144px */
  --cal-spacing-40: 10rem;    /* 160px */
  --cal-spacing-44: 11rem;    /* 176px */
  --cal-spacing-48: 12rem;    /* 192px */
  --cal-spacing-52: 13rem;    /* 208px */
  --cal-spacing-56: 14rem;    /* 224px */
  --cal-spacing-60: 15rem;    /* 240px */
  --cal-spacing-64: 16rem;    /* 256px */
  --cal-spacing-72: 18rem;    /* 288px */
  --cal-spacing-80: 20rem;    /* 320px */
  --cal-spacing-96: 24rem;    /* 384px */

  /* Border Radius */
  --cal-radius-none: 0px;
  --cal-radius-sm: 0.125rem;  /* 2px */
  --cal-radius: 0.25rem;      /* 4px */
  --cal-radius-md: 0.375rem;  /* 6px */
  --cal-radius-lg: 0.5rem;    /* 8px */
  --cal-radius-xl: 0.75rem;   /* 12px */
  --cal-radius-2xl: 1rem;     /* 16px */
  --cal-radius-3xl: 1.5rem;   /* 24px */
  --cal-radius-full: 9999px;

  /* Background Standard */
  --cal-bg-emphasis: hsla(220, 13%, 91%, 1); /* gray.200 - active items and emphasising */
  --cal-bg: hsla(0, 0%, 100%, 1); /* white - default background */
  --cal-bg-subtle: hsla(220, 14%, 94%, 1); /* gray.100 - hovering on items, subtle raising */
  --cal-bg-muted: hsla(210, 20%, 97%, 1); /* gray.50 - large items, sidebar, sections */
  --cal-bg-inverted: hsla(210, 30%, 4%, 1); /* gray.900 - tooltips */

  /* Background Primary */
  --cal-bg-primary: hsla(214, 30%, 16%, 1); /* stone-100 */
  --cal-bg-primary-emphasis: hsla(220, 6%, 25%, 1); /* stone-800 */
  --cal-bg-primary-muted: hsla(220, 14%, 94%, 1); /* stone-400 */

  /* Background Brand */
  --cal-bg-brand: hsla(214, 30%, 16%, 1); /* gray-50 */
  --cal-bg-brand-emphasis: hsla(220, 6%, 25%, 1); /* stone-100 */
  --cal-bg-brand-muted: hsla(220, 14%, 94%, 1); /* stone-100 */
  
  /* Background Semantic */
  --cal-bg-semantic-info-subtle: hsla(212, 88%, 97%, 1); /* blue-100 */
  --cal-bg-semantic-info-emphasis: hsla(236, 80%, 25%, 1); /* blue-500 */
  --cal-bg-semantic-success-subtle: hsla(167, 54%, 93%, 1); /* green-100 */
  --cal-bg-semantic-success-emphasis: hsla(158, 74%, 38%, 1); /* green-500 */
  --cal-bg-semantic-attention-subtle: hsla(34, 100%, 92%, 1); /* orange-100 */
  --cal-bg-semantic-attention-emphasis: hsla(15, 79%, 34%, 1); /* orange-500 */
  --cal-bg-semantic-error-subtle: hsla(0, 93%, 94%, 1); /* red-100 */
  --cal-bg-semantic-error-emphasis: hsla(0, 63%, 24%, 1); /* red-500 */

  /* Background Visualization */
  --cal-bg-visualization-1-subtle: hsla(326, 78%, 95%, 1); /* pink-100 */
  --cal-bg-visualization-1-emphasis: hsla(330, 81%, 60%, 1); /* pink-500 */
  --cal-bg-visualization-2-subtle: hsla(256, 86%, 91%, 1); /* purple-100 */
  --cal-bg-visualization-2-emphasis: hsla(256, 85%, 57%, 1); /* purple-500 */
  --cal-bg-visualization-3-subtle: hsla(217, 87%, 91%, 1); /* blue-100 */
  --cal-bg-visualization-3-emphasis: hsla(235, 100%, 63%, 1); /* blue-500 */
  --cal-bg-visualization-4-subtle: hsla(167, 54%, 93%, 1); /* green-100 */
  --cal-bg-visualization-4-emphasis: hsla(158, 74%, 38%, 1); /* green-500 */
  --cal-bg-visualization-5-subtle: hsla(55, 97%, 88%, 1); /* yellow-100 */
  --cal-bg-visualization-5-emphasis: hsla(45, 93%, 47%, 1); /* yellow-500 */
  --cal-bg-visualization-6-subtle: hsla(34, 100%, 92%, 1); /* orange-100 */
  --cal-bg-visualization-6-emphasis: hsla(25, 95%, 53%, 1); /* orange-500 */
  --cal-bg-visualization-7-subtle: hsla(0, 96%, 89%, 1); /* red-100 */
  --cal-bg-visualization-7-emphasis: hsla(0, 84%, 60%, 1); /* red-500 */

  /* Launch Background */
  --cal-bg-launch-dark: hsla(242, 53%, 10%, 1); /* #0D0C27 - Launch card dark background */

  /* Legacy Background Components - Consider deprecating */
  --cal-bg-info: hsla(221, 91%, 93%, 1); /* #dee9fc - info backgrounds */
  --cal-bg-success: hsla(142, 76%, 94%, 1); /* #e2fbe8 - success backgrounds */
  --cal-bg-attention: hsla(33, 100%, 92%, 1); /* #fceed8 - attention backgrounds */
  --cal-bg-error: hsla(3, 66%, 93%, 1); /* #f9e3e2 - error backgrounds */
  --cal-bg-dark-error: hsla(2, 55%, 30%, 1); /* Keeping existing dark error */

  /* Borders */
  --cal-border-emphasis: hsla(218, 11%, 65%, 1); /* gray.400 - input:hover */
  --cal-border: hsla(216, 12%, 84%, 1); /* gray.300 - inputs */
  --cal-border-subtle: hsla(220, 13%, 91%, 1); /* gray.200 - container borders */
  --cal-border-muted: hsla(220, 14%, 94%, 1); /* gray.100 */
  --cal-border-error: hsla(0, 96%, 89%, 1); /* Keeping existing error border */
  --cal-border-semantic-error: hsla(0, 96%, 89%, 1);

  /* Content/Text Standard */
  --cal-text-emphasis: hsla(210, 30%, 4%, 1); /* gray-900 */
  --cal-text: hsla(220, 6%, 25%, 1); /* gray-700 */
  --cal-text-subtle: hsla(220, 9%, 46%, 1); /* gray-500 */
  --cal-text-muted: hsla(218, 11%, 65%, 1); /* gray-400 */
  --cal-text-inverted: hsla(0, 0%, 100%, 1); /* white */

  /* Content/Text Semantic */
  --cal-text-semantic-info: hsla(236, 80%, 25%, 1); /* blue-800 */
  --cal-text-semantic-success: hsla(150, 84%, 22%, 1); /* green-800 */
  --cal-text-semantic-attention: hsla(15, 79%, 34%, 1); /* orange-800 */
  --cal-text-semantic-error: hsla(0, 63%, 24%, 1); /* red-800 */

  /* Border/Semantic Subtle */
  --cal-border-semantic-attention-subtle: hsla(32, 98%, 83%, 1); 
  --cal-border-semantic-error-subtle: hsla(0, 96%, 89%, 1); 

  /* Content/Text Visualization */
  --cal-text-visualization-1: hsla(332, 79%, 25%, 1); /* pink-800 */
  --cal-text-visualization-2: hsla(270, 91%, 25%, 1); /* purple-800 */
  --cal-text-visualization-3: hsla(217, 91%, 25%, 1); /* blue-800 */
  --cal-text-visualization-4: hsla(142, 71%, 25%, 1); /* green-800 */
  --cal-text-visualization-5: hsla(45, 93%, 25%, 1); /* yellow-800 */
  --cal-text-visualization-6: hsla(24, 95%, 25%, 1); /* orange-800 */
  --cal-text-visualization-7: hsla(0, 84%, 25%, 1); /* red-800 */

  /* Legacy Content/Text Components - Consider deprecating */
  --cal-text-info: hsla(225, 57%, 33%, 1); /* #253985 - interactive text/icons */
  --cal-text-success: hsla(144, 34%, 24%, 1); /* #285231 */
  --cal-text-attention: hsla(16, 62%, 28%, 1); /* Keeping existing attention text */
  --cal-text-error: hsla(0, 63%, 31%, 1); /* Keeping existing error text */

  /* Brand */
  --cal-brand: hsla(221, 39%, 11%, 1); /* Keeping existing brand color */
  --cal-brand-emphasis: hsla(0, 0%, 6%, 1); /* Keeping existing brand emphasis */
  --cal-brand-text: hsla(0, 0%, 100%, 1); /* white */
}
.dark {
  /* Background Standard */
  --cal-bg-emphasis: hsla(0, 0%, 25%, 1); /* stone-700 */
  --cal-bg: hsla(0, 0%, 6%, 1); /* stone-950 */
  --cal-bg-subtle: hsla(0, 0%, 15%, 1); /* stone-800 */
  --cal-bg-muted: hsla(0, 0%, 9%, 1); /* stone-900 */
  --cal-bg-inverted: hsla(0, 0%, 98%, 1); /* stone-50 */

  /* Background Primary */
  --cal-bg-primary: hsla(0, 0%, 96%, 1); /* stone-100 */
  --cal-bg-primary-emphasis: hsla(0, 0%, 64%, 1); /* stone-800 */
  --cal-bg-primary-muted: hsla(0, 0%, 15%, 1); /* stone-400 */

  /* Background Brand */
  --cal-bg-brand: hsla(0, 0%, 98%, 1); /* gray-50 */
  --cal-bg-brand-emphasis: hsla(0, 0%, 96%, 1); /* stone-100 */
  --cal-bg-brand-muted: hsla(0, 0%, 96%, 1); /* stone-100 */

  /* Background Semantic */
  --cal-bg-semantic-info-subtle: hsla(236, 80%, 8%, 1); /* blue-800 */
  --cal-bg-semantic-info-emphasis: hsla(229, 90%, 74%, 1); /* blue-500 */
  --cal-bg-semantic-success-subtle: hsla(148, 88%, 16%, 1); /* green-800 */
  --cal-bg-semantic-success-emphasis: hsla(158, 74%, 38%, 1); /* green-500 */
  --cal-bg-semantic-attention-subtle: hsla(21, 86%, 8%, 1); /* orange-800 */
  --cal-bg-semantic-attention-emphasis: hsla(27, 96%, 61%, 1); /* orange-500 */
  --cal-bg-semantic-error-subtle: hsla(0, 70%, 8%, 1); /* red-800 */
  --cal-bg-semantic-error-emphasis: hsla(0, 91%, 71%, 1); /* red-500 */

  /* Background Visualization */
  --cal-bg-visualization-1-subtle: hsla(336, 74%, 35%, 1); /* pink-200 */
  --cal-bg-visualization-1-emphasis: hsla(330, 81%, 60%, 1); /* pink-500 */
  --cal-bg-visualization-2-subtle: hsla(252, 83%, 23%, 1); /* purple-200 */
  --cal-bg-visualization-2-emphasis: hsla(256, 85%, 57%, 1); /* purple-500 */
  --cal-bg-visualization-3-subtle: hsla(236, 74%, 35%, 1); /* blue-200 */
  --cal-bg-visualization-3-emphasis: hsla(235, 100%, 63%, 1); /* blue-500 */
  --cal-bg-visualization-4-subtle: hsla(150, 84%, 22%, 1); /* green-200 */
  --cal-bg-visualization-4-emphasis: hsla(158, 74%, 38%, 1); /* green-500 */
  --cal-bg-visualization-5-subtle: hsla(28, 73%, 26%, 1); /* yellow-200 */
  --cal-bg-visualization-5-emphasis: hsla(45, 93%, 47%, 1); /* yellow-500 */
  --cal-bg-visualization-6-subtle: hsla(15, 75%, 23%, 1); /* orange-200 */
  --cal-bg-visualization-6-emphasis: hsla(25, 95%, 53%, 1); /* orange-500 */
  --cal-bg-visualization-7-subtle: hsla(0, 70%, 35%, 1); /* red-200 */
  --cal-bg-visualization-7-emphasis: hsla(0, 84%, 60%, 1); /* red-500 */

  /* Launch Background */
  --cal-bg-launch-dark: hsla(242, 53%, 10%, 1); /* #0D0C27 - Launch card dark background */

  /* Legacy Background Components - Consider deprecating */
  --cal-bg-info: hsla(228, 56%, 33%, 1); /* Keeping existing info background */
  --cal-bg-success: hsla(133, 34%, 24%, 1); /* Keeping existing success background */
  --cal-bg-attention: hsla(16, 62%, 28%, 1); /* Keeping existing attention background */
  --cal-bg-error: hsla(2, 55%, 30%, 1); /* Keeping existing error background */
  --cal-bg-dark-error: hsla(2, 55%, 30%, 1); /* Keeping existing dark error */

  /* Border Standard */
  --cal-border: hsla(0, 0%, 30%, 1); /* stone-600 */
  --cal-border-muted: hsla(0, 0%, 9%, 1); /* stone-500 */
  --cal-border-subtle: hsla(0, 0%, 15%, 1); /* stone-700 */
  --cal-border-emphasis: hsla(0, 0%, 45%, 1); /* stone-800 */
  /* Border Semantic */
  --cal-border-semantic-error: hsla(0, 63%, 24%, 1); /* red-800 */

  /* Legacy Border - Consider deprecating */
  --cal-border-error: hsla(0, 63%, 24%, 1); /* Keeping existing error border */

  /* Content/Text Standard */
  --cal-text-emphasis: hsla(0, 0%, 98%, 1); /* stone-50 */
  --cal-text: hsla(0, 0%, 83%, 1); /* stone-300 */
  --cal-text-subtle: hsla(0, 0%, 64%, 1); /* stone-400 */
  --cal-text-muted: hsla(0, 0%, 64%, 1); /* stone-400 */
  --cal-text-inverted: hsla(0, 0%, 0%, 1); /* black */

  /* Content/Text Semantic */
  --cal-text-semantic-info: hsla(229, 90%, 74%, 1); /* blue-100 */
  --cal-text-semantic-success: hsla(161, 49%, 54%, 1); /* green-100 */
  --cal-text-semantic-attention: hsla(27, 96%, 61%, 1); /* orange-100 */
  --cal-text-semantic-error: hsla(0, 91%, 71%, 1); /* red-100 */

  /* Content/Text Semantic Emphasis */
  --cal-text-semantic-info-emphasis: hsla(217, 91%, 25%, 1); /* blue-800 */
  --cal-text-semantic-success-emphasis: hsla(142, 71%, 25%, 1); /* green-800 */
  --cal-text-semantic-attention-emphasis: hsla(24, 95%, 25%, 1); /* orange-800 */
  --cal-text-semantic-error-emphasis: hsla(0, 84%, 25%, 1); /* red-800 */

  /* Border/Semantic Subtle */
  --cal-border-semantic-attention-subtle: hsla(15, 75%, 23%, 1); 
  --cal-border-semantic-error-subtle: hsla(0, 63%, 24%, 1); 

  /* Legacy Content/Text Components - Consider deprecating */
  --cal-text-info: hsla(218, 83%, 93%, 1); /* Keeping existing info text */
  --cal-text-success: hsla(134, 76%, 94%, 1); /* Keeping existing success text */
  --cal-text-attention: hsla(37, 86%, 92%, 1); /* Keeping existing attention text */
  --cal-text-error: hsla(3, 66%, 93%, 1); /* Keeping existing error text */

  /* Brand */
  --cal-brand: hsla(0, 0%, 100%, 1); /* white */
  --cal-brand-emphasis: hsla(218, 11%, 65%, 1); /* Keeping existing brand emphasis */
  --cal-brand-text: hsla(0, 0%, 0%, 1); /* black */
}

@layer base {
  * {
    @apply border-default
  }
}

::-moz-selection {
  color: var(--cal-brand-text);
  background: var(--cal-brand);
}

::selection {
  color: var(--cal-brand-text);
  background: var(--cal-brand);
}

body  {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/*
  Desktop App specific CSS
    https://docs.todesktop.com/
*/

html.todesktop-platform-win32 .todesktop\:\!bg-transparent{
  background: inherit !important;
}

/* disable user selection on buttons, links and images on desktop app */
html.todesktop button,
html.todesktop a,
html.todesktop img,
html.todesktop header {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default !important;
}

html.todesktop,
html.todesktop div {
  cursor: default !important;
}

/* make header draggable on desktop app */
html.todesktop header {
  -webkit-app-region: drag;
}

html.todesktop header button,
html.todesktop header a {
  -webkit-app-region: no-drag;
}

html.todesktop-platform-darwin body, html.todesktop-platform-darwin aside {
  background: transparent !important;
}

html.todesktop-platform-darwin.dark main.bg-default {
  background: rgba(0, 0, 0, 0.6) !important;
}

html.todesktop-platform-darwin.light main.bg-default {
  background: rgba(255, 255, 255, 0.8) !important;
}

html.todesktop.light {
  --cal-bg-emphasis: hsla(0, 0%, 11%, 0.1);
}

html.todesktop.dark {
  --cal-bg-emphasis: hsla(220, 2%, 26%, 0.3);
}

/*
  Adds Utility to hide scrollbar to tailwind
    https://github.com/tailwindlabs/tailwindcss/discussions/2394
    https://github.com/tailwindlabs/tailwindcss/pull/5732
*/
@layer utilities {
  /* Chrome, Safari and Opera */
  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }

  .no-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }
}

/*
 * Override the default tailwindcss-forms styling (default is: 'colors.blue.600')
 * @see: https://github.com/tailwindlabs/tailwindcss-forms/issues/14#issuecomment-1005376006
 */
[type="text"]:focus,
[type="email"]:focus,
[type="url"]:focus,
[type="password"]:focus,
[type="number"]:focus,
[type="date"]:focus,
[type="datetime-local"]:focus,
[type="month"]:focus,
[type="search"]:focus,
[type="tel"]:focus,
[type="checkbox"]:focus,
[type="radio"]:focus,
[type="time"]:focus,
[type="week"]:focus,
[multiple]:focus,
textarea:focus,
select:focus {
  border-color: var(--cal-border-emphasis);
  box-shadow: 0px 0px 0px 1px rgba(255, 255, 255, 0.20), 0px 0px 0px 2px rgba(0, 0, 0, 0.10);
}

@layer components {
  .scroll-bar {
    @apply scrollbar-thin scrollbar-thumb-rounded-md dark:scrollbar-thumb-darkgray-300 scrollbar-thumb-gray-300 scrollbar-track-transparent;
  }
}

/* TODO: avoid global specific css */
/* button[role="switch"][data-state="checked"] span {
  transform: translateX(16px);
} */

@layer components {
  /* slider */
  .slider {
    @apply relative flex h-4 w-40 select-none items-center;
  }

  .slider > .slider-track {
    @apply relative h-1 flex-grow rounded-md bg-gray-400;
  }

  .slider .slider-range {
    @apply absolute h-full rounded-full bg-gray-700;
  }

  .slider .slider-thumb {
    @apply block h-3 w-3 cursor-pointer rounded-full bg-gray-700 transition-all;
  }

  .slider .slider-thumb:hover {
    @apply bg-gray-600;
  }

  .slider .slider-thumb:focus {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.2);
  }
}

/* hide chat bubble on mobile */
@media only screen and (max-width: 768px) {
  /* Intercom FAB*/
  #launcher {
    display: none !important;
  }

  /* Zendesk FAB*/
  div[role="presentation"] > iframe {
    display: none !important;
  }

  /* Helpscout FAB*/
  .BeaconFabButtonFrame {
    margin-left: -30px;
    left: 50%;
    bottom: 28px !important;
    z-index: 1058 !important;
  }
}

/* TODO: implement styling for react-multi-email */

/* !important to override react-dates */
.DateRangePickerInput__withBorder {
  border: 0 !important;
}
.DateInput_input {
  border: 1px solid #d1d5db !important;
  border-radius: 2px !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  color: #000;
  padding: 11px ​11px 9px !important;
  line-height: 16px !important;
}

.DateInput_input__focused {
  border: 2px solid #000 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  padding: 10px ​10px 9px !important;
}

.DateRangePickerInput_arrow {
  padding: 0px 10px;
}

.loader {
  display: block;
  width: 30px;
  height: 30px;
  margin: 60px auto;
  position: relative;
  border-width: 4px;
  border-style: solid;
  animation: loader 2s infinite ease;
}

.loader-inner {
  vertical-align: top;
  display: inline-block;
  width: 100%;
  animation: loader-inner 2s infinite ease-in;
}

.no-ring-inset {
  --tw-ring-inset: unset;
}

@keyframes loader {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(180deg);
  }

  50% {
    transform: rotate(180deg);
  }

  75% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes loader-inner {
  0% {
    height: 0%;
  }

  25% {
    height: 0%;
  }

  50% {
    height: 100%;
  }

  75% {
    height: 100%;
  }

  100% {
    height: 0%;
  }
}

.text-inverted-important {
  color: white !important;
}

@layer utilities {
  .transition-max-width {
    -webkit-transition-property: max-width;
    transition-property: max-width;
  }
}

#timeZone input:focus {
  box-shadow: none;
}

/* react-date-picker forces a border upon us, cast it away */
.react-date-picker__wrapper {
  border: none !important;
}

.react-date-picker__inputGroup__input {
  padding-top: 0;
  padding-bottom: 0;
}

/* animations */
.slideInBottom {
  animation-duration: 0.3s;
  animation-fill-mode: both;
  animation-name: slideInBottom;
}

@keyframes slideInBottom {
  from {
    opacity: 0;
    transform: translateY(30%);
    pointer-events: none;
  }
  to {
    opacity: 1;
    pointer-events: auto;
  }
}

/* animations */
.slideInTop {
  animation-duration: 0.3s;
  animation-fill-mode: both;
  animation-name: slideInTop;
}

@keyframes slideInTop {
  from {
    opacity: 0;
    transform: translateY(-20%);
    pointer-events: none;
  }
  to {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0%);
  }
}

.fadeIn {
  animation-duration: 0.3s;
  animation-fill-mode: both;
  animation-name: fadeIn;
  animation-timing-function: ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/**
 * Makes sure h-screen works on mobile Safari. By default h-screen
 * does not take into account the height of the address bar, causing
 * weird behaviour when scrolling — sometimes the height will be correct
 * and sometimes it won't, depending on whether the address bar is
 * in 'collapsed' state or not.
 * @see: https://benborgers.com/posts/tailwind-h-screen
 */
@supports (-webkit-touch-callout: none) {
  .h-screen {
    height: -webkit-fill-available;
  }
}

::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.react-tel-input .country-list .country:hover,
.react-tel-input .country-list .country.highlight {
  @apply !bg-emphasis;
}

.react-tel-input .flag-dropdown .selected-flag,
.react-tel-input .flag-dropdown.open .selected-flag {
  @apply !bg-default;
}

.react-tel-input .flag-dropdown {
  @apply !border-r-default left-0.5 !border-y-0 !border-l-0;
}

@import "../../web/styles/tokens.css";

@layer base {
  * {
    @apply border-default
  }
}

::-moz-selection {
  color: var(--cal-brand-text);
  background: var(--cal-brand);
}

::selection {
  color: var(--cal-brand-text);
  background: var(--cal-brand);
}

body  {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/*
  Desktop App specific CSS
    https://docs.todesktop.com/
*/

html.todesktop-platform-win32 .todesktop\:\!bg-transparent{
  background: inherit !important;
}

/* disable user selection on buttons, links and images on desktop app */
html.todesktop button,
html.todesktop a,
html.todesktop img,
html.todesktop header {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default !important;
}

html.todesktop,
html.todesktop div {
  cursor: default !important;
}

/* make header draggable on desktop app */
html.todesktop header {
  -webkit-app-region: drag;
}

html.todesktop header button,
html.todesktop header a {
  -webkit-app-region: no-drag;
}

html.todesktop-platform-darwin body, html.todesktop-platform-darwin aside {
  background: transparent !important;
}

html.todesktop-platform-darwin.dark main.bg-default {
  background: rgba(0, 0, 0, 0.6) !important;
}

html.todesktop-platform-darwin.light main.bg-default {
  background: rgba(255, 255, 255, 0.8) !important;
}

html.todesktop.light {
  --cal-bg-emphasis: hsla(0, 0%, 11%, 0.1);
}

html.todesktop.dark {
  --cal-bg-emphasis: hsla(220, 2%, 26%, 0.3);
}

/*
  Adds Utility to hide scrollbar to tailwind
    https://github.com/tailwindlabs/tailwindcss/discussions/2394
    https://github.com/tailwindlabs/tailwindcss/pull/5732
*/
@layer utilities {
  /* Chrome, Safari and Opera */
  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }

  .no-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }
}

/*
 * Override the default tailwindcss-forms styling (default is: 'colors.blue.600')
 * @see: https://github.com/tailwindlabs/tailwindcss-forms/issues/14#issuecomment-1005376006
 */
[type="text"]:focus,
[type="email"]:focus,
[type="url"]:focus,
[type="password"]:focus,
[type="number"]:focus,
[type="date"]:focus,
[type="datetime-local"]:focus,
[type="month"]:focus,
[type="search"]:focus,
[type="tel"]:focus,
[type="checkbox"]:focus,
[type="radio"]:focus,
[type="time"]:focus,
[type="week"]:focus,
[multiple]:focus,
textarea:focus,
select:focus {
  --tw-ring-color: var(--brand-color);
  border-color: var(--brand-color);
}

@layer components {
  .scroll-bar {
    @apply scrollbar-thin scrollbar-thumb-rounded-md dark:scrollbar-thumb-darkgray-300 scrollbar-thumb-gray-300 scrollbar-track-transparent;
  }
}

/* TODO: avoid global specific css */
/* button[role="switch"][data-state="checked"] span {
  transform: translateX(16px);
} */

@layer components {
  /* slider */
  .slider {
    @apply relative flex h-4 w-40 select-none items-center;
  }

  .slider > .slider-track {
    @apply relative h-1 flex-grow rounded-md bg-gray-400;
  }

  .slider .slider-range {
    @apply absolute h-full rounded-full bg-gray-700;
  }

  .slider .slider-thumb {
    @apply block h-3 w-3 cursor-pointer rounded-full bg-gray-700 transition-all;
  }

  .slider .slider-thumb:hover {
    @apply bg-gray-600;
  }

  .slider .slider-thumb:focus {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.2);
  }
}

/* hide chat bubble on mobile */
@media only screen and (max-width: 768px) {
  /* Intercom FAB*/
  #launcher {
    display: none !important;
  }

  /* Zendesk FAB*/
  div[role="presentation"] > iframe {
    display: none !important;
  }

  /* Helpscout FAB*/
  .BeaconFabButtonFrame {
    margin-left: -30px;
    left: 50%;
    bottom: 28px !important;
    z-index: 1058 !important;
  }
}

/* TODO: implement styling for react-multi-email */

/* !important to override react-dates */
.DateRangePickerInput__withBorder {
  border: 0 !important;
}
.DateInput_input {
  border: 1px solid #d1d5db !important;
  border-radius: 2px !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  color: #000;
  padding: 11px ​11px 9px !important;
  line-height: 16px !important;
}

.DateInput_input__focused {
  border: 2px solid #000 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  padding: 10px ​10px 9px !important;
}

.DateRangePickerInput_arrow {
  padding: 0px 10px;
}

.loader {
  display: block;
  width: 30px;
  height: 30px;
  margin: 60px auto;
  position: relative;
  border-width: 4px;
  border-style: solid;
  animation: loader 2s infinite ease;
}

.loader-inner {
  vertical-align: top;
  display: inline-block;
  width: 100%;
  animation: loader-inner 2s infinite ease-in;
}

.no-ring-inset {
  --tw-ring-inset: unset;
}

@keyframes loader {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(180deg);
  }

  50% {
    transform: rotate(180deg);
  }

  75% {
    transform: rotate(360deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes loader-inner {
  0% {
    height: 0%;
  }

  25% {
    height: 0%;
  }

  50% {
    height: 100%;
  }

  75% {
    height: 100%;
  }

  100% {
    height: 0%;
  }
}

.text-inverted-important {
  color: white !important;
}

@layer utilities {
  .transition-max-width {
    -webkit-transition-property: max-width;
    transition-property: max-width;
  }
}

#timeZone input:focus {
  box-shadow: none;
}

/* react-date-picker forces a border upon us, cast it away */
.react-date-picker__wrapper {
  border: none !important;
}

.react-date-picker__inputGroup__input {
  padding-top: 0;
  padding-bottom: 0;
}

/* animations */
.slideInBottom {
  animation-duration: 0.3s;
  animation-fill-mode: both;
  animation-name: slideInBottom;
}

@keyframes slideInBottom {
  from {
    opacity: 0;
    transform: translateY(30%);
    pointer-events: none;
  }
  to {
    opacity: 1;
    pointer-events: auto;
  }
}

/* animations */
.slideInTop {
  animation-duration: 0.3s;
  animation-fill-mode: both;
  animation-name: slideInTop;
}

@keyframes slideInTop {
  from {
    opacity: 0;
    transform: translateY(-20%);
    pointer-events: none;
  }
  to {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0%);
  }
}

.fadeIn {
  animation-duration: 0.3s;
  animation-fill-mode: both;
  animation-name: fadeIn;
  animation-timing-function: ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/**
 * Makes sure h-screen works on mobile Safari. By default h-screen
 * does not take into account the height of the address bar, causing
 * weird behaviour when scrolling — sometimes the height will be correct
 * and sometimes it won't, depending on whether the address bar is
 * in 'collapsed' state or not.
 * @see: https://benborgers.com/posts/tailwind-h-screen
 */
@supports (-webkit-touch-callout: none) {
  .h-screen {
    height: -webkit-fill-available;
  }
}

::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.react-tel-input .country-list .country:hover,
.react-tel-input .country-list .country.highlight {
  @apply !bg-emphasis;
}

.react-tel-input .flag-dropdown .selected-flag,
.react-tel-input .flag-dropdown.open .selected-flag {
  @apply !bg-default;
}

.react-tel-input .flag-dropdown {
  @apply !border-r-default left-0.5 !border-y-0 !border-l-0;
}

.prose :where(a:not([data-card])):not(:where([class~="not-prose"] *)) {
  text-decoration: none;
}
