// popover dimensions
$max-popover-height: 350px;
$min-popover-width: 360px;

$small-popover: 380px;
$medium-popover: 600px;
$large-popover: 1000px;
$popover-border-width: 2px;

// Delete Popover
.popover-body {
    .delete-popover-content {
      min-width: $min-popover-width;

      @include media-breakpoint-only(xs) {
        min-width: 30vw;
      }
    }
}

// Tile Settings Popover
.popover {
    max-width: $small-popover + $popover-border-width;
}

.settings-popover .popover-body {
    padding: 0;
}

.settings-medium .popover {
    max-width: $medium-popover + $popover-border-width;
}

.settings-large .popover {
    max-width: $large-popover + $popover-border-width;
}

.settings-popover-content {
    tile-settings {
        max-height: $max-popover-height;
        min-width: $min-popover-width;
        max-width: 90vw;
        display: block;
        padding: 10px 10px 0;
        overflow: auto;
        overflow-x: hidden;
    }

    .settings-popover.settings-medium {
        width: $medium-popover;
    }

    .settings-popover.settings-large {
        width: $large-popover;
    }

    .popover-footer {
        background: $gray-100;
        border-top: 1px solid $gray-300;
        padding: 10px 0;
        margin: 0;
    }

    input::-ms-clear {
        display: none;
    }
}

// Layout of pages component picker
.pages-component-picker {
    height: 406px;

    .categories-wrapper {
        overflow: auto;
        height: 100%;
        border-right: 1px solid $gray-200;
        background-color: $gray-100;
    }
}

// Styling of pages component picker tile link - icons, title and description
.pages-component-picker-tile-link {
    height: 100%;
    text-align: center;
    display: block;
    padding: .5rem;
    &:hover {
        text-decoration: none;
        background: $gray-100;
    }

    // Styling of pages component picker tile glyphicon icons
    .pages-component-picker-tile-icon {
        display: block;
        font-size: 30px;
        color: var(--theme-app-color);
    }

    // Styling of pages component picker tile svg icons
    .pages-component-picker-tile-icon.claroicons svg {
        width: 40px;
        height: 40px;
        path {
            fill: currentColor;
        }
    }
    // Styling of pages component picker tile title
    .pages-component-picker-tile-title {
        display: block;
        color: $gray-800;
    }
    // Styling of pages component picker tile description - hides it in tile mode
    .pages-component-picker-tile-description {
        display: none;
    }
}

// Styling of pages component picker tiles wrapper
.pages-component-picker-tiles-wrapper {
    height: 339px;
    overflow: auto;
    .pages-component-picker-tiles-list {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        padding: .5rem;
        align-items: flex-start;
        margin: 0;
    }
}

// Styling of component picker search bar
.pages-component-picker-search-wrapper {
    border-bottom: 1px solid $gray-200;
    // Styling of component picker search icon
    .pages-component-picker-search-icon {
        position: absolute;
        padding: 0.7rem;
    }
    // Styling of component picker search form
    .pages-component-picker-search {
        border: none;
        padding-left: 45px;
        background: $gray-200;
        border-radius: 10rem;
        color: $gray-800;
        max-width: 230px;
    }

}

// Styling and structure of pages component picker tiles - list mode
.pages-component-picker-tiles-list.list-mode {
    padding: 0;
    display: block;

    // Styling and structure of pages component picker tile - list mode
    .pages-component-picker-tile {
        max-width: 100%;

        // Styling of pages component picker tile link - icons, title and description - list mode
        .pages-component-picker-tile-link {
            text-align: left;
            display: flex;
            align-items: flex-start;

            // Pages component picker tile glyphicon icon spacing - list mode
            .pages-component-picker-tile-icon {
                margin-right: .9rem;
            }

            // Pages component picker tile svg icons- list mode
            .pages-component-picker-tile-icon.claroicons {
                margin-right: .5rem;
            }

            .pages-component-picker-tile-title-wrapper {
                flex: 1;
                align-self: center;
            }

            // Styling of pages component picker tile description - shows it in list mode
            .pages-component-picker-tile-description {
                display: block;
            }
        }
    }
}

// Positioning of add pages component buttons
.add-pages-component {
    position: absolute;
    text-align: center;
    height: 100%;

    // Sizing of 6 grid add pages component buttons
    &.insert-target-6 {
        width: 16.6%;
    }
    // Sizing of 6 grid add pages component buttons
    &.insert-target-4 {
        width: 25%;
    }

    .add-pages-component-link {
        text-decoration: none;
    }

    // Adds a 20px margin to the top of the 'add new component' placeholder
    .add-page-component-margin-top {
        margin-top: 20px;
    }

    // Styling of add pages component buttons
    .add-pages-component-inner {
        display: block;
        border: 2px dashed $gray-500;
        background: $gray-300;
        color: $gray-600;
        opacity: 0;
        width: 100%;
        height: 100%;
        border-radius: var(--theme-rounded-corners);
        // Styling of add pages component buttons plus icon
        .add-pages-component-icon {
            font-size: 1rem;
        }

        // Styling of add pages component buttons - large mode
        &.add-pages-component-inner-large {
            .add-pages-component-icon {
                font-size: 3.5rem;
                vertical-align: middle;
            }
        }
        // Styling of add pages component buttons - when hovered or active
        &.active, &:hover {
            opacity: 1;
            cursor: pointer;
        }
    }

    // Used to force the large + tile insert buttons to be visible when there are no tiles on the page
    .no-tile-helper {
        opacity: 1;
    }
}

// Styling of pages component picker pills
.add-tile-popover {

    .category-pills {
        .nav-link {
            position: relative;
            padding-left: 20px;
            margin: 0 0 .25rem;
            border-radius: 0.25rem;
            color: $gray-700;
            cursor: pointer;
            &:hover {
                background: #fff;
            }
        }
    }

    // Styling of pages component picker pill when active
    .flex-column > .nav-item.active > .nav-link {
        background: #fff;
        box-shadow: 0 0 8px 5px rgba(0, 0, 0, 0.03);

        // Adds colours bar to left of component picker pill when active
        &::before {
            content: '';
            position: absolute;
            width: 3px;
            left: 0;
            top: 0;
            bottom: 0;
            margin: 6px;
            border-radius: 10rem;
            background: var(--theme-primary-color);
        }
    }
}

// Default multiple selects are huge and cause a very visible layout change when select2 kicks in to make them normal sized
.settings-user-picker select {
    height: 32px;
}

.settings-textarea {
    width: 100%;
    max-width: 415px;
}

.select2-selection__rendered .icon-picker-icon {
    line-height: 32px;
}

.delete-confirmation-body {
    text-align: center;
    margin: 20px;
}

.drag-overlay {
    position:absolute;
    width: 100%;
    height: 100%;
    z-index: 17;
    cursor: move;
    border: 1px solid transparent;
    transition: all .3s ease-in-out;
    border-radius: var(--theme-rounded-corners);
}

.edit-locked {
    .drag-overlay {
        cursor: default;
    }
}

// Hide tile content when vertical height is reduced
.ui-resizable-resizing {
    overflow: hidden;
}

.page-editcopy-missing-message {
    margin: 10px 20px;
    padding: 10px;
}

.page-editcopy-missing-block {
    margin: 20px;
}

.radio_icon_row {
    .radio_icon_input {
        display: none;
    }

    .radio_icon {
        display: block;
        position: relative;

        min-width: 20px;
        min-height: 20px;

        margin: 11px;
        border-radius: 4px;
        cursor: pointer;
        border: 1px solid $gray-200;
    }

    .radio_icon_selected {
        margin: 10px;
        border: 2px solid $blue-600;
        background: $blue-100;
    }
}

.pages-icon-grid-container {
    overflow-y: scroll;
    max-height: 150px;
}

//Safe Mode
.safe-mode-alert {
    margin: 10px;
}

.grid-stack-item .content-block.content-block-safe-mode {
    height: 100%;
    overflow: hidden;
}

.content-block-safe-mode-body {
    margin: 10px;
    height: calc(100% - 20px);
    background-color: $yellow-100;
    border: 2px solid $yellow-300;
    border-radius: 4px;
    overflow: hidden;

    .safe-mode-icon {
        color: $yellow-900;
    }
}
