@import "../start";
@import "tag";

.fs-notice[data-id="license_not_whitelabeled"], .fs-notice[data-id="license_whitelabeled"] {
    &.success {
        color: inherit;
        border-left-color: #00a0d2;

        label.fs-plugin-title {
            display: none;
        }
    }
}

#fs_account
{
    .postbox,
    .widefat
    {
        max-width: 800px;
    }

    h3
    {
        font-size: 1.3em;
        padding: 12px 15px;
        margin: 0 0 12px 0;
        line-height: 1.4;
        border-bottom: 1px solid #F1F1F1;

        .dashicons {
            width: 26px;
            height: 26px;
            font-size: 1.3em;
        }
    }

    i.dashicons
    {
        font-size: 1.2em;
        height: 1.2em;
        width: 1.2em;
    }

    .dashicons
    {
        vertical-align: middle;
    }

    .fs-header-actions
    {
        position: absolute;
        top: 17px;
        right: 15px;
        font-size: 0.9em;

        ul
        {
            margin: 0;
        }

        li
        {
            form
            {
                display: inline-block;
            }

            float: left;
            a
            {
                text-decoration: none;
            }
        }
    }
}

#fs_account_details .button-group {
    float: none;
}

.rtl #fs_account .fs-header-actions
{
    left: 15px;
    right: auto;
}

.fs-key-value-table
{
    width: 100%;

    form
    {
        display: inline-block;
    }

    tr
    {
        td:first-child
        {
            nobr
            {
                font-weight: bold;
            }

            text-align: right;

            form
            {
                display: block;
            }
        }

        td.fs-right
        {
            text-align: right;
        }

        &.fs-odd
        {
            background: #ebebeb;
        }
    }

    td, th
    {
        padding: 10px;
    }

    code {
        line-height: 28px;
    }

    var, code, input[type="text"]
    {
        color: #0073AA;
        font-size: 16px;
        background: none;
    }

    input[type="text"] {
        width: 100%;
        font-weight: bold;
    }
}

.fs-field-beta_program label {
    margin-left: 7px;
}

label.fs-tag
{
    background: #ffba00;
    color: #fff;
    display: inline-block;
    border-radius: 3px;
    padding: 5px;
    font-size: 11px;
    line-height: 11px;
    vertical-align: baseline;

    &.fs-warn
    {
        background: #ffba00;
    }
    &.fs-success
    {
        background: #46b450;
    }
    &.fs-error
    {
        background: #dc3232;
    }
}

#fs_sites
{
    .fs-scrollable-table
    {
        .fs-table-body {
            max-height: 200px;
            overflow: auto;
            border: 1px solid #e5e5e5;

            & > table.widefat {
                border: none !important;
            }
        }

        .fs-main-column {
            width: 100%;
        }

        .fs-site-details
        {
            td:first-of-type
            {
                text-align: right;
                color:      grey;
                width: 1px;
            }

            td:last-of-type
            {
                text-align: right;
            }
        }

        .fs-install-details table
        {
            tr td
            {
                width: 1px;
                white-space: nowrap;

                &:last-of-type
                {
                    width: auto;
                }
            }
        }
    }
}

#fs_addons
{
    h3
    {
        border: none;
        margin-bottom: 0;
        padding: 4px 5px;
    }

    td
    {
        vertical-align: middle;
    }

    thead {
        white-space: nowrap;
    }

    td:first-child,
    th:first-child
    {
        text-align: left;
        font-weight: bold;
    }
    td:last-child,
    th:last-child
    {
        text-align: right;
    }
    th
    {
        font-weight: bold;
    }
}

#fs_billing_address {
    width: 100%;

    tr {
        td {
            width: 50%;
            padding: 5px;
        }

        &:first-of-type {
            td {
                padding-top: 0;
            }
        }
    }

    @mixin read-mode {
        border-color: transparent;
        color: #777;
        border-bottom: 1px dashed #ccc;
        padding-left: 0;
        background: none;
    }

    span {
        font-weight: bold;
    }

    input, select {
        @include placeholder(transparent);

        display: block;
        width: 100%;
        margin-top: 5px;

        &.fs-read-mode {
            @include read-mode();
        }
    }


    &.fs-read-mode {
        td span {
            display: none;
        }

        input, select
        {
            @include read-mode();
            @include placeholder(#ccc);
        }
    }


    button {
        display: block;
        width: 100%;
    }
}

// Fixes for issue 453.
// Just a patch, ideally need to tweak the markup a bit to make it more
// maintainable.
@media screen and (max-width: 639px) {
    #fs_account {
        // Make the [Deactivate License ; Change Plan] action row come in next line.
        .fs-header-actions {
            position: static;
            padding: 0 15px 12px 15px;
            margin: 0 0 12px 0;

            li {
                float: none;
                display: inline-block;
            }
        }

        // Optimize the table view by making it appear as blocked instead of "table".
        #fs_account_details {
            display: block;

            tbody, tr, td, th {
                display: block;
            }

            tr {
                td {
                    &:first-child {
                        text-align: left;
                    }

                    &:nth-child(2) {
                        padding: 0 12px;
                        code {
                            margin: 0;
                            padding: 0;
                        }

                        label {
                            margin-left: 0;
                        }
                    }

                    &:nth-child(3) {
                        text-align: left;
                    }
                }

                &.fs-field-plan {
                    // Discard the float of the button group so that they appear on the next line.
                    td:nth-child(2) .button-group {
                        float: none;
                        margin: 12px 0;
                    }
                }
            }
        }
    }
}
