/**
 * WPGuards admin style
 */

.wpguards {

    /**
     * Columns
     */
    
    .columns {
        overflow: hidden;
    }

    .column_3 {
        float: left;
        width: 33.3%;

        .postbox {
            margin-right: 15px;
        }

        &:nth-child(3) .postbox {
            margin-right: 0;
        }
    }

    .column_2 {
        float: left;
        width: 50%;

        .postbox {
            margin-right: 15px;
        }

        &:nth-child(2) .postbox {
            margin-right: 0;
        }
    }

    /**
     * Forms
     */
    
    .fieldset {
        margin-bottom: 10px;
    }

    .fieldset:first-child {
        margin-top: 12px;
    }

    .fieldset.button-holder {
        margin-top: 26px;
    }

    label {
        display: block;
        font-weight: 600;
        margin-bottom: 8px;
    }

    select,
    input:not([type="checkbox"]) {
        width: 360px;
    }

    .description {
        display: block;
        padding: 6px 0;
    }

    button,
    a.button {
        border-width: 0;

        &.button-primary {
            -webkit-box-shadow: 0px 2px 0px 0px #00648C;
            -moz-box-shadow:    0px 2px 0px 0px #00648C;
            box-shadow:         0px 2px 0px 0px #00648C;
            border-width: 0;

            &:hover {
                background: #00648C;
                -webkit-box-shadow: 0px 2px 0px 0px #00648C;
                -moz-box-shadow:    0px 2px 0px 0px #00648C;
                box-shadow:         0px 2px 0px 0px #00648C;
            }
        }

        &.button-secondary {
            -webkit-box-shadow: 0px 2px 0px 0px #ccc;
            -moz-box-shadow:    0px 2px 0px 0px #ccc;
            box-shadow:         0px 2px 0px 0px #ccc;
            border-width: 0;

            &:hover {
                background: #ccc;
                -webkit-box-shadow: 0px 2px 0px 0px #ccc;
                -moz-box-shadow:    0px 2px 0px 0px #ccc;
                box-shadow:         0px 2px 0px 0px #ccc;
            }
        }

        &.button-large {
            height: auto;
            line-height: auto;
            font-size: 1.1em;
            padding: 5px 10px;
        }
    }

    /**
     * Utilities
     */
    
    .align-left {
        text-align: left;
    }

    .align-center {
        text-align: center;
    }

    .align-right {
        text-align: right;
    }

    /**
     * Loader
     */
    
    .loader {
        &.small-icon {
            min-height: 100px;
            background: url(../../assets/loader-small.gif) center no-repeat;
        }

        &.large-icon {
            min-height: 250px;
            background: url(../../assets/loader-large.gif) center no-repeat;
        }
    }

    /**
     * Home page styles
     */
    
    &.wpguards-home {
        .columns .inside {
            height: 210px;
        }

        #profile {
            #user_avatar {
                float: left;
                margin-right: 20px;

                img {
                    border-radius: 50%;
                }
            }

            h3 {
                font-size: 1.5em;
                line-height: 80px;
                white-space: nowrap;
                padding: 0;
            }
        }

        #plan {
            a.button {
                margin-top: 10px;
            }
        }

        #uptime {
            .chart-wrapper {
                text-align: center;
                margin-top: 5px;
            }
            
        }

        table {
            margin-top: 10px;
            width: 100%;

            th {
                width: 50%;
                font-weight: 400;
                text-align: right;
                font-style: italic;
                padding-right: 5px;
                padding-bottom: 7px;
            }

            td {
                padding-left: 5px;
                font-weight: bold;
                padding-bottom: 7px;
            }
        }
    }

    /**
     * Backup page styles
     */
    
    &.wpguards-backups {
        table.backups {
            border-collapse: collapse; 
            width: 100%;

            thead th {
                padding: 15px 0;
                color: #828296;
                text-transform: uppercase;
                text-align: left;

                &.col-backup {
                    padding-left: 80px;
                }
            }

            .col-backup {
                width: 70%;
            }

            .col-download {
                width: 15%;
                text-align: center;
            }

            .col-restore {
                width: 15%;
                text-align: center;
            }

            tbody {
                tr {
                    .col-backup {
                        position: relative;
                        height: 70px;
                        padding-left: 80px;

                        span.dashicons {
                            position:absolute;
                            top: 50%;
                            left: 10px;
                            font-size: 30px;
                            color: #fff;
                            display: block;
                            width: 50px;
                            height: 50px;
                            line-height: 50px;
                            border-radius: 50%;
                            margin-top:-25px;
                            text-align: center;
                            background: #7ad03a;

                            -webkit-transition: all 100ms ease;
                                    transition: all 100ms ease;
                        }

                        div.info {
                            font-size: 0.9em;
                            color: #c0c0c0;

                            i {
                                font-weight: 100;
                            }
                        }
                    }

                    &.schdeuled-backup .col-backup span.dashicons {
                        background: #e0e0e0;
                    }

                    &:hover .col-backup span.dashicons {
                        width: 56px;
                        height: 53px;
                        margin-left: -3px;
                        margin-top: -28px;
                        padding-top: 3px;
                    }
                }
            }
        }
    }

    /**
     * Scan page styles
     */
    
    &.wpguards-scans {
        table.scans {
            border-collapse: collapse; 
            width: 100%;

            thead th {
                padding: 15px 0;
                color: #828296;
                text-transform: uppercase;
                text-align: left;
            }

            tbody {
                tr {
                    .col-scan {
                        position: relative;
                        padding: 17px 0 17px 80px;
                        cursor: pointer;

                        span.dashicons {
                            position:absolute;
                            top: 36px;
                            left: 10px;
                            font-size: 30px;
                            color: #fff;
                            display: block;
                            width: 50px;
                            height: 50px;
                            line-height: 50px;
                            border-radius: 50%;
                            margin-top:-25px;
                            text-align: center;
                            background: #7ad03a;

                            -webkit-transition: all 100ms ease;
                                    transition: all 100ms ease;
                        }

                        div.info {
                            font-size: 0.9em;
                            color: #c0c0c0;

                            i {
                                font-weight: 100;
                            }
                        }

                        .scan table {
                            cursor: default;
                            width: 100%;

                            td {
                                padding: 8px 0;
                            }

                            i {
                                font-weight: 100;
                                color: #c0c0c0;
                            }

                            td:first-child {
                                position: relative;
                                width: 10px;

                                &:before {
                                    content: "";
                                    display: block;
                                    width: 6px;
                                    height: 6px;
                                    border-radius: 50%;
                                    background: #7ad03a;
                                }
                            }

                            .red td:first-child:before {
                                background: #dd3d36;
                            }
                        }
                    }

                    &.schdeuled-scan span.dashicons {
                        background: #e0e0e0;
                    }

                    &:hover .col-scan span.dashicons {
                        width: 56px;
                        height: 53px;
                        margin-left: -3px;
                        margin-top: -28px;
                        padding-top: 3px;
                    }

                    &.red {
                        span.dashicons {
                            background: #dd3d36;
                        }
                    }
                }
            }
        }
    }

    /**
     * Payments page styles
     */
    
    &.wpguards-uptime {
        .column_3 {
            canvas {
                display: block;
                margin: 0 auto;
            }
        }

        .column_3:nth-child(2n) {
            table {
                margin-top: 10px;
                width: 100%;

                th {
                    width: 50%;
                    font-weight: 400;
                    text-align: right;
                    font-style: italic;
                    padding-right: 5px;
                    padding-bottom: 7px;
                }

                td {
                    padding-left: 5px;
                    font-weight: bold;
                    padding-bottom: 7px;
                }
            }
        }
    }

    /**
     * Payments page styles
     */
    
    &.wpguards-payments {
        table.payments {
            border-collapse: collapse; 
            width: 100%;

            thead th {
                padding: 15px 0;
                color: #828296;
                text-transform: uppercase;
                text-align: left;
            }

            tbody {
                tr {
                    .col-payment {
                        position: relative;
                        padding: 17px 0 17px 80px;

                        span.dashicons {
                            position:absolute;
                            top: 45px;
                            left: 10px;
                            font-size: 30px;
                            color: #fff;
                            display: block;
                            width: 50px;
                            height: 50px;
                            line-height: 50px;
                            border-radius: 50%;
                            margin-top:-25px;
                            text-align: center;
                            background: #7ad03a;

                            -webkit-transition: all 100ms ease;
                                    transition: all 100ms ease;
                        }

                        &.red {
                            span.dashicons {
                                background: #dd3d36;
                            }
                        }

                    }

                    &:hover .col-payment span.dashicons {
                        width: 56px;
                        height: 53px;
                        margin-left: -3px;
                        margin-top: -28px;
                        padding-top: 3px;
                    }
                }
                div.info {
                    font-size: 0.9em;
                    color: #c0c0c0;

                    i {
                        font-weight: 100;
                    }
                }
            }
        }
    }

    /**
     * Support page
     */
    &.wpguards-support {
        select,
        input,
        textarea {
            width: 100%;
        }

        .column_2 .postbox {
            height: 380px;
        }

        #new-ticket {
            #description {
                height: 90px;
            }
        }

        #receipt {
            table {
                width: 100%;
                font-family: "Lucida Console", Monaco, monospace;
                border-collapse: collapse; 
                
                thead {

                    th {
                        padding: 10px 0;
                        text-align: left;

                        &.col-cost {
                            text-align: right;
                        }
                    }
                }

                tbody {
                    td {
                        padding: 5px 0;

                        &.col-ticket {
                            width: 20%;
                        }
                        &.col-time {
                            width: 20%;
                            text-align: right;
                        }
                        &.col-at {
                            width: 5%;
                            text-align: center;
                        }
                        &.col-price {
                            width: 30%;
                        }
                        &.col-total {
                            text-align: right;
                            width: 25%;
                        }
                    }
                }

                tfoot {
                    td {
                        padding: 10px 0;
                        text-align: right;
                    }
                }
            }

            #paypal-button {
                display: block;
                margin-top: 20px;
                text-align: right;

                input {
                    width: 107px
                }
            }
            
        }

        #tickets {
            table {
                border-collapse: collapse; 
                width: 100%;

                thead th {
                    padding: 15px 0;
                    color: #828296;
                    text-transform: uppercase;

                    &.col-subject {
                        padding-left: 80px;
                    }
                }

                tbody {
                    tr {
                        .col-subject {
                            position: relative;
                            height: 70px;
                            padding-left: 80px;

                            span.dashicons {
                                position:absolute;
                                top: 50%;
                                left: 10px;
                                font-size: 30px;
                                color: #fff;
                                display: block;
                                width: 50px;
                                height: 50px;
                                line-height: 50px;
                                border-radius: 50%;
                                margin-top:-25px;
                                text-align: center;
                                background: #ffba00;

                                -webkit-transition: all 100ms ease;
                                        transition: all 100ms ease;
                            }

                            div.info {
                                font-size: 0.9em;
                                color: #c0c0c0;

                                i {
                                    font-weight: 100;
                                }
                            }
                        }

                        &:hover .col-subject span.dashicons {
                            width: 56px;
                            height: 53px;
                            margin-left: -3px;
                            margin-top: -28px;
                            padding-top: 3px;
                        }
                    }

                    tr.ticket {
                        cursor: pointer;
                    }

                    tr.expand {
                        background: #f5f5f5;

                        .comments-expand {
                            display: none;
                        }

                        .comments {
                            padding: 15px;

                            .comment {
                                background: #ffffff;
                                border-radius: 5px;
                                position: relative;
                                padding: 20px;

                                p:first-child {
                                    margin-top: 0;
                                }

                                .footer {
                                    margin-top: 10px;

                                    .attachments {
                                        margin-bottom: 10px;

                                        strong {
                                            display: block;
                                            margin-bottom: 5px;
                                        }

                                        ul {
                                            list-style: disc;
                                            padding-left: 20px;
                                        }
                                    }

                                    .time {
                                        font-size: 12px;
                                        color: #999;
                                    }
                                }

                                &.customer {
                                    margin: 10px 100px 10px 0;

                                    &:after {
                                        border-left: 8px solid #ffffff;
                                        left: 100%;
                                    }

                                    .customer-avatar {
                                        position: absolute;
                                        right: 0;
                                        margin-right: -100px;
                                        top: 50%;
                                        margin-top: -40px;
                                    }
                                }

                                &.support {
                                    margin: 10px 0 10px 100px;

                                    &:after {
                                        border-right: 8px solid #ffffff;
                                        right: 100%;
                                    }

                                    .support-avatar {
                                        position: absolute;
                                        left: 0;
                                        margin-left: -100px;
                                        top: 50%;
                                        margin-top: -40px;
                                    }
                                }

                                &:after {
                                    content: '';
                                    position: absolute;
                                    top: 50%;
                                    margin-top: -8px;
                                    width: 0;
                                    height: 0;
                                    border-top: 8px solid transparent;
                                    border-bottom: 8px solid transparent;
                                }
                            }
                        }

                        .response {
                            overflow: hidden;
                            background: #ffffff;

                            .fieldset:first-child {
                                display: none;
                            }

                            textarea {
                                border: none;
                                outline-style: none;
                                box-shadow: none;
                            }

                            .button-holder {
                                margin: 10px;
                            }
                        }
                    }
                }
            }
        }
    }

    /**
     * Utilities page
     */
    
    &.wpguards-utilities {
        .postbox.utility {
            position: relative;
            padding-left: 70px;

            h3 a {
                color: rgb(68, 68, 68);
                text-decoration: none;
            }

            .inside {
                margin: 0;
            }

            span.dashicons {
                position:absolute;
                top: 50%;
                left: 10px;
                font-size: 30px;
                color: #fff;
                display: block;
                width: 50px;
                height: 50px;
                line-height: 50px;
                border-radius: 50%;
                margin-top: -25px;
                text-align: center;
                background: #ffba00;

                -webkit-transition: all 100ms ease;
                        transition: all 100ms ease;
            }

            &:hover span.dashicons {
                width: 56px;
                height: 53px;
                margin-left: -3px;
                margin-top: -28px;
                padding-top: 3px;
            }
        }
    }
}