
/* Claude WooChat Frontend CSS */
/* Modern chatbot UI with enhanced visuals */

#claude-woochat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.5;
}

/* Chat button styling */
#claude-woochat-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    transform: translateY(0);
}

#claude-woochat-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Chat widget container */
#claude-woochat-widget {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 480px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    flex-direction: column;
    background-color: #fff;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(20px);
    opacity: 0;
}

#claude-woochat-widget.active {
    transform: translateY(0);
    opacity: 1;
}

/* Header styling */
#claude-woochat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    color: #fff;
    position: relative;
}

#claude-woochat-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

#claude-woochat-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

#claude-woochat-title::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

#claude-woochat-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
}

#claude-woochat-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages container */
#claude-woochat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background-color: #f8fafc;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

#claude-woochat-messages::-webkit-scrollbar {
    width: 6px;
}

#claude-woochat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#claude-woochat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

/* Message styling */
.claude-woochat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-break: break-word;
    font-size: 14px;
    position: relative;
    animation: message-fade-in 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@keyframes message-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.claude-woochat-user-message {
    align-self: flex-end;
    margin-left: auto;
    background-color: #3b82f6;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.claude-woochat-bot-message {
    align-self: flex-start;
    background-color: #fff;
    color: #334155;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Typing indicator */
#claude-woochat-typing {
    align-self: flex-start;
    padding: 12px 16px;
    margin: 5px 0;
    border-radius: 18px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.claude-woochat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #94a3b8;
    opacity: 0.7;
    animation: dot-flashing 1.4s infinite linear alternate;
}

.claude-woochat-dot:nth-child(1) {
    animation-delay: 0s;
}

.claude-woochat-dot:nth-child(2) {
    animation-delay: 0.4s;
}

.claude-woochat-dot:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes dot-flashing {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    100% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

/* Input container - fixed at bottom */
#claude-woochat-input-container {
    display: flex;
    padding: 16px;
    background-color: #fff;
    border-top: 1px solid #e2e8f0;
    position: relative;
    align-items: center;
    z-index: 5; /* Added z-index to ensure it stays on top */
}

#claude-woochat-input {
    flex: 1;
    width: 100%; /* Added width: 100% to ensure it takes full available width */
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    padding: 12px 50px 12px 16px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 54px;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    background-color: #f1f5f9;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) inset;
    box-sizing: border-box; /* Added box-sizing to prevent padding affecting width */
}

#claude-woochat-input:focus {
    border-color: #94a3b8;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) inset;
}

/* Send button with icon */
#claude-woochat-send {
    position: absolute;
    right: 44px;
    border: none;
    background: transparent;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
}

#claude-woochat-send:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

#claude-woochat-send svg {
    width: 20px;
    height: 20px;
    fill: #3b82f6;
    transition: fill 0.2s ease;
}

/* Disabled send button styles */
#claude-woochat-send.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

#claude-woochat-send.disabled svg {
    fill: #cbd5e1; /* Lighter color for disabled state */
    opacity: 0.7;
}

/* Product item styling */
.claude-woochat-product {
    display: flex;
    padding: 12px;
    border-radius: 10px;
    background-color: #fff;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.claude-woochat-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.claude-woochat-product-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    margin-right: 12px;
    object-fit: cover;
    background-color: #f1f5f9;
}

.claude-woochat-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.claude-woochat-product-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: #1e293b;
}

.claude-woochat-product-price {
    font-weight: 500;
    color: #0f172a;
    margin-bottom: 6px;
}

.claude-woochat-product-link {
    margin-top: 5px;
    display: inline-block;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
}

.claude-woochat-product-link:hover {
    text-decoration: underline;
}

/* Timestamp styling */
.claude-woochat-timestamp {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    text-align: right;
}

/* Support for markdown in messages */
.claude-woochat-bot-message a {
    color: #3b82f6;
    text-decoration: none;
}

.claude-woochat-bot-message a:hover {
    text-decoration: underline;
}

.claude-woochat-bot-message p {
    margin: 0 0 8px 0;
}

.claude-woochat-bot-message p:last-child {
    margin-bottom: 0;
}

.claude-woochat-bot-message ul, .claude-woochat-bot-message ol {
    margin: 8px 0;
    padding-left: 20px;
}

.claude-woochat-bot-message code {
    background-color: #f1f5f9;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #claude-woochat-widget {
        width: calc(100% - 40px);
        height: 70vh;
        bottom: 80px;
        right: 20px;
        left: 20px;
    }

    #claude-woochat-button {
        padding: 12px 20px;
        border-radius: 24px;
    }
    
    #claude-woochat-input-container {
        padding: 12px;
    }
    
    #claude-woochat-input {
        padding: 10px 40px 10px 14px;
    }
    
    #claude-woochat-send {
        right: 20px;
    }
}

/* Animation for widget appearance */
@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Initial welcome message animation */
@keyframes welcome-message {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.claude-woochat-welcome {
    animation: welcome-message 0.5s ease forwards;
}

/* Helper class for ripple click effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple:active:after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}
