/**
 * BALA Free Trial Gateway - Checkout Styles
 * Scoped to avoid conflicts and duplicate elements
 */

/* Main trial payment method container - add breathing room and scope to li only */
li.payment_method_bft_trial {
    padding: 4px 10px 0px 10px !important;
    position: relative;
    border: 2px solid #4caf50 !important;
    border-radius: 8px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    margin: 10px 0;
}

/* Remove the ::before pseudo-element to avoid duplicate badges */
/* li.payment_method_bft_trial::before - REMOVED */

/* Trial badge - only from JavaScript, not CSS pseudo-elements */
li.payment_method_bft_trial > .bft-trial-badge {
    position: absolute;
    top: -8px;
    right: 15px;
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    text-transform: uppercase;
    z-index: 10;
}

/* Remove duplicate badges from nested elements */
li.payment_method_bft_trial .payment_box .bft-trial-badge {
    display: none !important;
}

.payment_method_bft_trial label {
    font-weight: 600;
    color: #2e7d32;
    font-size: 16px;
}

.payment_method_bft_trial input[type="radio"] {
    border: 2px solid #4caf50;
}

.payment_method_bft_trial input[type="radio"]:checked {
    background: #4caf50;
}

.bft-trial-description {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.bft-trial-description p {
    margin: 0 0 10px 0;
    color: #2e7d32;
    font-weight: 500;
}

.bft-trial-description p:last-child {
    margin-bottom: 0;
}

.bft-trial-instructions {
    background: #f0f8ff;
    border: 1px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.bft-trial-instructions h3 {
    color: #1976d2;
    margin: 0 0 15px 0;
}

.bft-trial-instructions ul {
    margin: 15px 0;
    padding-left: 20px;
}

.bft-trial-instructions li {
    margin: 5px 0;
    color: #333;
}

.bft-trial-email-instructions {
    background: #f0f8ff;
    border: 1px solid #2196f3;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.bft-trial-email-instructions h3 {
    color: #1976d2;
    margin: 0 0 15px 0;
}

/* Disabled gateway styling for non-trial gateways when trial is active */
.bft-disabled-gateway {
    opacity: 0.5;
    position: relative;
    pointer-events: none;
}

.bft-disabled-gateway::after {
    content: "Unavailable during free trial";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 5;
    pointer-events: none;
}

.bft-disabled-gateway input[type="radio"] {
    opacity: 0.3;
    cursor: not-allowed;
}

.bft-disabled-gateway label {
    color: #999 !important;
    cursor: not-allowed !important;
}

/* Price modifications for free trial */
.bft-original-price {
    text-decoration: line-through !important;
    opacity: 0.6;
    position: relative;
}

.bft-free-notice {
    color: #4caf50 !important;
    font-weight: bold !important;
    font-size: 18px !important;
    margin-left: 10px !important;
    text-decoration: none !important;
    background: #e8f5e8;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Checkout form enhancements */
.woocommerce-checkout .payment_method_bft_trial {
    animation: bft-highlight 2s ease-in-out;
}

@keyframes bft-highlight {
    0% { box-shadow: 0 0 0 rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.6); }
    100% { box-shadow: 0 0 0 rgba(76, 175, 80, 0.4); }
}