/** @format */

/* --- 1. Floating CHAT Button --- */

/* Utility to force hide the button when Chat is Open */
a#tcp_trigger_modal.tcp-hidden {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

a#tcp_trigger_modal {
    font-size: 14px;
    line-height: 22px;
    text-align: center !important;
    text-decoration: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    background: #085dd4;
    color: #fff !important;
    position: fixed;
    right: 15px;
    bottom: 15px;
    
    /* High enough to sit over content, low enough to sit UNDER Salesforce (10000) */
    z-index: 999 !important; 
    
    box-shadow: 0 0 7px 1px rgba(0,0,0,0.5);
    width: 64px;
    height: 64px;
    padding: 10px;
    border-radius: 36px 36px 36px 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#tcp_trigger_modal:hover {
    transform: scale(1.1);
    color: #fff;
}

#tcp_trigger_modal span.chat-icon.d-block {
    font-size: 17px;
    text-align: center;
    line-height: 1;
}

#tcp_trigger_modal img.chat-icon-image {
    display: inline-block;
    width: 36px;
    height: 36px;
    margin-bottom: 2px;
}

/* --- 2. Modal Window Structure --- */
#ModalWindowWrapper .modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000; /* Must be higher than everything else */
    display: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.15s linear;
}

#ModalWindowWrapper .modal.show {
    display: block !important;
    opacity: 1;
}

#ModalWindowWrapper .modal-dialog {
    position: relative;
    width: auto;
    max-width: 500px;
    margin: 1.75rem auto;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
}

#ModalWindowWrapper .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(45, 41, 38, 0.2);
    border-radius: 10px;
    outline: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* --- 3. Modal Header & Close Button --- */
#ModalWindowWrapper .modal-header {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 1rem;
    border-bottom: none;
}

#ModalWindowWrapper .close {
    padding: 0;
    background-color: transparent;
    border: 0;
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #2d2926;
    opacity: 0.5;
    cursor: pointer;
}

#ModalWindowWrapper .close:hover {
    opacity: 1;
}

/* --- 4. Modal Body & Text --- */
#ModalWindowWrapper .modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 0 1rem 2rem 1rem;
}

#ModalWindowWrapper h2.modal-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 1.5rem;
}

#ModalWindowIcon {
    width: 100px;
    height: auto;
    display: inline-block;
    margin-bottom: 10px;
}

/* --- 5. Action Buttons (Sales vs Support) --- */
.cta-button {
    width: 100%;
    display: block;
    text-align: center;
    text-transform: uppercase !important;
    text-decoration: none !important;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.cta-button-blue-outline {
    border-radius: 8px;
    padding: 15px 16px !important;
    background-color: transparent;
    border: 1px solid #085dd4;
    color: #085dd4 !important;
    margin-bottom: 15px;
}

.cta-button-blue-outline:hover {
    background-color: #f0f8ff;
    text-decoration: none;
}

.cta-button-green {
    border: 1px solid #085dd4;
    background-color: #085dd4;
    border-radius: 8px;
    padding: 15px 16px !important;
    color: #fff !important;
    margin-top: 10px;
}

.cta-button-green:hover {
    background-color: #064bb0;
    border-color: #064bb0;
    color: #fff !important;
    text-decoration: none;
}

/* --- 6. Loading Spinner (Required for JS Logic) --- */
.tcp-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #085dd4; /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto 10px auto;
}

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

.tcp-loading-text {
    text-align: center;
    font-weight: 600;
    color: #02182e;
    margin-bottom: 20px;
}

/* Helper to hide buttons while loading */
.tcp-hidden {
    display: none !important;
}