$grey-color: #f5f5f5;
$slightly-darker-grey-color: #eee;
$dark-grey-color: #bbb;
$active-color: #08c;
$in-range-color: rgba($active-color, 0.1);
$green-color: #38A551;
$border-radius: 4px;

@mixin button-sizing {
  margin: 0;
  padding: 4px 9px;
}

.daterangepicker {
  display: none;
  position: absolute;
  background: white;
  box-shadow: 0 2px 15px rgba(black, 0.3);
  justify-content: flex-start;
  border-radius: $border-radius;
  padding: 4px;
  font-size: 13px;
  font-family: sans-serif;
  line-height: 1.5em;

  // reset
  ul, li, button, form {
    padding: 0;
    margin: 0;
    border: 0;
    list-style: none;
    outline: none;
  }

  .controls {
    min-width: 180px;
    margin: 4px;
  }

  .periods,
  .ranges {
    li {
      @include button-sizing;

      margin: 0;
      background: $grey-color;
      color: $active-color;
      cursor: pointer;

      &:hover,
      &.active {
        background: $active-color;
        color: white;
      }
    }
  }

  .periods {
    display: inline-flex;
    margin: 0 auto 8px;

    li {
      &:first-child {
        border-radius: $border-radius 0 0 $border-radius;
      }

      &:last-child {
        border-radius: 0 $border-radius $border-radius 0;
      }
    }
  }

  .ranges {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    li {
      border-radius: $border-radius;
      margin-bottom: 8px;
      text-align: left;
    }
  }

  $m: 3px;

  .custom-range-inputs {
    display: flex;
    margin: - $m;
    margin-bottom: 8px - $m;

    input {
      min-width: 50px;
      width: 50px;
      flex: 1;
      margin: $m;
      border-radius: $border-radius;
      border: 1px solid #ccc;
      height: auto;
      padding: 0.5em;
      font-size: 13px;
      color: #333;
    }
  }

  .custom-range-buttons {
    display: flex;
    margin: - $m;

    button {
      @include button-sizing;

      margin: $m;

      border-radius: $border-radius;
      background: $grey-color;
      color: $active-color;

      &:hover {
        background: darken($grey-color, 10%);
      }

      &.apply-btn {
        background: $green-color;
        color: white;

        &:hover {
          background: darken($green-color, 10%);
        }
      }
    }
  }

  .arrow-left,
  .arrow-right {
    display: inline-block;
    position: relative;
    background-color: #333;
    width: 7px;
    height: 3px;
    margin-bottom: 2px;
    vertical-align: middle;

    &:before {
      content: '';
      display: block;
      position: absolute;
      border: 5px solid transparent;
    }
  }

  .arrow-left {
    margin-left: 5px;

    &:before {
      border-right-width: 6px;
      border-right-color: #333;
      transform: translate(-10px, -3.5px);
    }
  }

  .arrow-right {
    margin-right: 5px;

    &:before {
      border-left-width: 6px;
      border-left-color: #333;
      transform: translate(6px, -3.5px);
    }
  }
}

@import 'daterangepicker/arrows';
@import 'daterangepicker/selects';
@import 'daterangepicker/calendar';
@import 'daterangepicker/modifiers';
