/**
ImageService
- Finder
- Uploader
- Messaging
- List
- ListItem (Preview, Attributes, Actions)
*/

/* ImageService Main Container*/
.imageservice-container {
    height: auto;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    background-color: white;
}

.imageservice-container.focused {
    border-width: 5px;
    border-color: #999999AA;
}

/* Finder Styling */
.imageservice-finder {
    box-sizing: border-box;
    line-height: 28px;
    padding-left: 5px !important;
    padding-right: 5px !important;
    padding-top: 5px;
    padding-bottom: 5px;
}

.select2-results__option {
    width: 100%;
    display: inline-block;
}

.select2-results__option:nth-child(odd) {
    background-color: #e8e8e8;
}

.imageservice-finder-result ul{
    width: 60%;
    vertical-align: top;
    list-style: none;
}

.imageservice-finder-result ul li {
    width: 100%;
    display: inline-block;
}

.imageservice-finder-result .preview {
    width: 80px;
    height: 80px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Uploader Styling */

.imageservice-uploader {
    padding-left: 5px !important;
    padding-right: 5px !important;
    padding-top: 5px;
    padding-bottom: 5px;
}

.imageservice-uploader .btn {
    white-space: normal;
}

/* List-Messaging Style */

.imageservice-message {
    position: absolute;
    left: 0;
    top:45px;
    width: 100%;
    height: 0;
    z-index: 1000;
    display: inline-block;
    padding: 5px;
}

.imageservice-message div {
    cursor: pointer;
    box-shadow: 2px 6px 18px #e9e9e9;
    margin-bottom: 10px;
}

/* List Styling */

.imageservice-list {
    width: 100%;
    max-height: 400px;
    display: inline-block;
    overflow-y: scroll;
    clear: both;
    border-top: 2px solid lightgrey;
    padding: 4px 2px 15px 2px;
}

/* List-Item Styling */

.imageservice-entity {
    width: 100%;
    padding: 10px;
    border-radius: 3px;
    float: left;
    box-sizing: border-box;
}

.imageservice-entity .drop-target {
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #ffffff99;
    position: absolute;
    top: 0;
    left: 0;
    font-weight: bold;
    text-align: center;
    padding: 10px;
}

.imageservice-entity.error {
    background-color: #ffaaaa;
}

.imageservice-entity.warning {
    background-color: #ffffaa;
}

:not(.hidden).imageservice-entity:nth-child(odd) {
    background-color: #eeeeee;
}

.imageservice-entity .imageservice-preview {
    display: inline-block;
    vertical-align: top;
    text-align: center;
    box-sizing: border-box;
}

.imageservice-entity .imageservice-preview img {
    max-height: 122px;
    max-width: 100%;
}

.imageservice-entity .imageservice-entity-actions {
    display: inline-block;
    vertical-align: top;
    text-align: center;
    height: auto;
    box-sizing: border-box;
    padding-top: 3px;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.imageservice-entity .imageservice-entity-actions .btn {
    margin: 2px;
}

.imageservice-entity .imageservice-attributes {
    display: inline-block;
    margin: 0;
    box-sizing: border-box;
    width: 100%;
}

.imageservice-entity .imageservice-attributes li{
    list-style: none;
    font-size: 11px !important;
    position: relative;
}

.imageservice-entity .imageservice-attributes li label{
    display: inline-block;
    line-height: 16px;
    font-size: inherit !important;
    font-weight: bold;
}

.imageservice-attributes li .toolbar {

    top: 0;
    position: absolute;
    margin: -2.5em 0 0;
    background: #252525;
    z-index: 10;
    border-radius: .4em;
    border: 1px solid black;
    padding: 0;
    -webkit-transition: opacity .2s ease-in-out;
    transition: opacity .2s ease-in-out;

}

.imageservice-attributes li .toolbar button {
    font-size: 1.3em;
    background-color: black;
    color: white;
    border: none;
    z-index:5;
}

.imageservice-attributes li .toolbar button.active {
    background-color: #535353;
}

.imageservice-attributes li div[contenteditable="true"] {
    width: 100%;
    min-height: 50px;
    background-color: white;
    border: 1px solid lightgray;
    padding: 5px;
    max-height: 200px;
    height: auto;
    margin: 1px;
    font-size: inherit !important;
    overflow: auto;
}

.imageservice-attributes li div[contenteditable="true"] * {
    font-size: inherit !important;
}

.imageservice-attributes li input[type="text"],
.imageservice-attributes li select,
.imageservice-attributes li textarea {
    width: 100%;
    vertical-align: middle;
    margin: 1px 0 1px 0;
    border: 1px solid #ccc !important;
    line-height: inherit !important;
    font-size: inherit !important;
    height: auto !important;
    padding: 3px !important;
    min-height: 15px;
}

.imageservice-attributes li textarea:hover {
    border: initial;
}

.imageservice-attributes .select2.select2-container {
    width: 100% !important;
    font-size: inherit !important;
    height: auto;
    margin: 1px 0;
}

.imageservice-attributes .select2.select2-container > span *  {
    padding: 1px;
    margin: 0;
    min-height: 0;
    line-height: 10px !important;
    font-size: inherit !important;
}

.imageservice-attributes-global {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 5px;
    font-size: 12px;

}

.imageservice-attributes-global {
    display: block;
    width: 100%;
}

.imageservice-attributes-global h5 {
    width: 100%;
    display: block;
    margin:0;
    padding: 10px 3px 3px 3px;
}

.imageservice-attributes-global ul {
    width: 100% !important;
    list-style: none;
}

.imageservice-modal {
    display: block;
    top: calc( 50% - 200px );
    left: calc( 50% - 200px );
    border: 1px solid gray;
    border-radius: 3px;
    z-index: 9999;
}

.imageservice-settings-trigger {
    padding: 5px;
}

.imageservice-settings {
    border-width: 1px 0 1px 0;
    border-style: solid;
    border-color: #ccc;
    overflow: auto;
}

.imageservice-settings hr {
    display: block;
    padding: 3px;
    margin-bottom: 2px;
    margin-top:  2px;
}

.imageservice-settings-component {
    display: block;
    width: 100%;
}

.imageservice-attributes .imageservice-scribe {
    border: 1px solid lightgrey !important;
}

.imageservice-saving {
    display: block;
    text-align: center;
    position: absolute;
    top: -20px;
    width: 100px;
    -webkit-animation:linear infinite alternate;
    -webkit-animation-name: run;
    -webkit-animation-duration: 5s;
}

@-webkit-keyframes run {
    0% { left: 0; opacity: 0;}
    50%{ left : calc(100% - 100px ); opacity: 1;}
    100%{ left: 0; opacity: 0;}
}

@-webkit-keyframes fadeInOut {
    0% { opacity: 0.3;}
    50%{ opacity: 1;}
    100%{ opacity: 0.3;}
}

.modal-body {
    display: inline-block;
    width: 100%;
}

.imageservice-progress {
}

.imageservice-progress h2 {
    margin: 0;
}

.imageservice-progress .imageservice-message {
    position: relative;
    height: auto;
    top: 0;
    max-height: 300px;
    overflow: auto;
}

.imageservice-progress .modal-body {
    min-height: 0;
    display: inline-block;
}

.imageservice-progress .modal-body .alert {
    margin-bottom: 5px;
}

.imageservice-progress .modal-body .imageservice-preview {
    width: 80px !important;
    height: 80px !important;
    float: left;
    overflow: hidden;
    position: relative;
    padding: 0;
    background: #eaeaea;
    margin: 1px;
}

.imageservice-progress .modal-body .imageservice-preview.error {
    border: 2px solid #ffaaaa;
}

.imageservice-progress .modal-body .imageservice-preview img {
    width: 100%;
    height: auto;
    margin-top: auto;
    margin-bottom: auto;
}

.imageservice-progress .modal-body .imageservice-preview img.saving {
    -webkit-animation:linear infinite alternate;
    -webkit-animation-name: fadeInOut;
    -webkit-animation-duration: 5s;
}

.imageservice-progress .modal-body .imageservice-preview img.error {
    -webkit-animation: none;
}

.imageservice-progress .error {
    color: #a94442;
}

.imageservice-progress .modal-footer .error {
    padding: 6px;
    font-weight: bold;
}

.imageservice-container [contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}