/* Base/Custom */

#loading {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  transition: all 200ms ease-in-out;
  visibility: visible;
  opacity: 1;

  svg path, svg rect {
    fill: rgba(255, 255, 255, 0.8);
  }

  &.hide {
    opacity: 0;
    visibility: hidden;
  }
}

.swal2-html-container {
  .text {
    color: #aaa;
  }

  .input-wrapper > label {
    color: #999;
  }

  .input-wrapper input[type='text'],
  .input-wrapper input[type='date'],
  .input-wrapper input[type='datetime'],
  .input-wrapper input[type='email'],
  .input-wrapper input[type='number'],
  .input-wrapper input[type='search'],
  .input-wrapper input[type='time'],
  .input-wrapper input[type='url'],
  .input-wrapper input[type='password'],
  .input-wrapper textarea,
  .input-wrapper select {
    border-color: #ddd;

    &:focus {
      border-color: #aaa;
    }
  }
}

// Index

.expense-item,
.budget-item {
  display: flex;
  flex: 1;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.5rem;
  border-radius: 3px;
  box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  background-color: #f0f0f0;
  margin: 0.5rem;
  cursor: pointer;
  min-width: 200px;

  &:hover {
    box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.3);
  }

  article {
    display: flex;
    flex: 1;
    flex-direction: column;
    text-align: left;

    span {
      color: #333;
      font-size: 0.9rem;
      font-weight: normal;
      text-align: left;
      margin-top: 5px;

      &.cost {
        font-size: 1rem;
        font-weight: bold;
        margin-top: 0;
      }
    }
  }
}

.budget-item article {
  flex-grow: 2;
}

.expense-item span.description {
  color: #333;
  font-size: 1rem;
  font-weight: normal;
  text-align: left;
  flex: 1;
  flex-grow: 2;
}

.budget-item.total {
  background-color: #fff;
  cursor: inherit;
}

.budget-item span.missing {
  color: #666;
  text-align: right;
  flex: 1;
  font-size: 1rem;
}

.budget-item span.missing-bar {
  background-color: #ccc;
  width: 100%;
  content: '';
  display: block;
  height: 0.5rem;
  border-radius: 0.5rem;
  padding: 0;
  margin: 0.5rem 0;

  span {
    width: 0%;
    content: '';
    display: block;
    background-color: #80a881;
    height: 0.5rem;
    border-radius: 0.5rem;
    padding: 0;
    margin: 0;
  }
}

.expense-item time {
  color: #666;
  font-size: 0.9rem;
  font-weight: normal;
  text-align: right;
  text-transform: uppercase;
}

#expense-description-autocomplete-suggestions {
  display: flex;
  position: absolute;
  z-index: 10;
  padding: 0;
  border-radius: 3px;
  box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  background-color: #efefef;
  margin: 0.5rem;
  min-width: 250px;
  max-width: 275px;
  flex-direction: column;
  overflow: auto;
  max-height: 130px;

  span {
    padding: 0.5rem;
    display: block;
    color: var(--color-background);
    cursor: pointer;

    &:hover {
      background-color: #ddd !important;
    }

    &:nth-child(2n+1) {
      background-color: #fff;
    }

    &:first-child {
      border-radius: 3px 3px 0 0;
    }

    &:last-child {
      border-radius: 0 0 3px 3px;
    }
  }
}

#swap-accounts-select {
  box-sizing: border-box;
  width: auto;
  max-width: 120px;
  display: block;
  outline: none;
  border: none;
  font-size: 0.9rem;
  padding: 0.25rem 0.25rem;
  border: 1px solid #fff;
  background: #fff;
  border-radius: 3px;
  transition: all 80ms ease-in-out;
  text-overflow: ellipsis;
  margin: 0 0.5rem;
}
