.lightbox {
    @include lightbox;
    h2 {
        @include font-size(xlarge);
        @include font-type(light);
    }
}

.lightbox-generic-form {
    form {
        flex-basis: 600px;
        flex-grow: 0;
        max-width: 600px;
    }

    fieldset {
        position: relative;
    }

    textarea {
        min-height: 4.5rem;
        resize: vertical;
    }

    .existing-or-new-selector {
        display: flex;
        margin-bottom: 2rem;
        input {
            display: none;
            &:checked+label {
                background: $primary-light;
                color: $white;
                transition: background .2s ease-in;
            }
            &:checked+label:hover {
                background: $primary-light;
            }
            +label {
                background: rgba($whitish, .7);
                cursor: pointer;
                display: block;
                font-size: 1em;
                padding: 2rem 1rem;
                text-align: center;
                text-transform: uppercase;
                transition: background .2s ease-in;
            }
            +label:hover {
                background: rgba($primary-light, .3);
                transition: background .2s ease-in;
            }
        }
        .existing-or-new-selector-single {
            flex: 1;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }

    .settings {
        display: flex;
        justify-content: center;
        fieldset {
            margin-right: .5rem;
            &:hover {
                color: $white;
                transition: all .2s ease-in;
                transition-delay: .2s;
            }
            &:last-child {
                margin: 0;
            }
        }
        .requirement,
        .iocaine {
            vertical-align: middle;
            &:hover {
                background: $primary-light;
                border: 1px solid $primary;
            }
            svg {
                @include svg-size(.75rem);
            }
        }

        .blocked {
            &:hover {
                background: $red-light;
                border: 1px solid $red;
            }
        }
        .client-requirement,
        .team-requirement,
        .iocaine-flag {
            input:checked+label {
                background: $primary;
                border: 1px solid $primary;
                color: $white;

            }
        }

        .blocking-flag {
            label {
                align-self: stretch;
                display: block;
            }
            input:checked+label {
                background: $red;
                border: 1px solid $red;
                color: $white;
            }
        }
        input {
            display: none;
        }
    }
    .attachments {
        margin-bottom: 0;
    }
    .attachment-body {
        max-height: 7.5rem;
        overflow-y: auto;
    }
    .attachment-delete {
        right: .5rem;
        svg {
            fill: $gray-light;
            height: 1.25rem;
            width: 1.25rem;
        }
        &:hover {
            svg {
                fill: $red;
            }
        }
    }
}

.lightbox-generic-bulk {
    form {
        flex-basis: 600px;
        flex-grow: 0;
        max-width: 600px;
    }
    textarea {
        max-height: 12rem;
        min-height: 15rem;
    }
}

.lightbox-search {
    form {
        flex-basis: 600px;
        flex-grow: 0;
        max-width: 600px;
    }
    fieldset {
        margin-bottom: 1rem;
    }
}
.lightbox-sprint-add-edit {
    form {
        flex-basis: 600px;
        flex-flow: 0;
        max-width: 600px;
    }
    .last-sprint-name {
        @include font-size(small);
        color: $gray;
        opacity: 1;
        position: absolute;
        right: 1rem;
        top: .7rem;
        transition: opacity .3s linear;
        &.disappear {
            opacity: 0;
            transition: opacity .3s linear;
        }
    }
    .dates {
        margin-bottom: 1rem;
        div {
            float: left;
            margin-right: 1%;
            position: relative;
            width: 49%;
            &:last-child {
                margin: 0;
                width: 50%;
            }
        }
    }
    .delete-sprint {
        @include font-size(small);
        color: $gray;
        float: right;
        margin: 1rem .25rem 0 0;
        transition: color .3s linear;
        .icon {
            fill: currentColor;
        }
        &:hover {
            color: $red;
            transition: color .3s linear;
            .icon {
                fill: currentColor;
            }
        }
    }
}

.lightbox-generic-ask {
    form {
        flex-basis: 420px;
        flex-flow: 0;
        max-width: 420px;
    }
    .subtitle,
    .message {
        display: block;
        line-height: 2rem;
        text-align: center;
    }
    .subtitle {
        @include font-size(large);
        @include font-type(text);
        white-space: pre-line;
    }
    .options {
        display: flex;
        a {
            padding: 8px 0;
            text-align: center;
            width: 100%;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
}

.lightbox-ask-choice {
    text-align: center;
    form {
        flex-basis: 420px;
        flex-grow: 0;
    }
    .question,
    .subtitle {
        display: block;
        line-height: 1.5rem;
        text-align: center;
    }
    .subtitle {
        @include font-size(large);
        @include font-type(text);
    }
    .replacement {
        display: block;
        span {
            display: block;
        }
    }
    .choices {
        margin-bottom: 2rem;
    }
    .options {
        display: flex;
        a {
            flex-grow: 1;
            padding: 8px 0;
            text-align: center;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
    .warning {
        @include font-type(bold);
    }
}

.lightbox-delete-account {
    p {
        text-align: center;
    }
    form {
        flex-basis: 420px;
        flex-grow: 0;
        width: 420px;
    }
    .question,
    .subtitle {
        display: block;
        line-height: 2rem;
        text-align: center;
    }
    .newsletter {
        margin: 1rem 0;
        text-align: center;
        input {
            margin-right: .5rem;
            +label {
                @include font-size(small);
                @include font-type(text);
            }
        }
    }
    .options {
        display: flex;
        a {
            flex-grow: 1;
            padding: 8px 0;
            text-align: center;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
}

.lightbox-delete-project {
    form {
        flex-basis: 420px;
        flex-grow: 0;
        width: 420px;
    }
    .question,
    .subtitle {
        display: block;
        line-height: 2rem;
        text-align: center;
    }
    .subtitle {
        @include font-size(large);
        @include font-type(text);
    }
    .options {
        display: flex;
        a {
            flex-grow: 1;
            padding: 8px 0;
            text-align: center;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
}


.lightbox-generic-success,
.lightbox-generic-error,
.lightbox-generic-loading {
    section {
        flex-basis: 500px;
        flex-grow: 0;
        flex-shrink: 0;
        width: 500px;
    }
    h2 {
        line-height: 2rem;
    }
    p {
        text-align: center;
    }
}

.lightbox-generic-loading {
    .spin {
        margin: 1rem auto;
        width: 5rem;
        img {
            @include loading-spinner;
            max-height: 100%;
            max-width: 100%;
            width: 100%;
        }
    }
    .progress-bar-wrapper {
        background: darken($whitish, 5%);
        height: 30px;
        margin-bottom: 1rem;
        padding: 3px;
        position: relative;
        .bar {
            background: $primary-light;
            height: 24px;
            position: absolute;
            transition: width .1s linear;
        }
        .progress {
            @include font-type(text);
            @include font-type(bold);
            @include font-size(large);
            background: darken($whitish, 5%);
            bottom: 35px;
            color: $gray;
            padding: .3rem;
            position: absolute;
            transition: left .1s linear;
        }
    }
}

.lightbox-create-issue {
    form {
        flex-basis: 600px;
        flex-grow: 0;
        width: 600px;
    }

    .fieldset-row {
        display: flex;
        fieldset {
            flex-basis: 100px;
            flex-grow: 1;
            margin-right: .5rem;
            width: 30%;
            &:last-child {
                margin: 0;
            }
        }
    }

    textarea {
        margin-bottom: 1rem;
        max-height: 12rem;
        min-height: 8rem;
    }
}

.lightbox-block {
    .form {
        flex-basis: 420px;
        flex-grow: 0;
        width: 420px;
    }
    textarea {
        margin-bottom: 1rem;
        max-height: 12rem;
        min-height: 8rem;
    }
}

.lightbox-select-user {
    .form {
        flex-basis: 600px;
        flex-grow: 0;
        width: 600px;
    }
    .user-list-single {
        &:hover,
        &.selected {
            background: rgba(lighten($primary-light, 30%), .3);
            cursor: pointer;
        }
        &:hover {
            transition: background .3s linear;
            transition-delay: .2s;
        }
    }
    .more-watchers {
        @include font-type(text);
        @include font-size(medium);
        padding: .5rem;
        text-align: center;
    }
    .submit-button {
        margin-top: 1rem;
    }
    .add-comment {
        position: relative;
        text-align: center;
        .icon-close {
            cursor: pointer;
            fill: $gray;
            position: absolute;
            right: 0;
            top: 0;
            transition: fill .2s;
            &:hover {
                fill: $red-light;
            }
            svg {
                @include svg-size(2rem);
            }
        }
        textarea {
            margin-top: 1rem;
        }
        a {
            color: $primary;
        }
    }
}

.lb-create-edit-userstory {
    .points-per-role {
        flex-direction: row;
        flex-wrap: wrap;
        margin: 0;
    }
    .ticket-role-points {
        margin: .1rem;
        min-width: 20%;
        &:first-child {
            margin-left: 0;
        }
        &:nth-child(4n + 4) {
            margin-right: 0;
        }
        &:last-child {
            flex-basis: 100%;
            margin: .1rem 0;
            min-width: 100%;
        }
    }
}

.lightbox-import-error {
    text-align: center;
    .content {
        width: 500px;
    }
    h2 {
        margin-top: 1rem;
    }
    .description {
        a {
            color: $primary;
        }
    }
    img {
        height: 5rem;
    }
}

.lightbox-leave-project-warning {
    text-align: center;
    .icon {
        fill: $gray-light;
        height: 3rem;
        margin-bottom: 1rem;
        width: 3rem;
    }
    .content {
        width: 500px;
    }
}

.lightbox-request-ownership {
    text-align: center;
    .content {
        width: 500px;
    }
}

.lightbox-set-due-date {
    z-index: 9999;
    form {
        flex-basis: 600px;
        flex-flow: 0;
        max-width: 600px;
    }
    .date {
        margin: 2rem 0 1rem;
    }
    .reason textarea {
        margin-top: .5rem;
    }
    .due-date-suggestions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        margin: 1rem 0 .5rem;
    }
    .suggestion {
        background: rgba($gray-lighter, .2);
        color: $gray-lighter;
        justify-content: flex-start;
        margin: 0 .5rem .5rem;
        min-height: 2rem;
        padding: .5rem .75rem;
        position: relative;
        &:first-child {
            margin-left: 0;
        }
        &:nth-child(4n + 4) {
            margin-right: 0;
        }
        &.clickable {
            &:hover,
            &.active {
                background: rgba($primary-light, .9);
                color: $white;
            }
        }
    }
    .delete-due-date {
        @include font-size(small);
        color: $gray;
        float: right;
        margin: 1rem .25rem 0 0;
        transition: color .3s linear;
        .icon {
            fill: currentColor;
        }
        &:hover {
            color: $red;
            transition: color .3s linear;
            .icon {
                fill: currentColor;
            }
        }
    }
}

.lightbox-create-edit {
    z-index: 9998;
    $control-height: 30px;
    $spacing: 15px;
    $width: 700px;
    $pop-width: 203px;
    $sidebar-width: 220px;
    form {
        flex-basis: $width;
        max-width: $width;
        width: $width;
    }
    .form-wrapper {
        display: flex;
        flex-basis: $width;
        flex-direction: row;
        flex-grow: 0;
        margin-bottom: $spacing * 2;
        main {
            flex-grow: 1;
            max-width: $width - $sidebar-width;
        }
        .sidebar {
            border-left: 2px solid $whitish;
            margin-left: $spacing;
            padding-left: $spacing;
            $min-width: $sidebar-width;
            width: $sidebar-width;
        }
    }
    .existing-item-wrapper {
        margin-bottom: $spacing * 2;
        select .strong {
            @include font-type(bold);
        }
    }
    .add-existing-button {
        width: 100%;
    }
    .status-button {
        display: flex;
        position: relative;
    }
    .status-dropdown {
        align-content: center;
        color: $white;
        cursor: pointer;
        display: flex;
        flex-basis: 100%;
        height: $control-height;
        padding: .25rem .5rem;
        .status-text {
            flex-grow: 1;
            text-transform: uppercase;
        }
        svg {
            fill: $white;
            height: .9rem;
            width: .9rem;
        }
    }

    .popover {
        a {
            color: $white;
            display: block;
            padding: .5rem 1rem;
            text-align: left;
            &:hover,
            &.active {
                color: $primary-light;
            }
        }
    }

    .ticket-assigned-to {
        border: 0;
        padding: 0;
        &.single-assign {
            margin: 0;
        }
        &.multiple-assign {
            align-items: start;
            flex-direction: column;
            margin: 0;
        }
        .assigned-to-actions {
            display: block;
        }
        .remove-user {
            top: 1.2rem;
        }
    }

    .user-list {
        display: flex;
        width: 100%;
        $item-size: 44.75px;
        .user-list-item {
            margin-right: .5rem;
            width: $item-size;
            img {
                height: $item-size;
                width: $item-size;
            }
            &:last-child {
                margin-right: 0;
            }
            &.counter {
                background: $gray-lighter;
                color: $gray-light;
                font-weight: 400;
                height: $item-size;
                line-height: $item-size;
                text-align: center;
            }
        }
    }

    .tg-add-assigned {
        align-items: center;
        display: flex;
        margin: .25rem 0 .75rem;
        .add-assigned {
            fill: $gray;
            opacity: 1;
            right: .5rem;
            top: 2rem;
            &:hover {
                cursor: pointer;
                fill: $red;
                transition: fill .2s;
            }
        }

        span {
            @include font-size(small);
            @include font-type(light);
            color: $gray;
            margin: .2rem .5rem;
        }
    }

    .users-dropdown {
        position: relative;
    }

    .pop-status {
        @include popover($pop-width, $control-height - 2px);
    }

    .pop-users {
        @include popover($pop-width, 60px, 0, '', '', 16px, -7px, ($pop-width / 3));
        &.multiple {
            top: 84px;
            &::after {
                left: 30px;
            }
        }
        ul {
            margin-bottom: .5rem;
        }
        li {
            border-bottom: 1px solid $gray-light;
            &:last-child {
                border: 0;
            }
        }
        .user-list-single {
            align-content: center;
            align-items: center;
            display: flex;
            flex-direction: row;
            flex-grow: 0;
            padding: .5rem 0;
            &.selected {
                color: $primary;
            }
        }
        .user-list-avatar {
            height: 32px;
            margin-right: .5rem;
            width: 32px;
        }
        .user-list-name {
            @include font-type(text);
            flex-grow: 1;
            position: relative;
        }

        .remove svg {
            fill: $whitish;
            height: .8rem;
            width: .8rem;
        }

        .show-more {
            border-top: 1px solid $gray-light;
            padding-top: .5rem;
            text-align: center;
        }
    }

    .ticket-data-container {
        margin: 0;
        padding: 0 0 .1rem;
        .ticket-status .priority-data {
            margin: 0;
        }
    }

    .ticket-estimation .points-per-role {
        margin: 0;
    }

    .ticket-detail-settings {
        height: 52px;
        justify-content: left;
        margin: 1rem 0 0;
        label {
            border: 0;
            padding: 12px 13px;
            width: auto;
        }
        .item-block,
        .item-unblock {
            display: block;
            margin: 0;
        }
    }

    .blocked-note {
        margin-top: .5rem;
    }
}

.ticket-detail-settings .lightbox-assign-sprint-to-issue {
    .lightbox-assign-related-sprint {
        width: 700px;
    }

    svg {
        fill: initial;
        max-height: initial;
        max-width: initial;
    }

    fieldset {
        label {
            background: none;
            display: inline-block;
            margin-bottom: .5rem;
            margin-right: 0;
            padding: 0;

            +input {
                display: initial;
            }
        }
    }

    button {
        width: 100%;
    }
}


.lightbox-relate-to-epic {
    .lightbox-create-related-epic-wrapper {
        max-width: 600px;
        width: 90%;
    }
    .related-with-selector {
        display: flex;
        margin-bottom: 1rem;
        input {
            display: none;
            &:checked+label {
                background: $primary-light;
                color: $white;
                transition: background .2s ease-in;
            }
            &:checked+label:hover {
                background: $primary-light;
            }
            +label {
                background: rgba($whitish, .7);
                cursor: pointer;
                display: block;
                padding: 2rem 1rem;
                text-align: center;
                text-transform: uppercase;
                transition: background .2s ease-in;
            }
            +label:hover {
                background: rgba($primary-light, .3);
                transition: background .2s ease-in;
            }
        }
        .related-with-selector-single {
            flex: 1;
            &:first-child {
                margin-right: .5rem;
            }
        }
    }
    fieldset {
        label {
            display: inline-block;
            margin-bottom: .5rem;
        }
    }
    .new-epic-title {
        align-items: flex-end;
        display: flex;
    }
    .existing-epic-form,
    .new-epic-form {
        margin-bottom: 1rem;
    }
    .no-epics-found {
        padding: 1rem 0 0;
    }
    .new-epic-options {
        display: flex;
        margin-left: auto;
        input {
            display: none;
            &:checked+label {
                background: $primary-light;
                color: $white;
                fill: $white;
                transition: background .2s ease-in;
            }
            +label {
                background: $mass-white;
                color: $grayer;
                cursor: pointer;
                display: block;
                padding: .5rem;
                transition: background .2s ease-in;
            }
            +label:hover {
                background: $primary-light;
                color: $white;
                fill: $white;
            }
        }
    }
    button {
        width: 100%;
    }
}
