/* Virtual Budtender Chat Widget Styles */

:root {
    --vb-color: #4CAF50;
    --vb-color-dark: #388E3C;
    --vb-color-light: #C8E6C9;
    --vb-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --vb-radius: 12px;
}

#vb-chat-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#vb-chat-widget.vb-widget-bottom-right {
    bottom: 20px;
    right: 20px;
}

#vb-chat-widget.vb-widget-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Chat Button */
.vb-chat-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--vb-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--vb-shadow);
    transition: all 0.3s ease;
}

.vb-chat-button:hover {
    background: var(--vb-color-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.vb-chat-button svg {
    width: 24px;
    height: 24px;
}

.vb-chat-button-text {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .vb-chat-button-text {
        display: none;
    }
    
    .vb-chat-button {
        width: 60px;
        height: 60px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }
}

/* Chat Window */
.vb-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: var(--vb-radius);
    box-shadow: var(--vb-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: vb-slide-in 0.3s ease;
}

@media (max-width: 480px) {
    .vb-chat-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}

@keyframes vb-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.vb-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--vb-color);
    color: white;
}

.vb-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vb-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vb-chat-avatar svg {
    width: 24px;
    height: 24px;
}

.vb-chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.vb-chat-status {
    font-size: 12px;
    opacity: 0.9;
}

.vb-chat-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.vb-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.vb-chat-close svg {
    width: 20px;
    height: 20px;
}

/* Messages Container */
.vb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

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

.vb-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Message Bubbles */
.vb-message {
    margin-bottom: 16px;
    animation: vb-message-in 0.3s ease;
}

@keyframes vb-message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vb-message-content {
    display: inline-block;
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
}

.vb-message-bot .vb-message-content {
    background: white;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.vb-message-user {
    text-align: right;
}

.vb-message-user .vb-message-content {
    background: var(--vb-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.vb-message-content p {
    margin: 0 0 8px 0;
}

.vb-message-content p:last-child {
    margin-bottom: 0;
}

.vb-message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.vb-message-content li {
    margin-bottom: 4px;
}

/* Product Cards */
.vb-product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    display: flex;
    gap: 12px;
    transition: all 0.2s ease;
}

.vb-product-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.vb-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f0f0;
}

.vb-product-info {
    flex: 1;
}

.vb-product-name {
    font-weight: 600;
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #333;
}

.vb-product-brand {
    font-size: 12px;
    color: #666;
    margin: 0 0 4px 0;
}

.vb-product-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vb-product-price {
    color: var(--vb-color);
    font-weight: 600;
}

.vb-product-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--vb-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background 0.2s ease;
}

.vb-product-link:hover {
    background: var(--vb-color-dark);
}

/* Input Area */
.vb-chat-input-area {
    border-top: 1px solid #e0e0e0;
    background: white;
}

.vb-chat-input-container {
    display: flex;
    padding: 12px;
    gap: 8px;
}

.vb-chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
}

.vb-chat-input:focus {
    outline: none;
    border-color: var(--vb-color);
}

.vb-chat-input::-webkit-scrollbar {
    width: 4px;
}

.vb-chat-input::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.vb-chat-send {
    width: 40px;
    height: 40px;
    background: var(--vb-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.vb-chat-send:hover {
    background: var(--vb-color-dark);
}

.vb-chat-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.vb-chat-send svg {
    width: 20px;
    height: 20px;
}

.vb-chat-footer {
    padding: 8px 12px;
    text-align: center;
    font-size: 11px;
    color: #888;
}

.vb-chat-footer a {
    color: var(--vb-color);
    text-decoration: none;
}

.vb-chat-footer a:hover {
    text-decoration: underline;
}

/* Loading Indicator */
.vb-chat-loading {
    padding: 12px 20px;
}

.vb-typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

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

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

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

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

/* Utility Classes */
.vb-hidden {
    display: none !important;
}

.vb-fade-in {
    animation: vb-fade-in 0.3s ease;
}

@keyframes vb-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
