/**
 * HomeBoost Referral Styles
 *
 * Unified CSS for all referral partners.
 *
 * @package HomeBoost_Custom
 */

/* Referral Blurb/Notice */
.homeboost-referral-blurb {
    background: #f0f7ff;
    border-left: 4px solid #2196F3;
    padding: 1em 1.5em;
    margin-bottom: 1.5em;
    font-size: 1em;
}

/* Account Field */
.homeboost-referral-field {
    padding: 0 8px;
}

.homeboost-account-field input.error {
    border-color: #e2401c;
}

.homeboost-field-error {
    display: block;
    color: #e2401c;
    font-size: 0.875em;
    margin-top: 0.5em;
}

.homeboost-referral-field.homeboost-account-field label {
    top: 6px !important;
    font-size: 12px !important;
    background: 0 0 !important;
    bottom: auto;
    position: absolute;
    left: 12px;
    z-index: 9;
    color: #969595 !important;
}

/* Address Verification Section */
.homeboost-referral-verification {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 4px;
    width: 100%;
}

.verification-instructions {
    margin-bottom: 1em;
    font-size: 0.95em;
}

.homeboost-verify-btn {
    background: var( --e-global-color-primary ) !important;
    color: #fff;
    padding: 0.75em 1.5em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px !important;
    font-weight: 600;
    transition: background 0.3s ease;
}

.homeboost-verify-btn:hover {
    background: rgb(33, 136, 56) !important;
}

.homeboost-verify-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.verification-error {
    color: rgb(114, 28, 36);
    background: rgb(248, 215, 218);
    border-width: 1px;
    border-style: solid;
    border-color: rgb(245, 198, 203);
    border-image: initial;
    text-align: center;
    font-weight: 500;
    padding: 12px 15px;
    border-radius: 5px;
    margin: 15px 0px;
    display: block;
}

.verification-loading {
    color: #666;
    font-size: 0.9em;
    display: block;
}

.verification-success {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.verification-complete {
    display: none;
}

/* Show verification complete when verified */
body.oppd-verified .verification-complete,
body[class*="-verified"] .verification-complete {
    display: block;
}

body.oppd-verified .verification-pending,
body[class*="-verified"] .verification-pending {
    display: none;
}

/* Express Payment Buttons - Hidden for all referrals until validated/verified */
.bge-referral #wc-stripe-express-checkout-element,
.bge-referral .wc-stripe-express-checkout-element,
.bge-referral #wc-stripe-express-checkout-button-separator,
.bge-referral .stripe-payment-request-button,
.bge-referral .payment-request-button,
.bge-referral .stripe-link-button,
.bge-referral [class*="stripe-link"],
.bge-referral [data-testid*="stripe-link"],
.bge-referral #wc-stripe-payment-request-button,
.bge-referral .stripe-button-el,
.bge-referral #payment-request-button,
.oppd-referral:not(.oppd-verified) #wc-stripe-express-checkout-element,
.oppd-referral:not(.oppd-verified) .wc-stripe-express-checkout-element,
.oppd-referral:not(.oppd-verified) #wc-stripe-express-checkout-button-separator,
.oppd-referral:not(.oppd-verified) .stripe-payment-request-button,
.oppd-referral:not(.oppd-verified) .payment-request-button,
.oppd-referral:not(.oppd-verified) .stripe-link-button,
.oppd-referral:not(.oppd-verified) [class*="stripe-link"],
.oppd-referral:not(.oppd-verified) [data-testid*="stripe-link"],
.oppd-referral:not(.oppd-verified) #wc-stripe-payment-request-button,
.oppd-referral:not(.oppd-verified) .stripe-button-el,
.oppd-referral:not(.oppd-verified) #payment-request-button,
.illgas-referral:not(.illgas-verified) #wc-stripe-express-checkout-element,
.illgas-referral:not(.illgas-verified) .wc-stripe-express-checkout-element,
.illgas-referral:not(.illgas-verified) #wc-stripe-express-checkout-button-separator,
.illgas-referral:not(.illgas-verified) .stripe-payment-request-button,
.illgas-referral:not(.illgas-verified) .payment-request-button,
.illgas-referral:not(.illgas-verified) .stripe-link-button,
.illgas-referral:not(.illgas-verified) [class*="stripe-link"],
.illgas-referral:not(.illgas-verified) [data-testid*="stripe-link"],
.illgas-referral:not(.illgas-verified) #wc-stripe-payment-request-button,
.illgas-referral:not(.illgas-verified) .stripe-button-el,
.illgas-referral:not(.illgas-verified) #payment-request-button {
    display: none !important;
}

/* Show express buttons when OPPD is verified */
.oppd-referral.oppd-verified #wc-stripe-express-checkout-element,
.oppd-referral.oppd-verified .wc-stripe-express-checkout-element,
.oppd-referral.oppd-verified #wc-stripe-express-checkout-button-separator,
.oppd-referral.oppd-verified .stripe-payment-request-button,
.oppd-referral.oppd-verified .payment-request-button,
.oppd-referral.oppd-verified .stripe-link-button,
.oppd-referral.oppd-verified [class*="stripe-link"],
.oppd-referral.oppd-verified [data-testid*="stripe-link"],
.oppd-referral.oppd-verified #wc-stripe-payment-request-button,
.oppd-referral.oppd-verified .stripe-button-el,
.oppd-referral.oppd-verified #payment-request-button {
    display: block !important;
}

/* Show express buttons when illgas is verified */
.illgas-referral.illgas-verified #wc-stripe-express-checkout-element,
.illgas-referral.illgas-verified .wc-stripe-express-checkout-element,
.illgas-referral.illgas-verified #wc-stripe-express-checkout-button-separator,
.illgas-referral.illgas-verified .stripe-payment-request-button,
.illgas-referral.illgas-verified .payment-request-button,
.illgas-referral.illgas-verified .stripe-link-button,
.illgas-referral.illgas-verified [class*="stripe-link"],
.illgas-referral.illgas-verified [data-testid*="stripe-link"],
.illgas-referral.illgas-verified #wc-stripe-payment-request-button,
.illgas-referral.illgas-verified .stripe-button-el,
.illgas-referral.illgas-verified #payment-request-button {
    display: block !important;
}

.homeboost-checkout-referral-message ul {
    padding-left: 10px !important;
}

.homeboost-checkout-referral-message li {
    list-style: disc !important;
    text-align: left;
}

/* Place Order Button States */
#place_order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Product Section - Referral Pricing Display */
.homeboost-product-section .referral-price {
    color: #46b450;
    font-weight: bold;
    font-size: 1.2em;
}

.homeboost-product-section .original-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 0.5em;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .homeboost-referral-blurb {
        padding: 1em;
        font-size: 0.95em;
    }

    .homeboost-referral-verification {
        padding: 1em;
    }

    .homeboost-verify-btn {
        width: 100%;
        display: block;
    }
}

/* Loading Spinner */
.verification-loading .spinner {
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTAiIGN5PSIxMCIgcj0iOCIgc3Ryb2tlPSIjY2NjIiBzdHJva2Utd2lkdGg9IjIiIGZpbGw9Im5vbmUiIHN0cm9rZS1kYXNoYXJyYXk9IjE1IDUiPjxhbmltYXRlVHJhbnNmb3JtIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIgdHlwZT0icm90YXRlIiBmcm9tPSIwIDEwIDEwIiB0bz0iMzYwIDEwIDEwIiBkdXI9IjFzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIvPjwvY2lyY2xlPjwvc3ZnPg==') no-repeat center;
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.homeboost-checkout-referral-message {
    background: #d4edda;
    border: 2px solid #28a745;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.homeboost-referral-message-image {
    margin-bottom: 15px;
}

.homeboost-referral-message-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}