/* ============================================================
   Adhiseal Chat Widget — Frontend Styles
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

#adhiseal-chatbot-widget {
    --adhiseal-color: #25D366;
    --adhiseal-dark: #1a1a2e;
    --adhiseal-light: #f0f0f0;
    font-family: 'Inter', -apple-system, sans-serif;
    position: fixed;
    z-index: 999999;
    bottom: 24px;
}

#adhiseal-chatbot-widget.adhiseal-position-bottom-right {
    right: 24px;
}

#adhiseal-chatbot-widget.adhiseal-position-bottom-left {
    left: 24px;
}

/* ---- Toggle Button ---- */
#adhiseal-chat-toggle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: var(--adhiseal-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.2s;
    position: relative;
    z-index: 2;
}

#adhiseal-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
}

#adhiseal-chat-toggle.open {
    transform: rotate(0deg);
}

/* Pulse ring */
#adhiseal-chat-toggle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--adhiseal-color);
    opacity: 0.4;
    animation: adhiseal-pulse 2.5s infinite;
}

@keyframes adhiseal-pulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }

    70% {
        transform: scale(1.5);
        opacity: 0;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ---- Chat Window ---- */
#adhiseal-chat-window {
    position: absolute;
    bottom: 72px;
    width: 360px;
    height: 490px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.85) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(.34, 1.56, .64, 1), opacity 0.2s ease;
    transform-origin: bottom right;
}

#adhiseal-chatbot-widget.adhiseal-position-bottom-right #adhiseal-chat-window {
    right: 0;
    transform-origin: bottom right;
}

#adhiseal-chatbot-widget.adhiseal-position-bottom-left #adhiseal-chat-window {
    left: 0;
    transform-origin: bottom left;
}

#adhiseal-chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.adhiseal-chat-header {
    background: var(--adhiseal-color);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.adhiseal-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.adhiseal-chat-header-info {
    flex: 1;
    min-width: 0;
}

.adhiseal-chat-bot-name {
    display: block;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adhiseal-chat-status {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.85);
}

.adhiseal-chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.2s;
}

.adhiseal-chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Messages area */
.adhiseal-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f8fa;
    scroll-behavior: smooth;
}

.adhiseal-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.adhiseal-chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* Bubbles */
.adhiseal-msg {
    max-width: 84%;
    animation: adhiseal-fadeup 0.25s ease;
}

@keyframes adhiseal-fadeup {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.adhiseal-msg-bot {
    align-self: flex-start;
}

.adhiseal-msg-user {
    align-self: flex-end;
}

.adhiseal-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    white-space: pre-wrap;
}

.adhiseal-msg-bot .adhiseal-bubble {
    background: #fff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.adhiseal-msg-user .adhiseal-bubble {
    background: var(--adhiseal-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.adhiseal-msg-time {
    font-size: 10.5px;
    color: #a0a0a0;
    margin-top: 3px;
    padding: 0 4px;
}

.adhiseal-msg-user .adhiseal-msg-time {
    text-align: right;
}

/* Typing indicator */
.adhiseal-typing-wrap {
    align-self: flex-start;
}

.adhiseal-typing {
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    padding: 12px 16px;
    display: flex;
    gap: 5px;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.adhiseal-typing span {
    width: 7px;
    height: 7px;
    background: #aaa;
    border-radius: 50%;
    animation: adhiseal-bounce 1.3s infinite;
}

.adhiseal-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.adhiseal-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes adhiseal-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* Input area */
.adhiseal-chat-input-wrap {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #eee;
    align-items: flex-end;
    flex-shrink: 0;
}

#adhiseal-input {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.45;
}

#adhiseal-input:focus {
    border-color: var(--adhiseal-color);
}

#adhiseal-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--adhiseal-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.1s;
}

#adhiseal-send-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

#adhiseal-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.adhiseal-chat-footer {
    text-align: center;
    font-size: 10.5px;
    color: #bbb;
    padding: 5px 0 8px;
    background: #fff;
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 420px) {
    #adhiseal-chat-window {
        width: calc(100vw - 32px);
    }

    #adhiseal-chatbot-widget.adhiseal-position-bottom-right {
        right: 16px;
    }

    #adhiseal-chatbot-widget.adhiseal-position-bottom-left {
        left: 16px;
    }
}