/*
* Admin Backend Styles
* Plugin: Extra Product Data for WooCommerce
* Author: Triopsi
*/
#extra-product-data {
    padding: 10px 10px;
}

table.exprdawc_attribute_table {
    td {
        vertical-align: middle !important;

        &.exprdawc_attribute_require_checkbox label {
            padding-top: 15px;
        }
    }
}

/*
Out Table Styles
*/
table.exprdawc_field_table {
    width: 100%;
    border-collapse: collapse;

    th {
        background-color: #f1f1f1;
        font-weight: bold;
        padding: 10px;
        text-align: left;
    }

    tr:nth-child(even) {
        background-color: #f9f9f9;
    }

    tr.exprdawc_fields_wrapper {
        border-bottom: 1px solid #ddd;

        &:hover {
            background-color: #f1f1f1;
        }

        &:last-child {
            border-bottom: none;
        }
    }

    td {
        padding: 0px;
    }

    tfoot {
        tr {
            background-color: #fafafa; // Light gray background
            border: 1px solid #ccc; // Slightly darker border
        }

        td {
            padding: 10px;
            text-align: center;
            vertical-align: middle;
        }

        td.exprdawc_add_field_col {
            text-align: left;
        }

        td.exprdawc_export_col {
            text-align: right;
        }

        .button {
            padding: 5px;
            line-height: 13px;
        }
    }
}

/*
In Table Styles
*/
table.exprdawc_fields_table {
    width: 100%;
    border-collapse: collapse;

    tr {
        border: 0px;
    }

    tbody {

        td {
            vertical-align: middle;
            padding: 10px;
            text-align: left;
            width: auto;
            white-space: nowrap;

            &.move {
                width: 20px;
                max-width: 20px;
            }

            &.cl-arr {
                width: 35px;
                max-width: 35px;
                .dashicons {
                    font-size: 35px;
                    width: 35px;
                    height: 35px;
                    line-height: 35px;
                }
            }

            &.exprdawc_actions {
                width: 80px;
                max-width: 80px;
                text-align: center;
                vertical-align:middle;
            }

            input[type="text"],
            input[type="number"],
            input[type="email"],
            textarea {
                width: 100%;
                padding: 5px;
                border: 1px solid #ccc;
                border-radius: 4px;
                box-sizing: border-box;
            }

            select {
                width: 100%;
                padding: 5px;
                border: 1px solid #ccc;
                border-radius: 4px;
                box-sizing: border-box;
                text-overflow: ellipsis;
            }

            button.add_rule,
            button.exprdawc_remove_custom_field,
            button.exprdawc_copy_custom_field,
            button.remove_rule {
                padding: 5px;
                line-height: 13px;
            }
        }

        td.move {
            i {
                cursor: move;
            }
        }

        td.cl-arr {
            i {
                cursor: pointer;
            }
        }
    }
}


table.exprdawc_settings_table {
    width: 100%;

    .exprdawc_input_wrapper {
        margin: 1em 0;
    }
    
    label.exprdawc_label {
        float: none;
        padding: 0px;
        margin: 5px 0px;
        text-align: left;
        display: flex;
        width: auto;
        align-items: center;

        .checkbox {
            margin-right: 5px !important;
        }
    }

    td {
        vertical-align: middle;
        padding: 10px;

    }
}

table.exprdawc_options_table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    border: 1px solid #ccc; // Add border to distinguish the table

    th,
    td {
        padding: 10px;
        text-align: left;
        border-bottom: 1px solid #ddd;
    }

    th {
        background-color: #f1f1f1;
    }

    tr {
        &:hover {
            background-color: #f9f9f9;
        }

        &.exprdawc-validation-error {           
                border: 2px solid #f00 !important;
        }


    }

    .button {
        padding: 5px 10px;
        border: none;
        border-radius: 4px;
        background-color: #0073aa;
        color: #fff;
        cursor: pointer;

        &:hover {
            background-color: #005a87;
            color: #fff; // Ensure the text color remains white on hover
        }
    }
}

.exprdawc_attribute {
    h3 .sort {
        width: 17px;
        height: 26px;
        cursor: move;
        float: right;
        font-size: 15px;
        font-weight: 400;
        margin-right: 0.5em;
        text-align: center;
        vertical-align: middle;

        &::before {
            content: "\f333";
            font-family: "Dashicons";
            text-align: center;
            line-height: 28px;
            color: #999;
            display: block;
            width: 17px;
            float: left;
            height: 100%;
        }

        &:hover::before {
            color: #777;
        }
    }

    h3:hover,
    &.ui-sortable-helper {
        .sort {
            visibility: visible;
        }
    }

    &.wc-metabox {
        &.postbox {
            border-top: 0px;
            border-left: 0px;
            border-right: 0px;
        }
    }
}

.exprdawc_panel {

    display: block;

    p.description { 
        margin:0;
    }

    h2 {
        font-size: 1.5em !important;
        padding: 0px 0px 10px 0px !important;
    }

    .wc-metabox {
        background: #fff;
        border-bottom: 1px solid #eee;
        margin: 0 !important;

        &.exprdawc_attribute h3 {
            cursor: pointer;
            padding: 0.5em 0.75em 0.5em 1em !important;

            a.delete,
            a.edit,
            .sort {
                margin-top: 0.25em;
            }
        }
    }
}

#woocommerce-product-data,
#woocommerce-coupon-data,
.woocommerce {
    ul.wc-tabs {
        li {
            &.custom_fields_options a::before {
                font-family: "Dashicons";
                content: "\f163";
            }
        }
    }
}

.exprdawc_conditional_logic_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;

    th,
    td {
        padding: 10px;
        border: 1px solid #ddd;
        text-align: left;
    }

    th {
        background-color: #f9f9f9;
        font-weight: bold;
    }

    .exprdawc_label {
        display: block;
        margin-bottom: 5px;
        font-weight: bold;
    }

    .exprdawc_input {
        width: 100%;
        padding: 5px;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
    }

    .exprdawc_checkbox {
        width: auto;
    }

    .exprdawc_textarea {
        width: 100%;
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 4px;
    }

    .exprdawc_no_entry_message {
        color: #a00;
        font-weight: bold;
    }

    h2 {
        text-align: left;
        text-transform: uppercase;
    }

    .exprdawc_rule_group {
        margin-bottom: 10px;
        padding: 10px;
        border: 1px solid #ddd;
        background-color: #f9f9f9;
        border-radius: 4px;

        .exprdawc_rule {
            display: flex;
            align-items: center;
            margin-bottom: 10px;

            .exprdawc_input {
                margin-right: 10px;
            }

            .button {
                margin-left: 10px;
            }
        }

        .add_rule_group {
            margin-top: 10px;
        }
    }
}

.exprdawc_no_entry_message {
    padding-top: 75px;
    margin: 10px 0 0;
    position: relative;
    text-align: center;
    display: block;
    padding-bottom: 1em;
    background: #fafafa;
    color: #5b5b5b;
    border: 1px solid #c3c4c7;
    border-bottom: none;

    &::before {
        content: "";
        width: 100px;
        height: 100px;
        background-image: url('../img/LogoSW.svg');
        color: #5b5b5b;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 70% 70%;
        position: absolute;
        top: 0px;
        left: 50%;
        -ms-transform: translateX(-50%);
        transform: translateX(-50%);
    }
}

a.exprdawc-export,
a.exprdawc-import {
    text-decoration: underline dotted;
    font-size: small;
    color: #0073aa; // Make the links stand out
    margin: 0 5px; // Add some margin between the links

    &::before {
        font-family: "Dashicons";
        margin-right: 5px;
        position: relative;
    }

    &:hover {
        color: #005a87;
        text-decoration: underline dotted;
    }
}

a.exprdawc-export::before {
    content: "\f346";
}

a.exprdawc-import::before {
    content: "\f342";
}

/**
 * Validation Error Styles
 * Markiert Felder mit Validierungsfehlern
 */
tr.exprdawc-validation-error {
    background-color: #fee !important;
    box-shadow: inset 0 0 0 1px #f00 !important;
    
    .exprdawc_fields_table {
        border: 1px solid #f00;
    }
}

input.exprdawc-invalid-field {
    border-color: #d63638 !important;
    background-color: #ffe8e8 !important;
    box-shadow: inset 0 0 0 1px #d63638 !important;
    
    &:focus {
        border-color: #d63638 !important;
        background-color: #fff !important;
        box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1) !important;
    }
}

.exprdawc-unique-note {
    color: #d63638;
    font-size: 12px;
    margin-top: 4px;
}

/**
 * Scrolle zum ersten Fehler bei Validierung
 * Hilft dem Nutzer das Problem schnell zu finden
 */
.exprdawc-validation-error:first-of-type {
    animation: pulse-error 0.5s ease-in-out 2;
}

@keyframes pulse-error {
    0%, 100% {
        background-color: #fee;
    }
    50% {
        background-color: #ffcccc;
    }
}

.wc-pao-addons-container {

    textarea {
        width: 100%;
    }
}