/* ===== Wrapper ===== */
#kariznet-chat-wrapper {
    width: 80%;
    max-width: 500px;
    height: 100dvh;
    margin: 0 auto;
    background: #e9edef;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 15px rgba(0,0,0,0.15);
    direction: rtl;
}

/* ===== Header (always visible) ===== */
.k-header {
    background: #008069;
    color: #fff;
    padding: 12px 16px;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;

    position: sticky;
    top: 0;
    z-index: 9999;

    flex-shrink: 0;
    height: 56px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* ===== Messages (scrollable area) ===== */
.k-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    background: #f0ebe5;
}

/* ===== User message ===== */
.k-msg-user {
    background: #dcf8c6;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 10px 0 10px 10px;
    text-align: right;
    max-width: 80%;
    margin-left: auto;
    font-size: 15px;
    line-height: 1.7;
    direction: rtl;
}

/* ===== Bot message ===== */
.k-msg-bot {
    background: #fff;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 0 10px 10px 10px;
    text-align: left;
    max-width: 80%;
    margin-right: auto;
    font-size: 15px;
    line-height: 1.7;
    direction: rtl;
}

/* ===== Input bar (fixed at bottom of wrapper) ===== */
.k-input-area {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #fff;
    border-top: 1px solid #ddd;

    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 9999;
}

.k-input-area input {
    flex: 1;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid #ccc;
    font-size: 15px;
    outline: none;
    background: #f7f7f7;
}

.k-input-area button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none; 
    background: #008069;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* ===== Typing animation ===== */
.typing-dots {
    display: inline-flex;
    margin-right: 6px;
}
.typing-dots .dot {
    font-size: 18px;
    opacity: 0.3;
    animation: blink 1.5s infinite;
}
.typing-dots .dot:nth-child(2){ animation-delay: 0.2s; }
.typing-dots .dot:nth-child(3){ animation-delay: 0.4s; }

@keyframes blink {
    0% { opacity: .3; }
    50% { opacity: 1; }
    100% { opacity: .3; }
}
