/*
 * Variables
 */
$font-family: 'Open Sans', sans-serif;
$black: #000;
$white: #fff;

/*
 * Mixins
 */
@mixin vendor-prefix($property, $value) {
  -webkit-#{$property}: #{$value};
  -moz-#{$property}: #{$value};
  -ms-#{$property}: #{$value};
  -o-#{$property}: #{$value};
  #{$property}: #{$value};
}

@mixin keyframes($name){
  @-webkit-keyframes #{$name} {
    @content;
  }
  @-moz-keyframes #{$name} {
    @content;
  }
  @-ms-keyframes #{$name} {
    @content;
  }
  @-o-keyframes #{$name} {
    @content;
  }
  @keyframes #{$name} {
    @content;
  }
}

/*
 * Styling
 */
.wbounce-modal {
  font-family: $font-family;
  display: none;
  position: fixed;
  text-align: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  overflow: scroll;
  @include vendor-prefix( box-sizing, border-box );
  @include vendor-prefix( transform-style, preserve-3d );  // prevent elements from being "blurry" when a child uses "transform" (http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/)

  * {
    @include vendor-prefix( box-sizing, border-box );
  }

  &.underlay {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba($black,0.5);
    cursor: pointer;
  }

  // @TODO
  // &.animate {
  //   &.linear {
  //     &.underlay, .wbounce-modal-sub {
  //       @include vendor-prefix( animation, fadein 0.3s );
  //     }
  //   }
  //   &.bottom-middle {
  //     .wbounce-modal-sub {
  //       top: 50%;
  //       @include vendor-prefix( animation, popin 0.3s );
  //       @include vendor-prefix( transform, translateY(-50%) );
  //     }
  //   }
  // }

  .wbounce-modal-sub {
    display: block;
    position: relative;
    top: 50%;
    opacity: 1;
    overflow: scroll;
    max-width: 95%;
    max-height: 95%;
    width: 600px;
    background-color: #f0f1f2;
    z-index: 21;
    margin: auto;
    border-radius: 4px;
    @include vendor-prefix( transform, translateY(-50%) );
  }

  .modal-title {
    font-size: 18px;
    background-color: #252525;
    color: $white;
    padding: 10px;
    margin: 0;
    border-radius: 4px 4px 0 0;
    text-align: center;
  }

  .modal-body {
    padding: 20px 35px;
    font-size: 0.9em;
  }

  h3 {
    color: $white;
    font-size: 1em;
    margin: 0.2em;
    text-transform: uppercase;
    font-weight: 500;
  }

  h4 {
    font-size: 1.25em;
    margin: 10px 0;
    a {
      text-decoration: none;
    }
  }

  p {
    line-height: 1.4em;
    color: #344a5f;
  }

  form {
    text-align: center;
    margin-top: 35px;
    
    p {
      text-align: left;
      margin-left: 35px;
      opacity: 0.8;
      margin-top: 1px;
      padding-top: 1px;
      font-size: 0.9em;
    }

    input[type=email] {
        color: #999;
        padding: 12px;
        font-size: 15px;
        width: 300px;
        border-radius: 4px;
        border: 1px solid #ccc;
        -webkit-font-smoothing: antialiased;
      }

    input[type=text] {
      padding: 12px;
      font-size: 1.2em;
      width: 300px;
      border-radius: 4px;
      border: 1px solid #ccc;
      -webkit-font-smoothing: antialiased;
    }

    input[type=submit] {
      text-transform: uppercase;
      font-weight: bold;
      padding: 12px;
      font-size: 14px;
      border-radius: 4px;
      color: $white;
      background-image: none;
      background-color: #4ab471;
      border: none;
      cursor: pointer;
      -webkit-font-smoothing: antialiased;
    }
  }

  .byline, .updated {
    display: block;
  }

  .modal-footer {
    position: relative;
    text-align: center;
    width: 100%;
    padding: 10px 0 20px;

    p {
      text-transform: capitalize;
      cursor: pointer;
      display: inline;
      border-bottom: 1px solid #344a5f;
    }
  }
}

/*
 * Fixes for users with visible admin bar
 */
.admin-bar {
  .wbounce-modal {
    padding-top: 32px;
  }
}

/*
 * General includes
 */
@include keyframes( fadein ) {
  0% { opacity: 0; }
  100% { opacity: 1; }
};

// @include keyframes( popin ) {
//   0% {
//     -webkit-transform: scale(0);
//     transform: scale(0);
//     opacity: 0;
//   }
//   85% {
//     -webkit-transform: scale(1.05);
//     transform: scale(1.05);
//     opacity: 1;
//   }
//   100% {
//     -webkit-transform: scale(1);
//     transform: scale(1);
//     opacity: 1;
//   }
// };