/**
 * Copyright © Asv_ValidateB2B All rights reserved.
 * See COPYING.txt for license details.
 */

/* Ensure B2B button has same red styling as CRM Lead button */

#grant-b2b-access-btn.validate-b2b:not(:disabled) {
    /* Ensure B2B button is clickable when enabled */
    pointer-events: auto;
    cursor: pointer;
}

#grant-b2b-access-btn.loading {
    position: relative;
}

#grant-b2b-access-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.lead-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Modal popup styling - similar to session extend popup */
#validateb2b-message-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

.validateb2b-modal-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: calc(100% - 40px);
}

.validateb2b-modal-inner #validateb2b-message-modal-message {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1;
    word-wrap: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: left;
}

.validateb2b-modal-inner .button-box {
    margin-top: 20px;
}

.validateb2b-modal-inner #validateb2b-message-modal-button {
    padding: 10px 30px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background: #DE0021;
    color: #ffffff;
    font-weight: 600;
    transition: background 0.3s ease;
}

.validateb2b-modal-inner #validateb2b-message-modal-button:hover {
    background: #c1021f;
}

/* Success modal styling */
.validateb2b-modal-success #validateb2b-message-modal-message {
    color: #53B068;
}

.validateb2b-modal-success #validateb2b-message-modal-button {
    background: #53B068;
}

.validateb2b-modal-success #validateb2b-message-modal-button:hover {
    background: #218838;
}

/* Error modal styling */

.validateb2b-modal-error #validateb2b-message-modal-message {
    color: #DE0021;
}

.validateb2b-modal-error #validateb2b-message-modal-button {
    background: #DE0021;
}

.validateb2b-modal-error #validateb2b-message-modal-button:hover {
    background: #c82333;
}

/* Warning modal styling */

.validateb2b-modal-warning #validateb2b-message-modal-message {
    color: #ffc107;
}

.validateb2b-modal-warning #validateb2b-message-modal-button {
    background: #ffc107;
    color: #333;
}

.validateb2b-modal-warning #validateb2b-message-modal-button:hover {
    background: #e0a800;
}

/* Responsive design */
@media (max-width: 768px) {
    .validateb2b-modal-inner {
        min-width: 90%;
        max-width: 90%;
        padding: 20px;
    }
    
    .validateb2b-modal-inner #validateb2b-message-modal-message {
        font-size: 12px;
        line-height: 1.2;
    }
}

