@import "shared";

.eic-modal {
  display: none;

  .eic-modal-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: 400;

    &.eic-modal-title-right {
      float: right;
    }
  }
}

.eic-lightbox {
  z-index: 100000; // WP Admin bar is 99999
  background: rgba(0, 0, 0, .8); // To fix problem with Media Modal

  .eic-lightbox-content {
    width: 80%;
    height: 90%;
  }

  .eic-modal {
    display: block;
  }
}

.eic-layouts {
  .eic-frame {
    display: inline-block;

    width: 100px;
    height: 100px;

    margin: 10px;

    border: 1px solid #444;

    .eic-image {
      border: 1px solid #444;
    }

    .eic-image-size {
      display: none;
    }

    .eic-image-controls {
      display: none;
    }

    &.eic-frame-custom {
      span {
        position: absolute;
        text-align: center;
        left: 0;
        right: 0;

        &:nth-child(1) {
          top: 10px;
          font-weight: bold;
        }
        &:nth-child(2) {
          bottom: 0;
          font-size: 12px;
        }
      }
    }

    &:hover {
      outline: #3498db solid 2px;
      cursor: pointer;
    }
  }

  .eic-custom-layouts {
    display: none;
  }
}

.eic-editing, .eic-creating {
  .eic-image:hover {
    .eic-image-controls {
      display: block;
    }
  }
}

.eic-editing {
  .eic-properties {
    margin: 10px auto;
    max-width: 500px;

    .slider-value-container {
      display: inline-block;
      vertical-align: top;
      padding-top: 2px;
    }

    #grid-width-minus, #grid-width-plus {
      vertical-align: top;
      cursor: pointer;
      font-size: 18px;
      display: inline-block;
      padding-top: 1px;
    }

    #grid-width-plus {
      font-size: 16px;
      padding-top: 3px;
    }

    #grid-width-slider {
      display: inline-block;
      width: 400px;
    }

    #grid-ratio-slider, #border-width-slider {
      display: inline-block;
      width: 200px;
    }

    #grid-align {
      margin-left: 25px;
      width: 220px;
    }

    #image-size {
      margin-left: 10px;
    }

    .wp-picker-container {
      line-height: 27px;
      margin-left: 10px;
    }

    .wp-picker-input-wrap {
      position: absolute;
    }

    .wp-picker-holder {
      z-index: 10;
      position: absolute;
    }
  }

  .eic-frame {
    width: 500px;
    height: 500px;

    .eic-image {
      &:not(.has-image) {
        background: url(../img/no-image.png) repeat !important;

        .eic-image-control-manipulate,
        .eic-image-control-link,
        .eic-image-control-caption {
          display: none;
        }
      }

      &.has-image {
        cursor: move;
      }
    }

    .eic-divider {
      display: none;
      position: absolute;
      z-index: 10;

      background-color: #333;
      border: 1px solid white;
    }

    .eic-image-size {
      display: none;
    }

    .eic-image-controls {
      display: none;

      .eic-image-control {
        display: inline-block;

        height: 30px;
        width: 30px;
        margin: 5px;

        background-color: #3498db;
        color: white;

        text-align: center;
        line-height: 30px;
        font-size: 16px;

        &:hover {
          background-color: #2980b9;
          cursor: pointer;
        }
      }

      .eic-image-control-split-rows,
      .eic-image-control-split-cols {
        display: none;
      }
    }
  }

  .eic-premium-only {
    display: none;
  }
}

.eic-property-header {
  display: block;
  font-weight: bold;
  font-size: 14px;
}

.eic-creating {
  .creating-image-preview {
    text-align: center;
  }

  .eic-placeholder {
    display: none;
  }

  .eic-frame {
    width: 500px;
    height: 500px;

    border: 3px solid #444;

    .eic-image {
      border: 3px solid #444;
      background: url(../img/no-image.png) repeat !important;
    }

    .eic-image-size {
      display: inline-block !important;
    }

    .eic-image-controls {
      display: none;

      .eic-image-control {
        display: inline-block;

        height: 30px;
        width: 30px;
        margin: 5px;

        background-color: #3498db;
        color: white;

        text-align: center;
        line-height: 30px;
        font-size: 16px;

        &:hover {
          background-color: #2980b9;
          cursor: pointer;
        }
      }

      .eic-image-control-image,
      .eic-image-control-manipulate,
      .eic-image-control-link,
      .eic-image-control-caption {
        display: none;
      }
    }

    .eic-divider {
      position: absolute;
      z-index: 10;

      background-color: #333;
      border: 1px solid white;
    }
  }
}

.eic-manipulating {
  .manipulating-image-preview {
    text-align: center;
  }

  .eic-manipulating-filters-placeholder, .eic-manipulating-properties-placeholder {
    display: none;
  }

  table {
    width: 90%;
    margin: 40px auto;

    td {
      vertical-align: top;
    }

    .eic-manipulating-filters {
      padding-bottom: 15px;

      .eic-manipulating-filter {
        display: inline-block;
        border: 1px solid #0073aa;
        color: #0073aa;
        padding: 3px 8px;
        margin: 5px 5px 0 0;

        &.active {
          background-color: #0073aa;
          color: white;
        }

        &:hover {
          cursor: pointer;
          color: black;
        }
      }
    }

    .eic-manipulating-image {
      text-align: center;

      img, canvas {
        max-width: 100% !important;
        height: auto !important;
      }
    }

    .eic-manipulating-properties {
      width: 310px;
      padding-left: 40px;

      .eic-property-label {
        font-size: 12px;
        line-height: 12px;
        margin-top: 2px;
        display: block;
      }

      .slider, .eic-slider {
        display: inline-block;
        width: 260px;
      }

      .eic-slider-value {
        display: inline-block;
        vertical-align: top;
      }
    }
  }
}

.eic-links {
  .custom-links-preview {
    text-align: center;
  }

  .eic-links-images {
    max-width: 650px;
    width: 100%;
    clear: both;
    margin: 0 auto;
    border: 0;

    td {
      &:nth-child(1) {
        width: 200px;
        height: 100px;
        text-align: center;
      }
    }

    img {
      max-width:200px;
      max-height: 100px;
    }

    .eic-links-images-link {
      width: 100%;
    }

    .eic-links-images-link-nofollow {
      margin-left: 25px;
    }
  }
}

.eic-captions {
  .captions-preview {
    text-align: center;
  }

  .eic-captions-images {
    max-width: 650px;
    width: 100%;
    clear: both;
    margin: 0 auto;
    border: 0;

    td {
      &:nth-child(1) {
        width: 200px;
        height: 100px;
        text-align: center;
      }
    }

    img {
      max-width:200px;
      max-height: 100px;
    }

    .eic-captions-images-caption {
      width: 100%;
    }
  }
}

.eic-image-size {
  display: inline-block;
  padding: 3px;
  background-color: rgba(255,255,255,0.5);
  color: black;
}

.eic-premium-only {
  margin: 10px auto;
  max-width: 500px;

  text-align: center;
  padding: 5px;
  border: 1px dashed darkred;
  color: darkred;

  a {
    font-weight: bold;
    color: darkred;
  }
}

// Spinner

.eic-spinner {
  display: none;
  margin: 0 auto;
  width: 50px;
  height: 30px;
  text-align: center;
  font-size: 10px;
}

.eic-spinner > div {
  background-color: #333;
  height: 100%;
  margin: 0 1px;
  width: 3px;
  display: inline-block;

  -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
  animation: stretchdelay 1.2s infinite ease-in-out;
}

.eic-spinner .rect2 {
  -webkit-animation-delay: -1.1s;
  animation-delay: -1.1s;
}

.eic-spinner .rect3 {
  -webkit-animation-delay: -1.0s;
  animation-delay: -1.0s;
}

.eic-spinner .rect4 {
  -webkit-animation-delay: -0.9s;
  animation-delay: -0.9s;
}

.eic-spinner .rect5 {
  -webkit-animation-delay: -0.8s;
  animation-delay: -0.8s;
}

@-webkit-keyframes stretchdelay {
  0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
  20% { -webkit-transform: scaleY(1.0) }
}

@keyframes stretchdelay {
  0%, 40%, 100% {
    transform: scaleY(0.4);
    -webkit-transform: scaleY(0.4);
  }  20% {
       transform: scaleY(1.0);
       -webkit-transform: scaleY(1.0);
     }
}

/**
 * Featherlight – ultra slim jQuery lightbox
 * Version 1.0.3 - http://noelboss.github.io/featherlight/
 *
 * Copyright 2014, Noël Raoul Bossart (http://www.noelboss.com)
 * MIT Licensed.
**/
@media all {
  .eic-lightbox {
    display: none;

    /* dimensions: spanning the background from edge to edge */
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    /* position: centering content */
    text-align: center;

    /* insures that the ::before pseudo element doesn't force wrap with fixed width content; */
    white-space: nowrap;
  }

  .eic-lightbox:before {
    /* position: trick to center content vertically */
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -0.25em;
  }

  .eic-lightbox .eic-lightbox-content {
    /* make content container for positioned elements (close button) */
    position: relative;

    /* position: centering vertical and horizontal */
    text-align: left;
    vertical-align: middle;
    display: inline-block;

    /* dimensions: cut off images */
    overflow: auto;
    padding: 25px 25px 0;
    border-bottom: 25px solid transparent;

    /* dimensions: handling small or empty content */
    min-width: 30%;

    /* dimensions: handling large content */
    margin-left: 5%;
    margin-right: 5%;
    max-height: 95%;

    /* styling */
    background: #fff;
    cursor: auto;

    /* reset white-space wrapping */
    white-space: normal;
  }

  /* contains the content */
  .eic-lightbox .eic-lightbox-inner {
    /* make sure its visible */
    display: block;
  }

  .eic-lightbox .eic-lightbox-close-icon {
    /* position: centering vertical and horizontal */
    position: absolute;
    z-index: 9999;
    top: 0;
    right: 0;

    /* dimensions: 25px x 25px */
    line-height: 25px;
    width: 25px;

    /* styling */
    cursor: pointer;
    text-align: center;
    font: Arial, sans-serif;
    background: #fff; /* Set the background in case it overlaps the content */
    background: rgba(255, 255, 255, 0.3);
    color: #000;
  }
}

/* handling phones and small screens */
@media only screen and (max-width: 1024px) {
  .eic-lightbox .eic-lightbox-content {
    /* dimensions: maximize lightbox with for small screens */
    margin-left: 10px;
    margin-right: 10px;
    max-height: 98%;

    padding: 10px 10px 0;
    border-bottom: 10px solid transparent;
  }
}