/* Import Montserrat Font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

/* General Styling */
.jc-chatbot {
    position: fixed;
    bottom: 30px;
    left: 30px;
    /* CRITICAL: Added fallback fonts */
    font-family: 'Montserrat', sans-serif, Arial, Helvetica; 
    z-index: 9999;
    /* CSS Variable fallback definition */
    --primary-color: #593196; 
}

/* Toggle button */
.jc-chat-toggle {
    /* Background is now set directly via JS with !important, but CSS fallback here */
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px !important;
	font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease-in-out;
}

.jc-chat-toggle:hover {
    transform: scale(1.05);
}

/* Chat window */
.jc-chat-window {
    width: 320px;
    max-height: 500px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
    position: absolute;
    bottom: 0;
    left: 0;
    transform: translateY(-50px);
}

/* Header */
.jc-chat-header {
    /* CRITICAL: Added !important */
    background: var(--primary-color, #593196) !important; 
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.jc-chat-title {
    font-size: 16px;
}

#jc-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: 10px;
}

/* Body (Messages area) */
.jc-chat-body {
    padding: 15px;
    height: 280px;
    overflow-y: auto;
    background: #f7f7f7;
}

/* Footer (Input area) */
.jc-chat-footer {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fff;
}

#jc-chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    margin-right: 10px;
    color: #273039;
    /* CRITICAL: Added fallback fonts */
    font-family: 'Montserrat', sans-serif, Arial, Helvetica;
}

#jc-chat-send {
    /* CRITICAL: Added !important */
    background: var(--primary-color, #593196) !important; 
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

/* Messages */
.jc-message {
    margin-bottom: 15px;
    line-height: 1.4;
    font-size: 14px;
}

.jc-message.user {
    text-align: right;
}

.jc-message.bot {
    text-align: left;
}

.jc-message span {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
	line-height: 23px;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.jc-message.user span {
    /* CRITICAL: Added !important */
    background-color: var(--primary-color, #593196) !important; 
    color: #fff;
    border-bottom-right-radius: 5px;
	line-height: 23px;
}

.jc-message.bot span {
    background-color: #e0e0e0;
    color: #000 !important;
    border-bottom-left-radius: 5px;
}

/* Contact buttons in fallback */
.jc-contact-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.jc-contact-btn {
    display: inline-block;
    padding: 8px 15px;
    /* CRITICAL: Added !important */
    background-color: var(--primary-color, #593196) !important; 
    color: #fff !important;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    transition: background-color 0.2s;
    line-height: 1.2;
}

.jc-contact-btn:hover {
    filter: brightness(1.1);
}

.jc-attachment-link {
    color: var(--primary-color, #593196);
    text-decoration: underline;
    font-weight: 700;
}
