/**
 * Hide Cart Functions Admin Styles
 */

/* ============================================
   PANEL BOX STYLING - 8px border radius
   ============================================ */

.hwcf-section.postbox {
    border-radius: 8px;
    overflow: hidden;
}

.hwcf-section.postbox .postbox-header {
    border-radius: 8px 8px 0 0;
}

.hwcf-section.postbox .postbox-header .hndle span {
    display: inline;
    margin-left: 15px;
    font-weight: normal;
    font-size: 13px;
}

/* ============================================
   ROW INDENTATION - 15px indent for rows
   ============================================ */

.hwcf-section.postbox .inside {
    padding: 0 15px 0 15px;
}

.hwcf-admin-ui .hwcf-table.form-table {
    margin-left: 15px;
}

/* ============================================
   ROW SPACING - Reduced by ~50%
   ============================================ */

.hwcf-admin-ui .hwcf-table.form-table th,
.hwcf-admin-ui .hwcf-table.form-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.hwcf-admin-ui .hwcf-table.form-table tr {
    border-bottom: none;
}

/* ============================================
   CONSISTENT LABEL COLOR - #3c434a
   ============================================ */

.hwcf-admin-ui .hwcf-table.form-table th label,
.hwcf-admin-ui .hwcf-table.form-table .description,
.hwcf-admin-ui .hwcf-table.form-table .checkinput-description {
    color: #3c434a;
}

/* ============================================
   UNIFIED INPUT FIELD STYLING
   All fields: 36px height, 250px width FIXED
   ============================================ */

.hwcf-admin-ui .hwcf-table.form-table input[type="text"],
.hwcf-admin-ui .hwcf-table.form-table input[type="number"],
.hwcf-admin-ui .hwcf-table.form-table select {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    height: 36px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
    background-color: #fff;
    color: #3c434a;
    padding: 0 10px;
    box-sizing: border-box;
    line-height: 34px;
    font-size: 14px;
    vertical-align: middle;
}

.hwcf-admin-ui .hwcf-table.form-table input[type="text"]:focus,
.hwcf-admin-ui .hwcf-table.form-table input[type="number"]:focus,
.hwcf-admin-ui .hwcf-table.form-table select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

/* Search Products field - 450px */
.hwcf-admin-ui .hwcf-table.form-table #custom-product-search-field {
    width: 450px;
    min-width: 450px;
    max-width: 450px;
}

/* Input + tooltip wrapper to keep them on same line */
.hwcf-admin-ui .hwcf-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hwcf-admin-ui .hwcf-input-wrap input[type="text"],
.hwcf-admin-ui .hwcf-input-wrap select {
    flex: 0 0 auto;
}

.hwcf-admin-ui .hwcf-input-wrap .hwcf-tooltip {
    flex: 0 0 auto;
    margin-left: 0;
}

/* ============================================
   TOOLTIP STYLING
   ============================================ */

.hwcf-tooltip {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}

.hwcf-tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: rgba(0, 0, 0, 0.75);
    color: #fff;
    text-align: left;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 4px;
    padding: 8px 10px;
    position: absolute;
    z-index: 9999;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    white-space: normal;
}

.hwcf-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent rgba(0, 0, 0, 0.75) transparent transparent;
}

.hwcf-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.hwcf-tooltip span.dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    vertical-align: top;
    line-height: 1;
    cursor: help;
}

.hwcf-tooltip .dashicons-editor-help:before {
    color: #72777c;
}

.hwcf-tooltip:hover .dashicons-editor-help:before {
    color: #2271b1;
}

/* ============================================
   CHECKBOX STYLING
   ============================================ */

.hwcf-admin-ui .checkinput-description {
    display: inline;
    margin: 0;
    padding: 0;
    color: #3c434a;
    font-size: 14px;
    line-height: 1.4;
}

.hwcf-admin-ui .checkinput-box {
    margin-top: -2px;
}

.hwcf-admin-ui .usercheckbox {
    margin-top: -2px;
    margin-right: 5px;
}

/* ============================================
   SUBMIT AREA - Inside panel
   ============================================ */

.hwcf-right-sidebar {
    display: none;
}

.hwcf-submit-inside-panel {
    padding: 15px 20px;
    background: #f8f8f8;
    border-top: 1px solid #c3c4c7;
    margin: 15px -15px 0 -15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.hwcf-submit-inside-panel .submit-buttons {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hwcf-submit-inside-panel .button-primary {
    margin: 0;
}

.hwcf-donation-text {
    color: #3c434a;
    font-size: 13px;
    margin: 0;
}

.hwcf-donation-text .button {
    margin-left: 5px;
}

/* ============================================
   WP EDITOR STYLING - Full width preserved
   ============================================ */

.hwcf-admin-ui .wp-editor-td {
    float: left;
    max-width: 560px;
}

/* ============================================
   MULTISELECT SELECTED ITEMS
   ============================================ */

.hwcf-admin-ui .multiselect__container {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
}

.hwcf-admin-ui .multiselect__selected {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    text-decoration: none;
    text-shadow: none;
    padding: 5px;
}

.hwcf-admin-ui .multiselect__selected .multiselect__remove-btn {
    border-left: 1px solid #333;
    padding-left: 2px;
}

/* ============================================
   SELECT2 WOOCOMMERCE OVERRIDES - 250px fixed
   ============================================ */

.hwcf-admin-ui .hwcf-table.form-table .select2-container,
.hwcf-admin-ui .hwcf-table.form-table td .select2-container {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
}

/* Search Products Select2 - 450px */
.hwcf-admin-ui .hwcf-table.form-table td #custom-product-search-field + .select2-container {
    width: 450px;
    min-width: 450px;
    max-width: 450px;
}

.hwcf-admin-ui .hwcf-table.form-table .select2-container .select2-search--inline .select2-search__field,
.hwcf-admin-ui .hwcf-table.form-table td .select2-container .select2-search--inline .select2-search__field {
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #3c434a;
    height: 34px;
    line-height: 24px;
    min-height: 24px;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    outline: 0;
    padding: 0 0 4px;
}

.hwcf-admin-ui .hwcf-table.form-table .select2-container .select2-search--inline .select2-search__field::placeholder,
.hwcf-admin-ui .hwcf-table.form-table td .select2-container .select2-search--inline .select2-search__field::placeholder {
    color: #3c434a;
    opacity: 1;
}

.hwcf-admin-ui .hwcf-table.form-table .select2-container .select2-selection--multiple,
.hwcf-admin-ui .hwcf-table.form-table td .select2-container .select2-selection--multiple {
    height: 36px;
    min-height: 36px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07);
    background-color: #fff;
}

.hwcf-admin-ui .hwcf-table.form-table .select2-container .select2-selection--multiple .select2-selection__rendered,
.hwcf-admin-ui .hwcf-table.form-table td .select2-container .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    align-items: center;
    line-height: 34px;
    padding: 0;
    margin: 0;
}

.hwcf-admin-ui .hwcf-table.form-table .select2-container .select2-selection--multiple .select2-search--inline,
.hwcf-admin-ui .hwcf-table.form-table td .select2-container .select2-selection--multiple .select2-search--inline {
    float: none;
    display: flex;
    align-items: center;
    height: 34px;
}

.select2-results .select2-results__group,
.select2-results .select2-results__option {
    margin: 0;
    padding: 8px;
    font-size: 14px;
}

/* ============================================
   TABLE PAGE HEADER - Custom flexbox layout
   ============================================ */

.hwcf-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
    margin-top: 35px;
}

.hwcf-table-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hwcf-table-header-left h1 {
    margin: 0;
    padding: 0;
    font-size: 23px;
    font-weight: 400;
    line-height: 1.3;
}

.hwcf-table-header-right {
    margin: 0;
}

.hwcf-table-header-right .search-box {
    margin: 0;
}

/* ============================================
   STORE-WIDE SETTINGS SECTION (below table)
   ============================================ */

.hwcf-store-wide-section {
    margin-top: 12px;
}

.hwcf-store-wide-section h2#poststuff {
    padding: 10px 15px;
    margin: 0;
    border-bottom: 1px solid #c3c4c7;
    font-size: 14px;
    font-weight: 600;
}

.hwcf-store-wide-section .inside {
    padding: 0 15px 0 15px;
}

.hwcf-store-wide-section .hwcf-table {
    margin-left: 15px;
}

.hwcf-store-wide-section .hwcf-table th,
.hwcf-store-wide-section .hwcf-table td {
    padding-top: 8px;
    padding-bottom: 8px;
}

.hwcf-store-wide-section .hwcf-table th label {
    color: #3c434a;
}

/* Table page submit panel - separate from settings panel */
.hwcf-table-submit-panel {
    padding: 15px 20px;
    background: #f8f8f8;
    border-top: 1px solid #c3c4c7;
    margin: 15px 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-radius: 0 0 8px 8px;
}

.hwcf-table-submit-panel .submit-buttons {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================
   ADD NEW BUTTON STYLING
   ============================================ */

.hwcf-table-page .hwcf-add-new-btn {
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    text-shadow: none;
    top: -3px;
    margin-left: 4px;
    border: 1px solid #2271b1;
    border-radius: 3px;
    background: #f6f7f7;
    font-size: 13px;
    font-weight: 400;
    line-height: 2.15384615;
    color: #2271b1;
    padding: 0 10px;
    min-height: 30px;
    -webkit-appearance: none;
    margin-top: 10px;
}

/* ============================================
   TABLE NAVIGATION STYLING
   ============================================ */

.hwcf-table-page .tablenav {
    clear: both;
    height: 20px;
    margin: 6px 0 4px;
    vertical-align: middle;
}

/* ============================================
   DELETE DATA ON UNINSTALL STYLING
   ============================================ */

.hwcf-warning-text {
    color: #d63638;
    font-weight: 600;
}

/* ============================================
   MISC STYLING
   ============================================ */

.delete-hwcf-item {
    color: red;
}

.hwcf-spinner.is-active {
    float: left;
    margin-top: 0px;
}

.help-icon {
    width: 18px;
    vertical-align: middle;
}

/* ============================================
   RESPONSIVE - Keep fields at 250px
   ============================================ */

@media only screen and (max-width: 800px) {
    .hwcf-admin-ui .hwcf-table.form-table {
        margin-left: 0;
    }
    
    .hwcf-admin-ui .hwcf-table.form-table td {
        padding-left: 10px;
    }
    
    .hwcf-submit-inside-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .hwcf-submit-inside-panel .submit-buttons {
        flex-wrap: wrap;
    }
    
    .hwcf-donation-text {
        display: none;
    }
    
    .hwcf-tooltip .tooltiptext {
        left: 28px;
        top: 50%;
        transform: translateY(-50%);
        width: 180px;
    }
    
    .hwcf-tooltip .tooltiptext::after {
        top: 50%;
        right: 100%;
        left: auto;
        margin-top: -5px;
        border-color: transparent rgba(0, 0, 0, 0.75) transparent transparent;
    }
}

@media screen and (max-width: 782px) {
    .hwcf-submit-inside-panel .submit-buttons a.button.button-secondary {
        padding: 0px 10px;
        font-size: 13px;
        min-height: 30px;
        margin-bottom: 0px;
        max-height: 30px;
        line-height: 28px;
    }
    
    .hwcf-admin-ui .hwcf-table.form-table #custom-product-search-field,
    .hwcf-admin-ui .hwcf-table.form-table td #custom-product-search-field + .select2-container {
        width: 350px;
        min-width: 350px;
        max-width: 350px;
    }
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.hwcf-toast {
    position: fixed;
    top: 50px;
    right: 50px;
    min-width: 200px;
    max-width: 765px;
    background: #caf2d7;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border: 1px solid #0a7934;
    overflow: hidden;
}

.hwcf-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.hwcf-toast-icon {
    width: 24px;
    height: 24px;
    background: #0a7934;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.hwcf-toast-icon svg {
    width: 14px;
    height: 14px;
}

.hwcf-toast-content {
    flex: 1;
}

.hwcf-toast-title {
    font-weight: 600;
    font-size: 15px;
    color: #0a7934;
    margin-bottom: 2px;
}

.hwcf-toast-message {
    font-size: 14px;
    color: #374151;
}

.hwcf-toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #0a7934;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.hwcf-toast-close:hover {
    color: #065f27;
}

.hwcf-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #0a7934;
    width: 0%;
    transform-origin: left;
    animation: none;
}

.hwcf-toast.show .hwcf-toast-progress {
    animation: hwcfToastProgress 1.5s linear forwards;
}

/* Icon visibility - show success by default, error when .toast-error class */
.hwcf-toast .hwcf-toast-icon .icon-error {
    display: none;
}

.hwcf-toast .hwcf-toast-icon .icon-success {
    display: block;
}

.hwcf-toast.toast-error .hwcf-toast-icon .icon-success {
    display: none;
}

.hwcf-toast.toast-error .hwcf-toast-icon .icon-error {
    display: block;
}

/* Error toast - same structure as base toast, just red colors */
.hwcf-toast.toast-error {
    background: #f8d7da;
    border: 1px solid #d63638;
}

.hwcf-toast.toast-error .hwcf-toast-icon {
    background: #d63638;
}

.hwcf-toast.toast-error .hwcf-toast-title {
    color: #d63638;
}

.hwcf-toast.toast-error .hwcf-toast-close {
    color: #d63638;
}

.hwcf-toast.toast-error .hwcf-toast-close:hover {
    color: #a02a2a;
}

.hwcf-toast.toast-error .hwcf-toast-progress {
    background: #d63638;
}

@keyframes hwcfToastProgress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* ============================================
   LOGIN BUTTON STYLING (Frontend)
   ============================================ */

.hwcf-login-button-wrap {
    margin-top: 15px;
}

.hwcf-login-button {
    display: inline-block;
}

/* ============================================
   FORM SECTION DIVIDERS
   ============================================ */

.hwcf-admin-ui .hwcf-table.form-table tr.hwcf-section-divider {
    height: auto;
}

.hwcf-admin-ui .hwcf-table.form-table tr.hwcf-section-divider td {
    padding: 0;
    border-bottom: none;
    height: 6px;
    position: relative;
}

.hwcf-admin-ui .hwcf-table.form-table tr.hwcf-section-divider td::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 0;
    right: 30px;
    border-bottom: 1px solid #c3c4c7;
}

.hwcf-admin-ui .hwcf-table.form-table tr.hwcf-section-divider th {
    padding: 0;
    height: 6px;
}

/* ============================================
   SETTINGS HEADER WITH VERSION
   ============================================ */

.hwcf-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 3px;
    margin-top: 30px;
}

.hwcf-settings-header h1 {
    margin: 0;
    margin-left: 12px;
}

.hwcf-version {
    color: #646970;
    font-size: 13px;
    margin-right: 13px;
}

/* ============================================
   HIDE CUSTOM ELEMENT FIELD WIDTH
   ============================================ */

#hwcf_custom_element {
    width: 450px;
    min-width: 450px;
    max-width: 450px;
}
