/* Akho AI Chatbot Styling */
#akho-chat-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

/* Floating Trigger Button */
#akho-chat-trigger {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #83b735, #5e8a20);
    border: none;
    box-shadow: 0 8px 24px rgba(131, 183, 53, 0.4);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#akho-chat-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(131, 183, 53, 0.5);
}

.akho-trigger-icon svg {
    width: 30px;
    height: 30px;
}

.akho-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #83b735;
    animation: akho-pulse 2s infinite ease-out;
}

@keyframes akho-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

.akho-trigger-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.akho-trigger-tooltip {
    position: absolute;
    bottom: 74px;
    left: 0;
    background: #1e293b;
    color: #fff;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    pointer-events: none;
    animation: akho-fade-in 0.5s ease;
}

.akho-trigger-tooltip::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 24px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #1e293b transparent;
}

/* Chat Window */
#akho-chat-window {
    position: absolute;
    bottom: 76px;
    left: 0;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 580px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.akho-chat-closed #akho-chat-window {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

/* Header */
.akho-chat-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.akho-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.akho-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #83b735;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.akho-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #1e293b;
}

.akho-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.akho-bot-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.akho-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.akho-wa-btn {
    color: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(37, 211, 102, 0.15);
    text-decoration: none;
    transition: background 0.2s;
}

.akho-wa-btn:hover {
    background: rgba(37, 211, 102, 0.25);
}

.akho-wa-btn svg {
    width: 18px;
    height: 18px;
}

#akho-chat-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

#akho-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Messages Container */
#akho-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.akho-msg {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    animation: akho-fade-in 0.25s ease;
}

@keyframes akho-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.akho-msg-bot {
    align-self: flex-start;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-top-right-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.akho-msg-user {
    align-self: flex-end;
    background: #83b735;
    color: #ffffff;
    border-top-left-radius: 4px;
}

/* Product Cards Container */
.akho-chat-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.akho-product-mini-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.akho-product-mini-card:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.akho-product-mini-card img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: #fff;
}

.akho-product-mini-info {
    flex: 1;
}

.akho-product-mini-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 2px;
}

.akho-product-mini-price {
    font-size: 12px;
    color: #83b735;
    font-weight: 700;
}

/* Typing Indicator */
.akho-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    align-self: flex-start;
    width: fit-content;
}

.akho-typing span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: akho-blink 1.4s infinite both;
}

.akho-typing span:nth-child(2) { animation-delay: 0.2s; }
.akho-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes akho-blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}

/* Suggestions Chips */
#akho-chat-suggestions {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    overflow-x: auto;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}

#akho-chat-suggestions::-webkit-scrollbar {
    display: none;
}

.akho-chip {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.akho-chip:hover {
    background: #83b735;
    color: #fff;
    border-color: #83b735;
}

/* Input Form */
#akho-chat-form {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    gap: 8px;
}

#akho-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: #f8fafc;
    transition: border 0.2s, background 0.2s;
}

#akho-chat-input:focus {
    border-color: #83b735;
    background: #fff;
}

#akho-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #83b735;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

#akho-chat-send:hover {
    transform: scale(1.05);
    background: #73a32e;
}

#akho-chat-send svg {
    width: 18px;
    height: 18px;
}

/* Footer */
.akho-chat-footer {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    padding: 6px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #akho-chat-container {
        bottom: 16px;
        left: 16px;
    }
    #akho-chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 74px;
    }
}
