// NOTE TO CONSUMERS: The code and variables in these source files are not considered stable and can change at any time, even in minor and patch releases!
@use "sass:color";
@use '@uppy/core/src/_utils.scss';
@use '@uppy/core/src/_variables.scss';
@use 'style/uppy-ProviderBrowser-viewType--grid';
@use 'style/uppy-ProviderBrowser-viewType--list';
@use 'style/uppy-ProviderBrowserItem-checkbox';
@use 'style/uppy-SearchProvider-input.scss';

.uppy-DashboardContent-panelBody {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;

  [data-uppy-theme='dark'] & {
    background-color: variables.$gray-900;
  }
}

.uppy-Provider-auth,
.uppy-Provider-error,
.uppy-Provider-loading,
.uppy-Provider-empty {
  display: flex;
  flex: 1;
  flex-flow: column wrap;
  align-items: center;
  justify-content: center;
  color: variables.$gray-500;
}

.uppy-Provider-empty {
  color: variables.$gray-500;
}

.uppy-Provider-authIcon svg {
  width: 100px;
  height: 75px;
}

.uppy-Provider-authTitle {
  max-width: 500px;
  margin-bottom: 30px;
  padding: 0 15px;
  color: variables.$gray-600;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.4;
  text-align: center;

  .uppy-size--md & {
    font-size: 20px;
  }

  [data-uppy-theme='dark'] & {
    color: variables.$gray-300;
  }
}

.uppy-Provider-btn-google {
  display: flex;
  align-items: center;
  padding: 8px 12px !important;
  background: #4285f4;

  &:hover {
    background-color: color.adjust(#4285f4, $lightness: -10%);
  }

  &:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(#4285f4, 0.4);
  }

  svg {
    margin-right: 8px;
  }
}

.uppy-Provider-breadcrumbs {
  flex: 1;
  margin-bottom: 10px;
  color: variables.$gray-700;
  font-size: 12px;
  text-align: start;

  .uppy-size--md & {
    margin-bottom: 0;
  }

  [data-uppy-theme='dark'] & {
    color: variables.$gray-200;
  }
}

.uppy-Provider-breadcrumbsIcon {
  display: inline-block;
  color: variables.$gray-700;
  line-height: 1;
  vertical-align: middle;
  margin-inline-end: 4px;
}

.uppy-Provider-breadcrumbsIcon svg {
  width: 13px;
  height: 13px;
  fill: variables.$gray-700;
}

.uppy-Provider-breadcrumbs button {
  @include utils.highlight-focus;

  display: inline-block;
  // for focus
  padding: 4px;
  line-height: inherit;
  border-radius: 3px;

  &:not(:last-of-type) {
    text-decoration: underline;
  }

  &:last-of-type {
    color: variables.$gray-800;
    font-weight: 500;
    cursor: normal;
    pointer-events: none;
  }

  &:hover {
    cursor: pointer;
  }

  [data-uppy-theme='dark'] & {
    color: variables.$gray-200;
  }
}
// ...uppy-Provider-breadcrumbs|

.uppy-ProviderBrowser {
  display: flex;
  flex: 1;
  flex-direction: column;
  height: 100%;
  font-weight: 400;
  font-size: 14px;
}

.uppy-ProviderBrowser-user {
  margin: 0 8px 0 0;
  color: variables.$gray-800;
  font-weight: 500;

  [data-uppy-theme='dark'] & {
    color: variables.$gray-200;
  }
}

.uppy-ProviderBrowser-user::after {
  position: relative;
  color: variables.$gray-500;
  font-weight: normal;
  content: '\00B7';
  inset-inline-start: 4px;
}

.uppy-ProviderBrowser-header {
  position: relative;
  z-index: variables.$zIndex-2;
  border-bottom: 1px solid variables.$gray-200;

  [data-uppy-theme='dark'] & {
    border-bottom: 1px solid variables.$gray-800;
  }
}

.uppy-ProviderBrowser-headerBar {
  z-index: variables.$zIndex-2;
  padding: 7px 15px;
  color: variables.$gray-600;
  font-size: 12px;
  line-height: 1.4;
  background-color: variables.$gray-50;

  .uppy-size--md & {
    display: flex;
    align-items: center;
  }

  [data-uppy-theme='dark'] & {
    background-color: variables.$gray-900;
  }
}

.uppy-ProviderBrowser-headerBar--simple {
  display: block;
  justify-content: center;
  text-align: center;
}

.uppy-ProviderBrowser-headerBar--simple .uppy-Provider-breadcrumbsWrap {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}

// Search

.uppy-ProviderBrowser-searchFilter {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 30px;
  padding-left: 8px;
  padding-right: 8px;
  margin-top: 15px;
  margin-bottom: 15px;
}

.uppy-ProviderBrowser-searchFilterInput {
  z-index: variables.$zIndex-2;
  width: 100%;
  height: 30px;
  font-size: 13px;
  font-family: variables.$font-family-base;
  line-height: 1.4;
  background-color: variables.$gray-200;
  border: 0;
  border-radius: 4px;
  outline: 0;
  padding-inline-start: 30px;
  padding-inline-end: 30px;
  color: variables.$gray-800;

  &::-webkit-search-cancel-button {
    display: none;
  }

  [data-uppy-theme='dark'] & {
    color: variables.$gray-200;
    background-color: variables.$gray-900;
  }
}

.uppy-ProviderBrowser-searchFilterInput:focus {
  background-color: variables.$gray-300;
  border: 0;

  [data-uppy-theme='dark'] & {
    background-color: variables.$gray-800;
  }
}

.uppy-ProviderBrowser-searchFilterIcon {
  position: absolute;
  z-index: variables.$zIndex-3;
  width: 12px;
  height: 12px;
  color: variables.$gray-600;
  inset-inline-start: 16px;
}

.uppy-ProviderBrowser-searchFilterInput::placeholder {
  color: variables.$gray-500;
  opacity: 1;
}

.uppy-ProviderBrowser-searchFilterReset {
  @include utils.blue-border-focus;
  border-radius: 3px;
  position: absolute;
  z-index: variables.$zIndex-3;
  width: 22px;
  height: 22px;
  padding: 6px;
  color: variables.$gray-500;
  cursor: pointer;
  inset-inline-end: 16px;

  &:hover {
    color: variables.$gray-600;
  }

  svg {
    vertical-align: text-top;
  }
}

.uppy-ProviderBrowser-userLogout {
  @include utils.highlight-focus;
  // for focus
  padding: 4px;
  color: variables.$blue;
  line-height: inherit;
  border-radius: 3px;
  cursor: pointer;

  &:hover {
    text-decoration: underline;
  }

  [data-uppy-theme='dark'] & {
    color: variables.$gray-200;
  }
}

.uppy-ProviderBrowser-body {
  position: relative;
  flex: 1;
}

.uppy-ProviderBrowser-list {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  flex: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  background-color: variables.$white;
  border-spacing: 0;
  -webkit-overflow-scrolling: touch;

  [data-uppy-theme='dark'] & {
    background-color: variables.$gray-900;
  }

  &:focus {
    outline: none;
  }
}

.uppy-ProviderBrowserItem-inner {
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
}

.uppy-ProviderBrowser-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  background-color: variables.$white;
  border-top: 1px solid variables.$gray-200;

  & button {
    margin-inline-end: 8px;
  }

  [data-uppy-theme='dark'] & {
    background-color: variables.$gray-900;
    border-top: 1px solid variables.$gray-800;
  }
}

.uppy-ProviderBrowser-footer-buttons {
  flex-shrink: 0;
}

.uppy-ProviderBrowser-footer-error {
  color: variables.$red;
  line-height: 18px;
}

@media (max-width: 426px) {
  .uppy-ProviderBrowser-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .uppy-ProviderBrowser-footer-error {
    padding-bottom: 10px;
  }
}

/* https://stackoverflow.com/a/33082658/6519037 */
.picker-dialog-bg {
  z-index: 20000 !important;
}
.picker-dialog {
  z-index: 20001 !important;
}
