.djai-chat-widget {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    max-width: 450px;
    margin: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    direction: rtl;
    text-align: right;
}

.djai-chat-header {
    background: #007cba;
    color: #ffffff;
    padding: 15px;
    border-bottom: 1px solid #006ba1;
}

.djai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
}

.djai-chat-messages {
    padding: 15px;
    height: 200px;
    overflow-y: auto;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.djai-chat-message {
    padding: 10px 14px;
    border-radius: 8px;
    max-width: 80%;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.djai-chat-message-bot {
    background: #edf2f7;
    color: #2d3748;
    align-self: flex-start;
    border-top-right-radius: 2px;
}

.djai-chat-message-user {
    background: #007cba;
    color: #ffffff;
    align-self: flex-end;
    border-top-left-radius: 2px;
}

.djai-chat-form {
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    gap: 8px;
    align-items: center;
}

.djai-chat-input {
    flex-grow: 1;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    border: 1px solid #cbd5e0;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 14px;
    line-height: 1.2;
    outline: none;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background: #ffffff;
}

.djai-chat-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.12);
}

.djai-chat-input::placeholder {
    color: #718096;
}

.djai-chat-submit {
    height: 38px;
    min-width: 64px;
    background: #007cba;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 0 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.djai-chat-submit:hover {
    background: #006ba1;
    transform: translateY(-1px);
}

.djai-chat-submit:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.djai-btn-buy {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #007cba;
    color: #ffffff !important;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.djai-btn-buy:hover {
    background-color: #006ba1;
    color: #ffffff !important;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Floating container */
#djai-chat-container {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
}

#djai-chat-container.djai-chat-position-right {
    right: 20px;
}

#djai-chat-container.djai-chat-position-left {
    left: 20px;
}

#djai-chat-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #007cba;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    font-size: 24px;
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#djai-chat-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

#djai-chat-window {
    position: absolute;
    bottom: 70px;
    width: 380px;
    max-width: calc(100vw - 40px);
}

#djai-chat-container.djai-chat-position-right #djai-chat-window {
    right: 0;
}

#djai-chat-container.djai-chat-position-left #djai-chat-window {
    left: 0;
}

.djai-hidden {
    display: none !important;
}

/* Typing indicator */
.djai-typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    min-height: 18px;
}

.djai-typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #718096;
    animation: djai-bounce 1.2s infinite ease-in-out;
}

.djai-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.djai-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes djai-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .djai-chat-widget {
        max-width: 100%;
        border-radius: 10px;
    }

    .djai-chat-messages {
        height: 240px;
    }

    .djai-chat-form {
        padding: 8px 10px;
    }

    .djai-chat-input {
        height: 36px;
        min-height: 36px;
        max-height: 36px;
        font-size: 13px;
        padding: 6px 12px;
    }

    .djai-chat-submit {
        height: 36px;
        min-width: 58px;
        font-size: 13px;
        padding: 0 14px;
    }

    #djai-chat-container {
        bottom: 80px;
    }

    #djai-chat-container.djai-chat-position-right {
        right: 12px;
    }

    #djai-chat-container.djai-chat-position-left {
        left: 12px;
    }

    #djai-chat-window {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
    }
}
