/* Zishabd AI Chatbot Premium Styling */

:root {
    --zishabd-primary: #14a89e;
    --zishabd-primary-hover: #0c827a;
    --zishabd-gradient: linear-gradient(135deg, #14a89e 0%, #0a8f85 100%);
    --zishabd-bg-glass: rgba(255, 255, 255, 0.85);
    --zishabd-border-glass: rgba(255, 255, 255, 0.4);
    --zishabd-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --zishabd-text-dark: #2d3748;
    --zishabd-text-light: #718096;
}

#zishabd-chatbot-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Floating Bubble Button */
.zishabd-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--zishabd-gradient);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(20, 168, 158, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    outline: none;
}

.zishabd-chat-bubble:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 8px 20px rgba(20, 168, 158, 0.5);
}

.zishabd-chat-bubble svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.zishabd-chat-bubble .close-icon {
    width: 24px;
    height: 24px;
}

/* Chat Badge Dot */
.chat-badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #ff3b30;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* Chat Window Container */
.zishabd-chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 370px;
    height: 550px;
    background: var(--zishabd-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--zishabd-border-glass);
    border-radius: 20px;
    box-shadow: var(--zishabd-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.zishabd-chat-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Chat Header */
.zishabd-chat-header {
    background: var(--zishabd-gradient);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.zishabd-bot-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zishabd-bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.zishabd-bot-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.zishabd-online-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.zishabd-online-status .dot {
    width: 6px;
    height: 6px;
    background-color: #4cd964;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #4cd964;
}

.zishabd-close-chat {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.zishabd-close-chat:hover {
    color: #ffffff;
}

/* Chat Messages Area */
.zishabd-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
    background: rgba(255, 255, 255, 0.3);
}

/* Scrollbar Customization */
.zishabd-chat-messages::-webkit-scrollbar {
    width: 6px;
}
.zishabd-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.zishabd-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Message Styles */
.zishabd-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.zishabd-msg.bot {
    align-self: flex-start;
    background-color: #ffffff;
    color: var(--zishabd-text-dark);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.zishabd-msg.user {
    align-self: flex-end;
    background: var(--zishabd-gradient);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* Product Card in Bot response */
.zishabd-product-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.zishabd-product-name {
    font-weight: 600;
    color: var(--zishabd-text-dark);
    font-size: 13.5px;
}

.zishabd-product-price {
    color: var(--zishabd-primary);
    font-weight: bold;
    font-size: 14px;
}

.zishabd-product-link {
    display: inline-block;
    text-align: center;
    background-color: var(--zishabd-primary);
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    margin-top: 4px;
}

.zishabd-product-link:hover {
    background-color: var(--zishabd-primary-hover);
}

/* Typing Indicator Animation */
.zishabd-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    background: #ffffff;
    border-radius: 16px;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.zishabd-typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--zishabd-text-light);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.3s infinite ease-in-out;
}

.zishabd-typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.zishabd-typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Chat Input Form */
.zishabd-chat-input-form {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    gap: 10px;
}

.zishabd-chat-input-form input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    background-color: #f7fafc;
}

.zishabd-chat-input-form input:focus {
    border-color: var(--zishabd-primary);
    background-color: #ffffff;
}

#zishabd-chat-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--zishabd-primary);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#zishabd-chat-send-btn:hover {
    background-color: var(--zishabd-primary-hover);
    transform: scale(1.05);
}

#zishabd-chat-send-btn svg {
    width: 16px;
    height: 16px;
    margin-left: 2px;
}

/* Footer branding */
.zishabd-chat-footer {
    font-size: 9px;
    color: var(--zishabd-text-light);
    text-align: center;
    padding: 4px 0 8px;
    background-color: #ffffff;
}

/* Responsive adjustment */
@media screen and (max-width: 480px) {
    #zishabd-chatbot-widget {
        bottom: 15px;
        right: 15px;
    }
    .zishabd-chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        bottom: 70px;
    }
}
