//
// app-email.scss
//

.email-container {
    background-color: $card-bg;

    .inbox-leftbar {
        width: $main-nav-width;
        padding-right: $card-spacer-x;
        float: left;
    }

    .inbox-rightbar {
        margin-left: $main-nav-width;
        border-left: $border-width solid $border-color;
        padding: 0 0 $spacer $spacer;
    }
}

.message-list {
    display: block;
    padding-left: 0;

    li {
        position: relative;
        display: block;
        height: 48px;
        line-height: 48px;
        cursor: default;
        transition-duration: 0.3s;
        background: $card-bg;
        margin-bottom: 1px;
        box-shadow: $box-shadow-sm;

        a {
            color: $link-color;
        }

        &:hover {
            background-color: var(--#{$prefix}light);
            transition-duration: 0.05s;
        }

        .col-mail {
            float: left;
            position: relative;
        }

        .col-mail-1 {
            width: 320px;
            display: flex;
            align-items: flex-end;

            .trash-toggle,
            .important-toggle,
            .star-toggle,
            .checkbox-wrapper-mail,
            .dot {
                display: block;
                float: left;
            }

            .dot {
                border: 4px solid transparent;
                border-radius: 100px;
                margin: 22px 26px 0;
                height: 0;
                width: 0;
                line-height: 0;
                font-size: 0;
            }

            .checkbox-wrapper-mail {
                margin: 15px 10px 0 20px;
            }

            .star-toggle,
            .important-toggle,
            .trash-toggle {
                color: var(--#{$prefix}link-color);
                font-size: 20px;
                margin: 0 10px 0 10px;
                cursor: pointer;
            }

            .title {
                position: absolute;
                top: 0;
                left: 140px;
                right: 0;
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
                margin-bottom: 0;
                line-height: 50px;
            }
        }

        .col-mail-2 {
            position: absolute;
            top: 0;
            left: 320px;
            right: 0;
            bottom: 0;

            .subject,
            .date {
                position: absolute;
                top: 0;
            }

            .subject {
                left: 0;
                right: 110px;
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
            }

            .date {
                right: 0;
                width: 100px;
                padding-left: 10px;
            }
        }
    }

    li.active,
    li.mail-selected {
        background: var(--#{$prefix}tertiary-bg);
        transition-duration: 0.05s;
    }

    li.active,
    li.active:hover {
        box-shadow: inset 3px 0 0 $cyan;
    }

    li.unread a {
        font-weight: $font-weight-semibold;
        color: var(--#{$prefix}tertiary-color);
    }

    .checkbox-wrapper-mail {
        cursor: pointer;
        height: 20px;
        width: 20px;
        position: relative;
        display: inline-block;
        box-shadow: inset 0 0 0 2px var(--#{$prefix}link-color);
        border-radius: 3px;

        input {
            opacity: 0;
            cursor: pointer;
        }

        input:checked~label {
            opacity: 1;
        }

        label {
            position: absolute;
            top: 3px;
            left: 3px;
            right: 3px;
            bottom: 3px;
            cursor: pointer;
            background: var(--#{$prefix}body-color);
            opacity: 0;
            margin-bottom: 0 !important;
            transition-duration: 0.05s;
        }

        label:active {
            background: var(--#{$prefix}border-color);
        }
    }
}

.mail-list {
    a {
        color: $gray-700;
        padding: 7px 10px;
        display: block;
    }
}

.reply-box {
    border: 2px solid var(--#{$prefix}light);
}

@media (max-width: 648px) {
    .email-container {
        .inbox-leftbar {
            width: 100%;
            float: none;
            margin-bottom: 21px;
            padding-bottom: 1.25rem;
        }

        .inbox-rightbar {
            margin-left: 0;
            border: 0;
            padding-left: 0;
        }
    }
}

@media (max-width: 520px) {
    .inbox-rightbar {
        >.btn-group {
            margin-bottom: 10px;
        }
    }

    .message-list li {
        .col-mail-1 {
            width: 150px;

            .title {
                left: 130px;
            }
        }

        .col-mail-2 {
            left: 160px;

            .date {
                text-align: right;
                padding-right: 10px;
                padding-left: 20px;
            }
        }
    }
}

// compose

.compose-mail {

    .modal-dialog {
        width: 600px !important;
    }
}

.mail-read {
    width: 100% !important;
    max-width: 100% !important;
    z-index: 990 !important;
}