@import "include-media";
@import "colors";
@import "variables";
@import "general";

#wp-mail-logging {
    color: $description-text;
    margin: 0;

    .subsubsub {

        a.current {
            font-weight: $medium-weight;
        }
    }

    #wp-mail-logging-setting-db-upgrade {
        background: #fff;
        border: 1px solid #c3c4c7;
        border-left: 4px solid #e77c5c;
        box-shadow: 0 1px 1px rgba(0,0,0,.04);
        margin-bottom: 30px;
        padding: 16px;
        position: relative;

        h3 {
            font-size: 18px;
            line-height: 22px;
            margin-bottom: 10px;
        }

        ul {
            list-style-type: initial;
            list-style-position: inside;
        }

        #wp-mail-logging-btn-db-upgrade {
            height: inherit;
            padding: 11px 16px;
            line-height: 1.2;
        }
    }

    #wp-mail-logging-setting-tab-form {

        #wp-mail-logging-setting-tab-row-log-rotation-limit-amout-keep, #wp-mail-logging-setting-tab-row-log-rotation-delete-time-days {
            padding-top: 0;
        }

        #wp-mail-logging-settings-bottom {
            align-items: center;
            border-top: 1px solid #e4e4e4;
            display: flex;
            justify-content: space-between;
            margin-top: 15px;
            padding-top: 30px;
        }

        #wp-mail-logging-settings-reset-link {
            background: none;
            border: none;
            color: #2271B1;
            cursor: pointer;
            font-size: 14px;
            font-weight: 400;
            line-height: 35px;
            margin: 0;
            outline: 0;
            text-decoration: underline;

            &:hover {
                color: #135e96;
            }
        }
    }

    .wp-mail-logging-hide {
        display: none;
    }

    .wp-mail-logging-page-content {
        padding: 0 20px;

        *,
        *::before,
        *::after {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }

        #wp-mail-logging-setting-row-heading-general-settings {
            padding-top: 10px;
        }

        // Setting rows, eg field row.
        .wp-mail-logging-setting-row {
            border-bottom: 1px solid #e4e4e4;
            padding: 15px 0 30px 0;
            font-size: 14px;
            line-height: 1.3;

            @include media("<tablet") {
                padding: 20px 0;
            }

            &.inactive {
                display: none;
            }

            .wp-mail-logging-setting-mid-row-sep {
                background: #e4e4e4;
                height: 1px;
                border: 0;
                margin: 15px 0;
            }

            // Section heading.
            &.section-heading {
                padding: 30px 0 20px 0;

                &.no-desc {
                    h2,
                    h4 {
                        margin: 0;
                    }
                }

                .wp-mail-logging-setting-field {
                    margin: 0;
                    max-width: 1005px;
                }

                .desc {
                    font-style: normal;
                }
            }

            // Input settings field.
            &.wp-mail-logging-setting-row-input {
                input {
                    max-width: 80px;
                    padding: 8px 12px;
                }
            }

            // Checkbox settings field.
            &.wp-mail-logging-setting-row-checkbox {

                input[type=checkbox] {
                    float: left;
                    margin: 1px 0 0 0;
                }

                input[type=checkbox] + label {
                    margin: 0 0 0 8px;
                    vertical-align: baseline;
                }

                .desc {
                    margin: 0 0 0 30px;
                }

                input[type=checkbox] + label + .desc {
                    margin: 8px 0 0 0;
                }
            }

            // Text based settings field.
            &.wp-mail-logging-setting-row-text,
            &.wp-mail-logging-setting-row-password,
            &.wp-mail-logging-setting-row-number,
            &.wp-mail-logging-setting-row-email {

                .wp-mail-logging-setting-label {
                    padding-top: 8px;
                }
            }

            // Select settings field.
            &.wp-mail-logging-setting-row-select {

                .wp-mail-logging-setting-label {
                    padding-top: 8px;
                }
            }

            // Radio settings field.
            &.wp-mail-logging-setting-row-radio {

                .wp-mail-logging-setting-field {

                    input[type=radio] {
                        margin: -3px 10px 0 0;
                    }

                    label {
                        margin-right: 30px;
                        display: inline-block;
                    }
                }

            }

            &.wp-mail-logging-setting-row-no-border {
                border-bottom: none;
                padding-bottom: 15px;
            }

            &.wp-mail-logging-setting-row-no-padding {
                padding: 0;
            }

            // Radio settings field.
            &.wp-mail-logging-setting-row-checkbox-toggle {

                .wp-mail-logging-setting-field {

                    label {
                        vertical-align: middle;
                        display: inline-block;
                    }

                    input[type=checkbox] {
                        position: absolute;
                        top: auto;
                        overflow: hidden;
                        clip: rect(1px, 1px, 1px, 1px);
                        width: 1px;
                        height: 1px;
                        white-space: nowrap;

                        &:checked + .wp-mail-logging-setting-toggle-switch {
                            background-color: $positive;

                            &:before {
                                -webkit-transform: translateX(16px);
                                -ms-transform: translateX(16px);
                                transform: translateX(16px);
                            }
                        }

                        &:disabled {
                            &:checked:hover + .wp-mail-logging-setting-toggle-switch,
                            &:not(:checked):hover + .wp-mail-logging-setting-toggle-switch {
                                box-shadow: none;
                            }

                            &:not(:checked):hover + .wp-mail-logging-setting-toggle-switch {
                                background-color: #ddd;
                            }

                            & + .wp-mail-logging-setting-toggle-switch {
                                background-color: #ddd;
                                cursor: default;
                            }

                            &:checked + .wp-mail-logging-setting-toggle-switch {
                                background-color: lighten($positive, 25);
                                cursor: default;
                            }
                        }

                        &:checked + .wp-mail-logging-setting-toggle-switch + .wp-mail-logging-setting-toggle-checked-label {
                            display: inline-block;
                        }

                        &:checked + .wp-mail-logging-setting-toggle-switch + .wp-mail-logging-setting-toggle-checked-label + .wp-mail-logging-setting-toggle-unchecked-label {
                            display: none;
                        }

                        &:disabled + .wp-mail-logging-setting-toggle-switch + .wp-mail-logging-setting-toggle-checked-label,
                        &:disabled + .wp-mail-logging-setting-toggle-switch + .wp-mail-logging-setting-toggle-unchecked-label {
                            color: lighten(#444, 40);
                        }

                        &:checked:hover,
                        &:checked:focus {
                            & + .wp-mail-logging-setting-toggle-switch {
                                box-shadow: 0 0 0 1px #fff, 0 0 0 3px #2e876a;
                            }
                        }

                        &:not(:checked):hover,
                        &:not(:checked):focus {
                            & + .wp-mail-logging-setting-toggle-switch {
                                background-color: #8c8f94;
                                box-shadow: 0 0 0 1px #fff, 0 0 0 3px #999;
                            }
                        }
                    }

                    .wp-mail-logging-setting-toggle-unchecked-label,
                    .wp-mail-logging-setting-toggle-checked-label {
                        text-transform: uppercase;
                        font-weight: $medium-weight;
                        color: $secondary-text;
                        font-size: 12px;
                    }

                    .wp-mail-logging-setting-toggle-checked-label {
                        display: none;
                    }

                    .wp-mail-logging-setting-toggle-switch {
                        position: relative;
                        cursor: pointer;
                        background-color: #c3c4c7;
                        border-radius: 15px;
                        -webkit-transition: all 0.2s ease-in-out;
                        -moz-transition:    all 0.2s ease-in-out;
                        -ms-transition:     all 0.2s ease-in-out;
                        transition:         all 0.2s ease-in-out;
                        vertical-align: middle;
                        display: inline-block;
                        margin: -1px 5px 0 0;
                        width: 36px;
                        height: 20px;

                        &:before {
                            position: absolute;
                            content: "";
                            height: 16px;
                            width: 16px;
                            left: 2px;
                            top: 2px;
                            background-color: #fff;
                            border-radius: 50%;
                            -webkit-transition: all 0.2s ease-in-out;
                            -moz-transition:    all 0.2s ease-in-out;
                            -ms-transition:     all 0.2s ease-in-out;
                            transition:         all 0.2s ease-in-out;
                        }
                    }
                }
            }

            &.wp-mail-logging-setting-row-alert {
                padding-top: 20px;
                padding-bottom: 25px;

                .wp-mail-logging-setting-row {
                    border: none;
                }

                .section-heading {
                    margin-bottom: 25px;

                    h3 {
                        margin-bottom: 10px;
                        font-weight: $medium-weight;
                        font-size: 18px;
                        line-height: 22px;
                    }

                    .notice {
                        margin-top: 20px;

                        p {
                            margin: 6.5px 0;
                            font-size: 13px;
                        }
                    }
                }

                .wp-mail-logging-setting-row {
                    padding: 0 !important;

                    & + .wp-mail-logging-setting-row {
                        margin-top: 20px;
                    }
                }

                .wp-mail-logging-setting-field {

                    .wp-mail-logging-setting-toggle-checked-label,
                    .wp-mail-logging-setting-toggle-unchecked-label {
                        text-transform: none;
                    }
                }

                .wp-mail-logging-setting-label {
                    label {
                        font-weight: $medium-weight;
                    }
                }
            }

            // General elements.
            h2, h4 {
                color: $primary-text;
                font-size: 18px;
                font-weight: $medium-weight;
                line-height: 22px;
            }

            h2 {
                margin-top: 0;
                margin-bottom: 10px;
            }

            h3 {
                color: $primary-text;
                font-size: 24px;
                font-weight: 600;
                margin: 0 0 20px 0;
            }

            h5 {
                color: $primary-text;
                font-size: 16px;
                font-weight: 600;
                margin: 0 0 20px 0;
            }

            p {
                margin: 12px 0 0;
                font-size: 14px;
                line-height: 20px;

                &.desc {
                    margin: 10px 0 0;
                    color: $secondary-text;

                    & + .desc {
                        font-style: normal;
                    }
                }
            }

            ul {
                margin: 8px 0 0;

                &.list {
                    li {
                        margin-left: 20px;
                        list-style-type: disc;
                    }
                }
            }

            table {
                &.actions-list {
                    td, th {
                        padding: 5px 5px 5px 0;
                        text-align: left;
                    }

                    td {
                        &.email {
                            padding-right: 2em;
                        }
                        &.status {
                            width: 100px;
                        }
                        &.actions {
                            a {
                                border-bottom: 1px solid;
                                display: inline-block;
                                margin-right: 5px;
                                text-decoration: none;

                                &[class*=delete],
                                &[class*=error] {
                                    color: $negative;

                                    &:hover, &:active, &:focus {
                                        color: darken( $negative, 20 );
                                    }
                                }
                            }
                        }
                    }

                }
            }

            // Form elements.
            input[type=text],
            input[type=email],
            input[type=number],
            input[type=password],
            select {
                background-color: #fff;
                border: 1px solid $field-border;
                border-radius: 4px;
                box-shadow: none;
                color: $field-text;
                display: inline-block;
                vertical-align: middle;
                padding: 7px 12px;
                margin: 0 10px 0 0;
                width: 400px;
                min-height: 35px;
                line-height: 1.3;

                @include media("<desktop") {
                    width: 300px;
                }

                @include media("<phone") {
                    width: 100%;
                    max-width: unset;
                    margin-right: 0;

                    & ~ button {
                        margin-top: 8px;
                    }
                }

                &[readonly] {
                    background-color: #f9f9f9;
                }

                &.small-text {
                    width: 75px;
                }

                &:focus {
                    border: 1px solid #016AAB;
                    box-shadow: 0 0 0 1px #016AAB;
                    outline: none;
                }

                &:disabled {
                    opacity: 0.6;
                }
            }

            input[type=checkbox],
            input[type=radio] {
                &:focus {
                    border: 1px solid #016AAB;
                    box-shadow: 0 0 0 1px #016AAB;
                    outline: none;
                }
            }

            input[type=number] {
                width: 80px;
            }

            select {
                background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTMiIGhlaWdodD0iNyIgdmlld0JveD0iMCAwIDEzIDciIGZpbGw9IiM4ZDhmOTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMyAwLjk5ODI4MUMxMyAwLjkwMjA2MiAxMi45NTE5IDAuNzkzODE0IDEyLjg3OTcgMC43MjE2NDlMMTIuMjc4NCAwLjEyMDI3NEMxMi4yMDYyIDAuMDQ4MTA5OCAxMi4wOTggMCAxMi4wMDE3IDBDMTEuOTA1NSAwIDExLjc5NzMgMC4wNDgxMDk4IDExLjcyNTEgMC4xMjAyNzRMNi45OTgzIDQuODQ3MDhMMi4yNzE1IDAuMTIwMjc0QzIuMTk5MzMgMC4wNDgxMDk4IDIuMDkxMDggMCAxLjk5NDg2IDBDMS44ODY2MiAwIDEuNzkwNCAwLjA0ODEwOTggMS43MTgyMyAwLjEyMDI3NEwxLjExNjg2IDAuNzIxNjQ5QzEuMDQ0NjkgMC43OTM4MTQgMC45OTY1ODIgMC45MDIwNjIgMC45OTY1ODIgMC45OTgyODFDMC45OTY1ODIgMS4wOTQ1IDEuMDQ0NjkgMS4yMDI3NSAxLjExNjg2IDEuMjc0OTFMNi43MjE2NyA2Ljg3OTcyQzYuNzkzODMgNi45NTE4OSA2LjkwMjA4IDcgNi45OTgzIDdDNy4wOTQ1MiA3IDcuMjAyNzcgNi45NTE4OSA3LjI3NDkzIDYuODc5NzJMMTIuODc5NyAxLjI3NDkxQzEyLjk1MTkgMS4yMDI3NSAxMyAxLjA5NDUgMTMgMC45OTgyODFaIiBmaWxsPSIjOGQ4Zjk1Ii8+Cjwvc3ZnPgo=");
                background-position: right 12px center;
                background-repeat: no-repeat;
            }
        }

        // Row label (left).
        .wp-mail-logging-setting-label {
            display: block;
            float: left;
            width: 205px;
            padding: 0 20px 0 0;

            @include media("<tablet") {
                float: none;
                width: 100%;
                padding-bottom: 15px;
            }

            label {
                color: $label-text;
                display: block;
                font-weight: $medium-weight;
            }
        }

        // Row field (right).
        .wp-mail-logging-setting-field {
            display: block;
            margin: 0 0 0 205px;
            max-width: 800px;

            @include media("<tablet") {
                margin: 0;
            }

            hr {
                margin: 20px 0;
            }

            .wp-mail-logging-setting-field-row {
                display: flex;
                flex-wrap: wrap;

                & > .wp-mail-smtp-btn {
                    margin-right: 10px;
                }
            }
        }

        .wp-mail-logging-submit {
            margin: 0;
            padding: 25px 0;

            .help-text {
                margin-left: 10px;
                vertical-align: middle;
            }
        }

        .notice-inline {
            background: #fff;
            border-left: 4px solid #fff;
            box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
            margin: 5px 0 15px;
            padding: 1px 12px;

            &.notice-success {
                border-left-color: $positive;
            }

            &.notice-warning {
                border-left-color: #ffb900;
            }

            &.notice-error {
                border-left-color: $negative;
            }

            &.notice-info {
                border-left-color: #00a0d2;
            }
        }

        .notice p,
        .notice-inline p {
            margin: 0.5em 0;
            padding: 2px;
        }

        pre {
            white-space: pre-line;
        }

        &.active {
            display: block;
        }
    }

    .wp-mail-logging-setting-toggle {
        vertical-align: middle;
        display: inline-block;

        &__switch {
            position: relative;
            cursor: pointer;
            background-color: #ccc;
            border-radius: 15px;
            -webkit-transition: all 0.2s ease-in-out;
            -moz-transition: all 0.2s ease-in-out;
            -ms-transition: all 0.2s ease-in-out;
            transition: all 0.2s ease-in-out;
            vertical-align: middle;
            display: inline-block;
            margin: -1px 0 0 0;
            width: 36px;
            height: 20px;

            &:before {
                position: absolute;
                content: "";
                height: 16px;
                width: 16px;
                left: 2px;
                top: 2px;
                background-color: #fff;
                border-radius: 50%;
                -webkit-transition: all 0.2s ease-in-out;
                -moz-transition: all 0.2s ease-in-out;
                -ms-transition: all 0.2s ease-in-out;
                transition: all 0.2s ease-in-out;
            }
        }

        input[type=checkbox] {
            position: absolute;
            top: auto;
            overflow: hidden;
            clip: rect(1px, 1px, 1px, 1px);
            width: 1px;
            height: 1px;
            white-space: nowrap;

            &:checked + .wp-mail-logging-setting-toggle__switch {
                background-color: $positive;

                &:before {
                    -webkit-transform: translateX(16px);
                    -ms-transform: translateX(16px);
                    transform: translateX(16px);
                }
            }

            &:checked:hover,
            &:checked:focus {
                & + .wp-mail-logging-setting-toggle__switch {
                    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #00a32a;
                }
            }

            &:not(:checked):hover,
            &:not(:checked):focus {
                & + .wp-mail-logging-setting-toggle__switch {
                    background-color: #999;
                    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #999;
                }
            }

            &:disabled {
                &:checked:hover + .wp-mail-logging-setting-toggle__switch,
                &:not(:checked):hover + .wp-mail-logging-setting-toggle__switch {
                    box-shadow: none;
                }

                &:not(:checked):hover + .wp-mail-logging-setting-toggle__switch {
                    background-color: #ddd;
                }

                & + .wp-mail-logging-setting-toggle__switch {
                    background-color: #ddd;
                    cursor: default;
                }

                &:checked + .wp-mail-logging-setting-toggle__switch {
                    background-color: lighten(#00a32a, 25);
                    cursor: default;
                }
            }
        }
    }

    // Email Logs.
    #email-list {

        table.emails {

            border-radius: 4px;

            th, td {
                vertical-align: middle;
            }

            .column-cb,
            .check-column {
                padding: 0;
                text-align: center;
                vertical-align: middle;

                @include media("<=phone") {
                    padding: 10px 0 0 3px;
                }
            }

            th#timestamp, th#actions, td.column-timestamp, td.column-actions {
                width: 200px;
                max-width: 200px;
            }

            td.column-actions {
                text-align: right;
                vertical-align: middle;

                .wp-mail-logging-action-column {
                    align-items: center;
                    display: flex;
                    justify-content: flex-end;

                    .wp-mail-logging-action-item {
                        align-items: center;
                        display: flex;
                        background-color: #FFFFFF;
                        border: 1px solid #CCD0D4;
                        border-radius: 5px;
                        color: #8C8F94;
                        line-height: 0;
                        margin: 0 4px;
                        padding: 5px;

                        img {
                            width: 16px;
                            height: 16px;
                        }

                        &:hover, &:focus {
                            border-color: #3c434a;
                            color: #3c434a;
                            cursor: pointer;
                        }
                    }
                }
            }
        }

        p.search-box {
            @include media("<=phone") {
                position: relative;
                bottom: auto;
                max-width: 600px;
                width: 100%;
                height: auto;
                clear: both;
                margin-bottom: 10px;

                select, input[type="search"] {
                    width: 100%;
                    max-width: unset;
                    margin: 0 0 5px 0;
                }
            }

            select {
                vertical-align: unset;
            }
        }
    }
}

#wp-mail-logging-page-header-temp {
    margin: 0;
    position: absolute;
    top: -1px;
    left: 20px;
    right: 0;
    z-index: 99;
}

#wp-mail-logging-page-header {
    background-color: #FFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;

    .wp-mail-logging-page-title {
        align-items: center;
        display: flex;
        font-size: 14px;
        padding: 4px 20px 0;

        @include media("<=phone") {
            display: block;
            padding-top: 20px;
        }

        .wp-mail-logging-logo-image {
            align-items: center;
            justify-content: center;
        }

        .wp-mail-logging-logo-sep {
            margin: 0 15px;

            @include media("<=phone") {
                display: none;
            }
        }

        a.tab {
            border-bottom: 4px solid #fff;
            box-shadow: none;
            color: #787C82;
            display: inline-block;
            font-weight: $medium-weight;
            margin-right: 30px;
            padding: 20px 0 18px 0;
            text-decoration: none;

            &.active {
                border-color: #E77C5C;
                color: #2C3338;

                &:hover {
                    border-color: #E77C5C;
                }
            }

            &:hover {
                border-color: #a7aaad;
            }
        }

        a.action {
            color: #fff;
            font-weight: 600;
            margin: 14px 0 14px 10px;
            line-height: 28px;
            min-height: 30px;
            vertical-align: top;

            @include media("<=phone") {
                margin-left: 0;
            }
        }

        .page-title {
            background-color: #fff;
            display: inline-block;
            font-size: 23px;
            margin: 0;
            padding: 20px 20px 20px 0;
        }
    }
}

// Buttons.
.wp-mail-logging-btn {
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    margin: 0;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    text-shadow: none;
    box-shadow: none;
    outline: none;

    &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    &.wp-mail-logging-btn-lg {
        font-size: 16px;
        font-weight: $medium-weight;
        padding: 12px 16px;
    }

    &.wp-mail-logging-btn-orange {
        background-color: #E77C5C;
        color: #fff;

        &:hover,
        &:active,
        &:focus {
            background-color: $orange-dark;
            border: 0;
            color: #FFFFFF;
        }

        &:focus {
            box-shadow: 0 0 0 1px #fff, 0 0 0 3px $orange-dark;
        }
    }
}

// Lightbox.
.wp-mail-logging-admin-page {

    /* Lightbox library global styles. */
    .lity {
        z-index: 999999999;
        padding: 20px;
    }

    .lity-close {
        margin: 10px;
    }

    .lity-content {
        max-width: 80vw;
        max-height: 80vh;

        img {
            max-height: 80vh !important;
            max-width: 80vw !important;
        }
    }
}

.wp-mail-logging-admin-page {

	p.search-box {
		@include media("<=tablet") {
			width: 80%;
		}
	}

    #wpfooter p {
        color: #50575E;
        font-weight: 400;

        strong {
            font-weight: $medium-weight;
        }
    }
}

// Utility.
.wp-mail-logging-clearfix {

    &:after, &:before {
        content: " ";
        display: table;
    }

    &:after {
        clear: both;
    }
}

@import "wp-mail-logging-product-education";
@import "confirm";
