/* Chat Widget Styles */
#wc-ai-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Inline Chat Styles */
.wc-ai-chat-inline-container {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.wc-chat-inline-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.wc-chat-inline-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.wc-chat-inline-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.wc-chat-inline-input-container {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.wc-chat-inline-input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.wc-chat-inline-input:focus {
    border-color: #667eea;
}

.wc-chat-inline-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    margin-left: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wc-chat-inline-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.wc-chat-inline-send:active {
    transform: translateY(0);
}

.wc-chat-inline-messages::-webkit-scrollbar {
    width: 6px;
}

.wc-chat-inline-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wc-chat-inline-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.wc-chat-inline-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Floating Chat Styles */

#wc-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#wc-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#wc-chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#wc-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#wc-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

#wc-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

#wc-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

#wc-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.wc-chat-message {
    margin-bottom: 16px;
    display: flex;
}

.wc-chat-user {
    justify-content: flex-end;
}

.wc-chat-assistant {
    justify-content: flex-start;
}

.wc-chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.wc-chat-user .wc-chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.wc-chat-assistant .wc-chat-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.wc-chat-bubble a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.2s;
}

.wc-chat-bubble a:hover {
    opacity: 0.8;
}

.wc-chat-user .wc-chat-bubble a {
    color: white;
}

.wc-chat-assistant .wc-chat-bubble a {
    color: #667eea;
}

.wc-chat-bubble strong {
    font-weight: 700;
}

.wc-chat-bubble em {
    font-style: italic;
}

.wc-chat-bubble br {
    line-height: 1.6;
}

/* Product Card Styles */
.wc-chat-bubble .product-card {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 280px;
}

.wc-chat-bubble .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.wc-chat-bubble .product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.wc-chat-bubble .product-info {
    padding: 16px;
}

.wc-chat-bubble .product-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.wc-chat-bubble .product-price {
    color: #667eea;
    font-weight: 700;
    font-size: 18px;
    margin: 8px 0;
}

.wc-chat-bubble .product-link {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wc-chat-bubble .product-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Multiple product cards in same message */
.wc-chat-bubble .product-card + .product-card {
    margin-top: 16px;
}

/* Typing indicator */
.wc-chat-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.wc-chat-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.wc-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.wc-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

#wc-chat-input-container {
    display: flex;
    padding: 16px;
    background: white;
    border-top: 1px solid #e9ecef;
}

#wc-chat-input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#wc-chat-input:focus {
    border-color: #667eea;
}

#wc-chat-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    margin-left: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#wc-chat-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#wc-chat-send:active {
    transform: translateY(0);
}

/* Scrollbar styling */
#wc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#wc-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#wc-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#wc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    #wc-chat-container {
        width: calc(100vw - 40px);
        height: 450px;
    }
}
