/* Floating Chat Button */
#wc-chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(#4da9ff, #0073e6);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
    z-index: 10000;
}
#wc-chatbot-toggle:hover {
    background: linear-gradient(#2f95fb, #005bb5);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* Chat Window */
#wc-chatbot-window {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 340px;
    height: 460px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.24);
    overflow: hidden;
    z-index: 9999;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
#wc-chatbot-header, .wc-chatbot-header {
    background: #0073e6;
    color: #fff;
    padding: 12px 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
}
#wc-chatbot-close {
    background: #fff;
    color: #0073e6;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    line-height: 26px;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
#wc-chatbot-close:hover {
    background: #ff4d4d;
    color: #fff;
}

/* Body */
#wc-chatbot-body, .wc-chatbot-body {
    flex: 1;
    padding: 12px;
    background: #f7f8fa;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Messages */
.wc-chatbot-message {
    padding: 10px 14px;
    border-radius: 16px;
    max-width: 80%;
    line-height: 1.45;
    font-size: 14px;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    animation: fadeIn 0.3s ease;
}
.wc-chatbot-message.bot {
    background: #ffffff;
    color: #222;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.wc-chatbot-message.user {
    background: #0073e6;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Enhanced Quick Replies */
.wc-chatbot-quick-replies {
    display: flex;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid #e6e9ef;
    background: #f8f9fa;
    flex-wrap: wrap;
    max-height: 120px;
    overflow-y: auto;
}

.wc-quick-reply {
    background: linear-gradient(145deg, #4da9ff, #0073e6);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,115,230,0.2);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wc-quick-reply:hover {
    background: linear-gradient(145deg, #3a91e0, #005bb5);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,115,230,0.3);
}

.wc-quick-reply:active {
    transform: translateY(0);
}

/* Footer */
#wc-chatbot-footer, .wc-chatbot-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-top: 1px solid #e6e9ef;
    background: #fff;
}
#wc-chatbot-input {
    flex: 1;
    border: 1px solid #d6d9e0;
    border-radius: 18px;
    padding: 8px 12px;
    outline: none;
    font-size: 14px;
    min-width: 0;
    transition: border-color .15s ease;
}
#wc-chatbot-input:focus {
    border-color: #0073e6;
    box-shadow: 0 0 0 2px rgba(0,115,230,0.1);
}
#wc-chatbot-send {
    background: #0073e6;
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s ease, transform .1s ease;
}
#wc-chatbot-send:hover {
    background: #005bb5;
    transform: scale(1.05);
}
#wc-chatbot-send:active {
    transform: scale(0.95);
}

/* Order list styles */
.wc-order-list { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-top: 6px; 
}
.wc-order-list-heading { 
    font-weight: 700; 
    margin-bottom: 6px; 
    font-size: 15px;
    color: #222;
}
.wc-order-item { 
    background: #fff; 
    border: 1px solid #e6e9ef; 
    padding: 12px; 
    border-radius: 8px; 
    font-size: 13px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.wc-order-info { 
    margin-bottom: 6px; 
    font-weight: 600; 
    color: #444;
}
.wc-order-link { 
    display: inline-block; 
    margin-top: 4px; 
    color: #0073e6; 
    text-decoration: none; 
    font-weight: 700; 
    font-size: 12px;
    padding: 4px 8px;
    background: #eef6ff;
    border-radius: 4px;
    transition: background .15s ease;
}
.wc-order-link:hover {
    background: #d6e8ff;
    text-decoration: underline;
}
.wc-order-processing-text { 
    font-size: 13px; 
    margin-bottom: 6px; 
    line-height: 1.4;
    color: #666;
}

/* Order status styles */
.wc-order-status { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-top: 6px; 
}
.wc-order-status-text { 
    font-size: 14px; 
    margin-bottom: 6px; 
    line-height: 1.5; 
    color: #444;
}

/* Action button (WhatsApp) inside messages */
.wc-chatbot-action-btn {
    background: #25D366;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    transition: background .15s ease, transform .1s ease;
}
.wc-chatbot-action-btn:hover {
    background: #128C7E;
    transform: translateY(-1px);
}
.wc-chatbot-action-btn:active {
    transform: translateY(0);
}

/* Product results styles */
.wc-product-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.wc-product-item {
    background: #fff;
    border: 1px solid #e6e9ef;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.wc-product-item a {
    color: #0073e6;
    text-decoration: none;
    font-weight: 600;
}
.wc-product-item a:hover {
    text-decoration: underline;
}

/* Loading indicator */
.wc-chatbot-typing-indicator {
    display: flex;
    padding: 10px 14px;
    gap: 4px;
}
.wc-chatbot-typing-indicator span {
    height: 8px;
    width: 8px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}
.wc-chatbot-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
.wc-chatbot-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% { 
        transform: translateY(0); 
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-5px); 
        opacity: 1;
    }
}

/* Focus states for accessibility */
#wc-chatbot-toggle:focus,
#wc-chatbot-close:focus,
.wc-quick-reply:focus,
#wc-chatbot-send:focus,
.wc-chatbot-action-btn:focus {
    outline: 2px solid #0073e6;
    outline-offset: 2px;
}

#wc-chatbot-input:focus {
    outline: none;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    #wc-chatbot-window {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 70px;
        height: 400px;
    }
    
    .wc-chatbot-message {
        max-width: 90%;
    }
    
    #wc-chatbot-toggle {
        bottom: 15px;
        right: 15px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .wc-chatbot-quick-replies {
        max-height: 100px;
        padding: 8px;
    }
    
    .wc-quick-reply {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Scrollbar styling */
#wc-chatbot-body::-webkit-scrollbar {
    width: 6px;
}
#wc-chatbot-body::-webkit-scrollbar-track {
    background: transparent;
}
#wc-chatbot-body::-webkit-scrollbar-thumb {
    background: #c1c9d2;
    border-radius: 3px;
}
#wc-chatbot-body::-webkit-scrollbar-thumb:hover {
    background: #a8b3c2;
}

.wc-chatbot-quick-replies::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.wc-chatbot-quick-replies::-webkit-scrollbar-track {
    background: transparent;
}
.wc-chatbot-quick-replies::-webkit-scrollbar-thumb {
    background: #d1d9e6;
    border-radius: 2px;
}