/**
 * Copyright Â© Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

//
//  Variables
//  _____________________________________________

@color-keyword-border-color: #c6c1bb;
@color-dots-background-color: #626160;
@color-action-dismiss-color: #464646;

& when (@media-common = true) {
    .adobe-stock-images-search-modal-content {
        .color-rectangle {
            border: solid 1px @color-dots-background-color;
            display: inline-block;
            height: 12px;
            position: inherit;
            top: 2px;
            width: 12px;
        }

        .masonry-image {
            &-grid {
                display: inline-block;
                margin: 0;
                width: 100%;
            }

            &-column {
                overflow: visible;
                position: static;
            }

            &-overlay {
                float: right;
                margin-bottom: -30px;
                padding-left: 5%;
                padding-right: 5%;
                position: relative;
                width: auto;
            }

            &-preview {
                position: fixed;
                z-index: 289;

                .container {
                    padding-top: 0;

                    .preview-buttons {
                        /* Align image preview actions uniformly to the right edge */

                        .action-previous,
                        .action-next,
                        .action-close {
                            padding: 30px 0 30px 30px;
                        }
                    }

                    .preview-row-content {
                        img.preview {
                            flex-basis: auto;
                        }
                    }
                }
            }
        }

        .masonry-image-sortby {
            display: inline-block;
        }

        .masonry-results-number {
            display: inline-block;
            margin-right: 1.4rem;
        }

        .masonry-image-column {
            position: static;
            &:first-child .masonry-image-preview .preview-buttons .action-previous,
            &:last-child .masonry-image-preview .preview-buttons .action-next {
                opacity: .5;
                pointer-events: none;
            }
        }

        .adobe-login-container {
            .adobe-user-information {
                .adobe-user-popup {
                    .adobe-user-info {
                        padding-top: 15px;
                    }
                }
            }
        }

        .admin__action-dropdown-wrap._active .admin__action-dropdown-text::after {
            margin-right: 6px;
        }

        .admin__data-grid-action-bookmarks .admin__action-dropdown-menu {
            left: auto;
            right: 0;
        }

        .masonry-image-grid {
            + .admin__data-grid-header {
                .selectmenu-items {
                    bottom: 100%;
                    top: auto;
                }
            }
        }

        .masonry-image-preview {

            position: absolute;

            .title {
                font-weight: bold;
            }

            .info {
                float: left;
                min-width: 40%;
                padding-left: 40px;
                width: -moz-min-content;

                .actions {
                    letter-spacing: -1px;

                    button {
                        margin-right: 15px;
                    }
                }

                .title {
                    margin: 0 0 20px;
                }

                .author {
                    margin: 0 0 30px;
                }

                .action-buttons {
                    margin: 0 0 30px;
                    text-align: left;
                }
            }

            .related-container {
                height: 180px;
            }

            .attributes {
                .attribute {
                    display: inline-block;
                    margin-right: 2em;

                    .value {
                        margin-top: 1em;
                    }
                }
            }

            .keywords {
                display: inline-block;
                margin: 30px 0 20px 0;
                width: 100%;

                .title {
                    margin-bottom: 30px;
                }

                .keyword {
                    display: inline-block;
                    line-height: 40px;
                    margin-right: 5px;

                    &.hide {
                        display: none;
                    }

                    .value {
                        background-color: @color-white-smoke;
                        border: 1px solid @color-keyword-border-color;
                        border-radius: 3px;
                        color: @color-gray40;
                        font-size: 15px;
                        padding: 5px;
                        text-transform: capitalize;
                    }
                }

                button {
                    margin-left: 10px;
                }
            }

            .adobe-stock-tabs {
                border-bottom: 1px solid @color-gray68;
                margin-top: 30px;

                .ui-state-default {
                    border-bottom: none;
                }

                .ui-state-active {
                    border-bottom: 0;
                    font-weight: unset;
                    letter-spacing: normal;
                    margin-bottom: -1.1rem;
                }
            }

            .related-loader {
                height: 100px;
                left: 50%;
                margin-left: -50px;
                margin-top: 50px;
                position: absolute;
                width: 100px;
            }

            .adobe-stock-related-images-tab-content {
                display: inline-block;
                height: auto;
                max-height: 190px;
                vertical-align: middle;
                width: 100%;

                .ui-tabs-panel {
                    margin-top: 30px;
                    padding: 0;

                    .thumbnail {
                        display: inline-flex;
                        height: 100px;
                        margin-right: 10px;
                        max-width: 150px;
                        overflow: hidden;
                        position: relative;
                        vertical-align: middle;
                        width: 100%;

                        img {
                            margin: 0 auto;
                            max-width: initial;
                            position: relative;
                            width: auto;
                        }
                    }

                    .see-more-wrapper {
                        cursor: pointer;
                        display: inline-block;
                        max-height: 100px;
                        max-width: 140px;
                        text-align: center;
                        vertical-align: middle;
                        width: 100%;

                        .see-more-content {
                            padding: 30px;

                            .three-dots {
                                margin-bottom: 10px;

                                .dots {
                                    background-color: @color-dots-background-color;
                                    border-radius: 50%;
                                    color: @color-white;
                                    content: '\22EE';
                                    display: inline-block;
                                    height: 10px;
                                    line-height: 1;
                                    text-align: center;
                                    width: 10px;
                                }
                            }
                        }
                    }
                }
            }
        }

        .admin__form-field {
            .colorpicker-input {
                min-width: 70%;
            }
        }
    }

    //  Start Save Prompt styling
    .adobe-stock-save-preview-prompt {
        .modal-inner-wrap {
            max-width: 650px;
            width: 100%;

            .modal-header {
                padding: 30px;

                .modal-title {
                    margin: 0;
                }

                .action-close {
                    right: 30px;
                    top: 30px;
                }
            }

            .modal-content {
                .prompt-message {
                    font-weight: normal;
                    margin-bottom: 15px;

                    p {
                        word-break: break-all;
                    }
                }

                .admin__field-wide {
                    margin-bottom: 0;
                }

                .image-ext {
                    color: @color-gray60;
                    cursor: default;
                    padding: .6rem 1rem .6rem;
                    position: absolute;
                    right: 0;
                    top: 0;
                }

                .admin__field-with-image-ext {
                    .admin__control-text {
                        padding-right: 5rem;
                    }
                }
            }

            .modal-footer {
                padding: 30px;

                .action-dismiss {
                    color: @color-action-dismiss-color;
                    margin-right: 35px;
                }
            }
        }
    }

    //  End Save Prompt styling
    .admin__adobe-stock-image-checkbox {
        .admin__field-control._with-tooltip {
            .admin__form-field-label {
                display: inline-block;
            }

            .admin__field-tooltip {
                margin: -5px 0 0 5px;

                .admin__field-tooltip-action {
                    &:before {
                        line-height: initial;
                        overflow: visible;
                    }
                }
            }
        }
    }
}

@media (max-width: 1400px) {
    .adobe-stock-images-search-modal-content {
        .masonry-image-preview {
            .adobe-stock-related-images-tab-content {
                .ui-tabs-panel {
                    .thumbnail {
                        max-width: 130px;
                    }
                    .see-more-wrapper {
                        width: auto;
                    }
                }
            }
        }
    }
}

@media (max-width: 1024px) {
    .adobe-stock-images-search-modal-content {
        .masonry-image-preview {
            .container {
                margin: 0 60px;

                .preview-row-content {
                    .info {
                        .actions {
                            .action-secondary {
                                margin-bottom: 8px;
                            }
                        }
                    }
                }
            }
        }
    }
}
