/* Browser Action Popup
 */

@import "~bootstrap/dist/css/bootstrap.css";

:root {
  --bs-border-radius: 3px;
  --green: #37c837;
  --yellow: #ffcc00;
  --blue: #0d7af6;
}

html {
  font-size: 14px;
}

body {
  background-color: var(--bs-tertiary-bg);
}

@media (min-width: 42em) {
  body {
    padding: 2em;
    min-height: 100%;
  }
}

p {
  margin-bottom: .8rem;
}

small {
  font-size: 85%;
}

label {
  font-weight: 700;
}

.popup-container {
  /* browser action width */
  width: 22em;
  min-height: 250px;
  margin: 0 auto;
  background-color: var(--bs-body-bg);
}

@media (min-width: 22em) {
  .popup-container {
    /* small screen width */
    width: 100%;
  }
}

@media (min-width: 42em) {
  .popup-container {
    /* full screen width */
    width: 28em;
    border-radius: 4px;
    box-shadow: 0 10px 8px -4px rgb(0 0 0 / 5%);
  }
}

.popup-box {
  padding: 1em;
}

/* bootstrap
 */
a,
.btn-link {
  text-decoration: none;
}

a:hover,
.btn-link:hover {
  text-decoration: underline;
}

.btn,
.alert,
.form-control {
  border-radius: var(--bs-border-radius);
}

.btn,
.alert {
  border: 0;
}

.alert {
  font-weight: bold;
}

.btn {
  overflow: hidden;
}

.btn-primary {
  background-color: #0983fa;
}

.btn-primary:hover {
  background-color: #0483ff;
}

.btn-success {
  background-color: #02c38d;
  box-shadow: 0 4px 6px 0 rgba(50,50,93,0.11), 1px 1px 3px 0 rgba(0,0,0,0.08);

  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

.btn-success:hover {
  background-color: #06d79c;

  text-decoration: none;
}

.btn-success:active,
.btn-success:focus {
  background-color: #00a576 !important;
}

.btn-lg {
  padding-left: 2em;
  padding-right: 2em;
}

/* forms
 */

.btn-forgot {
  padding: 0;
}

/* loading button
 */
.block-loading,
.btn-loading {
  overflow: hidden;
  position: relative;
  pointer-events: none;

  --loader: #fff;
  --background: rgba(0,0,0,.6);
}

.block-loading {
  --loader: #777;
  --background: rgba(255,255,255,.9);
}

.block-loading:before,
.btn-loading:before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: var(--background);
}

.block-loading:after,
.btn-loading:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  z-index: 3;
  display: block;
  width: 12px;
  height: 12px;
  border-color: var(--loader) var(--loader) var(--loader) transparent;
  border-style: solid;
  border-width: 2px 2px 2px 2px;
  border-radius: 20px;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  0% {
    rotate: 0;
  }
  100% {
    rotate: 360deg;
  }
}

/* popup-dashboard
 */
.popup-logo {
  border-bottom: 1px solid var(--bs-tertiary-bg);
}

.popup-menu {
  margin: 1em 0;
}

.team-selector {
  padding: .6em 1em;
}

.popup-menu a {
  display: flex;
  align-items: center;
  padding: .6em 1em;

  font-size: 1.2em;
  line-height: 1.3;
  text-decoration: none;
}

.popup-menu a:hover {
  background-color: var(--bs-tertiary-bg);

  text-decoration: none;
}

.popup-menu .icon {
  display: inline-flex;
  margin-right: .8em;
  transition: all .1s ease-out;

  color: #918992;
}

.popup-menu a:hover .icon {
  transform: scale(1.4);
  color: var(--blue);
}

.popup-stats {
  min-height: 60px;
  padding: 1.4em 1em;
  background: linear-gradient(345deg, #0575e1 0%, #0983fa 100%);

  color: #fff;
  text-align: center;
}

.label-upgrade {
  font-style: italic;
}

.btn-upgrade {
  padding: .6em 2em;

  font-weight: bold;
}

.popup-status {
  display: flex;
  overflow: hidden;

  font-size: 12px;
}

.popup-user,
.btn-logout {
  padding-top: .4em;
  padding-bottom: .4em;
  padding-right: 0;

  color: var(--bs-secondary-color);
  font-size: inherit;
}

.btn-logout {
  min-width: 5em;
  border: 0;
  margin-left: auto;

  white-space: nowrap;
}

.popup-user {
  position: relative;
  overflow: hidden;
  padding-left: 1em;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.popup-user:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);

  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: .4em;
  background-color: var(--green);
  border-radius: 100%;
}

.label-premium {
  padding: .1em .4em;
  margin: .3em 0 .3em .4em;
  background-color: var(--yellow);
  border-radius: 3px;

  color: #3c3000;
  font-weight: bold;
  cursor: default;
}

/* sync button
 */
.btn-sync {
  display: flex;
  margin-top: auto;
  margin-bottom: auto;
  padding: 3px;
  border: 0;
  border-radius: 100%;
  background-color: var(--green);
  transition: background-color .5s ease-out;

  color: #fff;
}

.btn-sync-loading {
  background-color: var(--yellow);
}

.btn-sync-loading svg {
  animation: spin .5s linear infinite;
}

/* premium and free stats
 */

.popup-stats-details {
  display: none;
}

.popup-premium .popup-stats-premium,
.popup-free .popup-stats-free {
  display: block;
}

/* hide website and registration links
 * (eg. on safari)
 */

.popup-register-disabled .popup-logo a,
.popup-register-disabled .popup-user {
  pointer-events: none;
}

.popup-register-disabled .popup-label-register,
.popup-register-disabled .btn-forgot,
.popup-register-disabled .popup-menu {
  display: none;
}

/* always show the premium stats on safari
 */

.popup-register-disabled .popup-stats-free {
  display: none;
}

.popup-register-disabled .popup-stats-premium {
  display: block;
}
