.somnath-chat-wrapper {
    --somnath-accent: #4158D0;
    --somnath-gradient: linear-gradient(135deg, #4158D0 0%, #08D9D6 100%);
    --somnath-bg-white: #ffffff;
    --somnath-text-main: #2d3748;
    --somnath-text-muted: #718096;
    --somnath-border: #edf2f7;

    position: fixed;
    z-index: 9999999 !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;

    bottom: 35px;
    height: 60px;
    display: flex !important;
    align-items: center !important;

    right: 35px;
    transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.somnath-chat-wrapper.somnath-chat-scrolled {
    right: 110px;
}

.somnath-chat-trigger-btn {
    position: relative;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 50% !important;
    color: var(--somnath-bg-white);
    border: none;
    cursor: pointer;
    background: var(--somnath-gradient);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;

    box-shadow: 0 8px 24px rgba(65, 88, 208, 0.35);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease;
}

.somnath-chat-trigger-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 30px rgba(8, 217, 214, 0.45);
}

.somnath-chat-trigger-btn:active {
    transform: scale(0.95);
}

.somnath-chat-trigger-btn svg {
    position: absolute;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    display: block !important;
    margin: 0 !important;
    color: #ffffff;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease;
}

.somnath-chat-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.somnath-chat-btn-ripples {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--somnath-gradient) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    animation: somnathChatPulse 2.5s infinite ease-out;
}

@keyframes somnathChatPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

/* CHAT WINDOW */

.somnath-chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--somnath-bg-white);
    border-radius: 18px;
    box-shadow:
        0 12px 40px rgba(65, 88, 208, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.05);

    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(65, 88, 208, 0.08);

    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.92);
    transform-origin: bottom right;

    transition:
        opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        visibility 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.somnath-chat-wrapper.somnath-chat-open .somnath-chat-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.somnath-chat-wrapper.somnath-chat-open .somnath-chat-icon-open {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.somnath-chat-wrapper.somnath-chat-open .somnath-chat-icon-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* HEADER */

.somnath-chat-header {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid rgba(65, 88, 208, 0.08);

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.somnath-chat-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.somnath-chat-avatar {
    width: 38px;
    height: 38px;
    background: rgba(65, 88, 208, 0.12);
    color: #4158D0;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;
}

.somnath-chat-avatar svg {
    width: 20px;
    height: 20px;
}

.somnath-chat-brand {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--somnath-text-main);
}

.somnath-chat-status {
    font-size: 12px;
    color: var(--somnath-text-muted);

    display: flex;
    align-items: center;
    gap: 6px;
}

.somnath-chat-indicator {
    width: 7px;
    height: 7px;
    background: #08D9D6;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(8, 217, 214, 0.2);
}

.somnath-chat-minimize-btn {
    background: transparent;
    border: none;
    color: var(--somnath-text-muted);
    cursor: pointer;

    width: 28px;
    height: 28px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: background 0.2s ease,
        color 0.2s ease;
}

.somnath-chat-minimize-btn:hover {
    background: rgba(65, 88, 208, 0.08);
    color: #4158D0;
}

/* BODY */

.somnath-chat-body {
    flex: 1;
    padding: 20px;
    background: #f8fbff;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 16px;

    scroll-behavior: smooth;
}

.somnath-chat-log-alert {
    text-align: center;
    margin: 8px 0;
}

.somnath-chat-log-alert span {
    background: rgba(65, 88, 208, 0.08);
    color: #4158D0;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

/* MESSAGE */

.somnath-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.somnath-chat-msg-received {
    align-self: flex-start;
}

.somnath-chat-msg-received .somnath-chat-bubble {
    background: #ffffff;
    color: var(--somnath-text-main);
    border-top-left-radius: 4px;
    border: 1px solid rgba(65, 88, 208, 0.08);
}

.somnath-chat-msg-sent {
    align-self: flex-end;
}

.somnath-chat-msg-sent .somnath-chat-bubble {
    background: var(--somnath-gradient);
    color: #ffffff;
    border-top-right-radius: 4px;
}

.somnath-chat-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    word-wrap: break-word;
}

.somnath-chat-timestamp {
    font-size: 10px;
    color: var(--somnath-text-muted);
    margin-top: 5px;
    padding: 0 4px;
}

.somnath-chat-msg-sent .somnath-chat-timestamp {
    text-align: right;
}

/* FOOTER */

.somnath-chat-footer {
    padding: 14px 16px;
    background: #ffffff;
    border-top: 1px solid rgba(65, 88, 208, 0.08);

    display: flex;
    align-items: center;
    gap: 10px;
}

.somnath-chat-input {
    flex: 1;
    min-width: 0;

    border: 1px solid rgba(65, 88, 208, 0.12);
    background: #f8fbff;

    padding: 10px 14px;
    border-radius: 20px;

    font-size: 14px;
    color: var(--somnath-text-main);

    outline: none;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.somnath-chat-input:focus {
    border-color: #4158D0;
    background: #ffffff;
}

.somnath-chat-send-btn {
    background: transparent;
    color: #4158D0;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        background 0.2s ease,
        transform 0.2s ease;

    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;

    flex-shrink: 0 !important;
    border-radius: 50% !important;
}

.somnath-chat-send-btn:hover {
    background: rgba(65, 88, 208, 0.08);
    transform: scale(1.05);
}

.somnath-chat-send-btn svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
}

/* MOBILE */

@media (max-width: 480px) {

    .somnath-chat-wrapper {
        right: 20px !important;
        bottom: 26px !important;
        height: 48px !important;
    }

    .somnath-chat-wrapper.somnath-chat-scrolled {
        right: 20px !important;
        bottom: 90px !important;
    }

    .somnath-chat-window {
        width: 290px;
        height: 400px;
        bottom: 60px;
        right: 0;
    }

    .somnath-chat-bubble {
        padding: 10px 14px;
        font-size: 13px;
    }
}

