/* Arkase Chat Widget Styles */
#arkase-chat {
    width: 100%;
    max-width: 800px;
    height: 550px;
    margin: 0 auto 20px;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    font-family: Lato, Arial, sans-serif;
}

/* Chat header with title and restart */
.ac-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}
.ac-title {
    font-size: 14px;
    font-weight: 700;
    color: #2a2a2a;
    letter-spacing: 0.3px;
}
.ac-restart {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #bbb;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.ac-restart:hover {
    color: #e39a31;
    background: #f0f0f0;
}

/* Messages area */
.ac-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message row */
.ac-msg {
    display: flex;
    max-width: 80%;
}
.ac-user {
    align-self: flex-end;
}
.ac-bot {
    align-self: flex-start;
}

/* Bubble */
.ac-bubble {
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.ac-user .ac-bubble {
    background: #e39a31;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ac-bot .ac-bubble {
    background: #f5f5f5;
    color: #2a2a2a;
    border-bottom-left-radius: 4px;
}
.ac-bubble a {
    color: inherit;
    text-decoration: underline;
}
.ac-user .ac-bubble a {
    color: #fff;
}

/* Markdown formatting inside bot bubbles */
.ac-bot .ac-bubble ul {
    margin: 6px 0;
    padding-left: 20px;
}
.ac-bot .ac-bubble li {
    margin: 3px 0;
}
.ac-bot .ac-bubble strong {
    display: inline;
}
.ac-bot .ac-bubble br + br {
    display: none;
}

/* Typing dots */
.ac-dots span {
    animation: ac-blink 1.4s infinite;
    font-size: 24px;
    line-height: 1;
}
.ac-dots span:nth-child(2) { animation-delay: 0.2s; }
.ac-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ac-blink {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}

/* Input area */
.ac-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    gap: 8px;
    background: #fafafa;
}
.ac-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    height: 38px;
    box-sizing: border-box;
}
.ac-input:focus {
    border-color: #e39a31;
}

/* Send button */
.ac-send {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: #e39a31;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.ac-send:hover {
    background: #f0f0f0;
    color: #c8872a;
}
.ac-send:disabled {
    color: #ccc;
    cursor: not-allowed;
}
.ac-send:disabled:hover {
    background: transparent;
}

/* Scrollbar */
.ac-messages::-webkit-scrollbar {
    width: 6px;
}
.ac-messages::-webkit-scrollbar-track {
    background: transparent;
}
.ac-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    #arkase-chat {
        height: 450px;
        border-radius: 8px;
        max-width: 100%;
        margin: 0 0 15px;
    }
    .ac-msg {
        max-width: 90%;
    }
    .ac-bubble {
        font-size: 13px;
    }
    .ac-input-area {
        padding: 8px 10px;
    }
}
