/**
 * SupportSaathi Chatbot Styles v2.2.0 (Final Version)
 */
:root {
    --ss-primary-color: #0073aa;
    --ss-bg-color: #ffffff;
    --ss-user-msg-bg: #f0f0f0;
    --ss-bot-msg-bg: #e1f3ff;
    --ss-header-bg: #005a87;
    --ss-text-color: #333333;
    --ss-border-color: #dddddd;
}

#ss-chat-toggle {
    position: fixed;
    bottom: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--ss-primary-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    transition: transform 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

#ss-chat-toggle:hover {
    transform: scale(1.1);
}

.ss-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    background-color: white !important;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

#supportsaathi-chatbot {
    position: fixed;
    bottom: 90px;
    width: 360px;
    max-height: 80vh;
    height: 550px;
    background: var(--ss-bg-color);
    border: 1px solid var(--ss-border-color);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#supportsaathi-chatbot.ss-active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.ss-header {
    background: var(--ss-header-bg);
    color: white;
    padding: 12px 15px;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ss-header-logo {
    height: 30px;
    width: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.ss-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    flex-grow: 1;
}

.ss-close-btn {
    background: transparent !important;
    border: none !important;
    padding: 5px;
    color: white;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.ss-close-btn:hover {
    opacity: 1;
}

.ss-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ss-message {
    max-width: 85%;
    word-wrap: break-word;
}

.ss-message p {
    margin: 0;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
}

.ss-message-user {
    align-self: flex-end;
}

.ss-message-user p {
    background: var(--ss-user-msg-bg);
    color: var(--ss-text-color);
    border-bottom-right-radius: 4px;
}

.ss-message-bot {
    align-self: flex-start;
}

.ss-message-bot p {
    background: var(--ss-bot-msg-bg);
    color: var(--ss-text-color);
    border-bottom-left-radius: 4px;
}

.ss-input-wrapper {
    flex-shrink: 0;
    border-top: 1px solid var(--ss-border-color);
    background: #fafafa;
}

.ss-disclaimer {
    padding: 8px 15px;
    font-size: 11px;
    text-align: center;
    color: #666;
}

.ss-input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: var(--ss-bg-color);
    border-top: 1px solid var(--ss-border-color);
    border-bottom: 1px solid var(--ss-border-color);
}

.ss-footer {
    padding: 8px 15px;
    font-size: 12px;
    text-align: center;
    color: #666;
}

.ss-footer a {
    color: var(--ss-primary-color);
    text-decoration: none;
}

.ss-footer a:hover {
    text-decoration: underline;
}

#ss-input {
    flex-grow: 1;
    border: 1px solid var(--ss-border-color);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    background: #f5f5f5;
    outline: none;
}

#ss-send-btn {
    background: var(--ss-primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.2s;
    flex-shrink: 0;
    padding: 0; /* Ensures consistent centering */
}

#ss-send-btn:hover {
    background: var(--ss-header-bg);
}

#ss-send-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

#ss-send-btn .ss-icon,
.ss-close-btn .ss-icon {
    width: 20px !important;
    height: 20px !important;
}

@media (max-width: 480px) {
    #supportsaathi-chatbot.ss-active {
        width: 100%;
        height: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        border-radius: 0;
        border: none;
    }
}
/* Styles for the unread message indicator */
#ss-chat-toggle.ss-new-message::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background-color: #ff3b30; /* A nice red color */
    border-radius: 50%;
    border: 2px solid white;
    transform: scale(1);
    transition: transform 0.2s ease;
}

#ss-chat-toggle::after {
    /* This is the default hidden state */
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    background-color: #ff3b30;
    border-radius: 50%;
    border: 2px solid white;
    transform: scale(0);
    transition: transform 0.2s ease;
}