/* Vinovec Chatbot Styles */

.vinovec-chatbot {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.vinovec-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.vinovec-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

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

.vinovec-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.vinovec-chatbot-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
}

.vinovec-icon-close {
    display: none;
}

.vinovec-chatbot.vinovec-open .vinovec-icon-chat {
    display: none;
}

.vinovec-chatbot.vinovec-open .vinovec-icon-close {
    display: block;
}

.vinovec-chatbot-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    max-height: 800px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: popupOpen 0.3s ease;
    z-index: 999999;
}

@keyframes popupOpen {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Backdrop/Overlay */
.vinovec-chatbot-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999998;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.vinovec-chatbot.vinovec-open .vinovec-chatbot-backdrop {
    display: block;
}

.vinovec-chatbot.vinovec-open .vinovec-chatbot-window {
    display: flex;
}

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

.vinovec-chatbot-header-content {
    flex: 1;
}

.vinovec-chatbot-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.vinovec-chatbot-close,
.vinovec-chatbot-reset {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.vinovec-chatbot-close:hover,
.vinovec-chatbot-reset:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.vinovec-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.vinovec-chatbot-close svg {
    width: 20px;
    height: 20px;
}

.vinovec-chatbot-header h3 {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 600;
    text-align: left;
}

.vinovec-chatbot-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    text-align: left;
}

.vinovec-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.vinovec-message {
    margin-bottom: 15px;
    display: flex;
    animation: messageSlideIn 0.3s ease;
}

.vinovec-message.vinovec-no-animation {
    animation: none;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vinovec-message-bot {
    justify-content: flex-start;
}

.vinovec-message-user {
    justify-content: flex-end;
}

.vinovec-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 14px;
    white-space: pre-line; /* Preserves line breaks */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.vinovec-message-content strong {
    font-weight: 700;
    color: inherit;
}

.vinovec-message-bot .vinovec-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

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

.vinovec-message-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

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

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

.vinovec-message-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;
    }
}

.vinovec-products-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
}

.vinovec-product-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
    cursor: pointer;
}

.vinovec-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.vinovec-product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid #f0f0f0;
}

.vinovec-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vinovec-product-name {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    line-height: 1.4;
}

.vinovec-product-price {
    font-size: 16px;
    color: #667eea;
    font-weight: 700;
    margin-bottom: 4px;
}

.vinovec-product-price-info {
    font-size: 11px;
    color: #999;
    margin-bottom: 12px;
    line-height: 1.4;
}

.vinovec-product-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.vinovec-product-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.vinovec-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.vinovec-btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8e 100%);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.vinovec-btn-secondary {
    background: #667eea;
    color: #ffffff !important;
    border: 2px solid #667eea;
}

.vinovec-btn-secondary:hover {
    background: #5568d3;
    color: #ffffff !important;
    border-color: #5568d3;
    transform: translateY(-1px);
}

.vinovec-chatbot-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.vinovec-chatbot-input input {
    flex: 1;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.vinovec-chatbot-input input:focus {
    border-color: #667eea;
}

.vinovec-chatbot-input button {
    width: 40px;
    height: 40px;
    margin-left: 8px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.vinovec-chatbot-input button:hover {
    transform: scale(1.1);
}

.vinovec-chatbot-input button svg {
    width: 20px;
    height: 20px;
}

.vinovec-chatbot-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dark Theme */
.vinovec-theme-dark .vinovec-chatbot-window {
    background: #2d3748;
}

.vinovec-theme-dark .vinovec-chatbot-messages {
    background: #1a202c;
}

.vinovec-theme-dark .vinovec-message-bot .vinovec-message-content {
    background: #4a5568;
    color: #e2e8f0;
}

.vinovec-theme-dark .vinovec-chatbot-input {
    background: #2d3748;
    border-top-color: #4a5568;
}

.vinovec-theme-dark .vinovec-chatbot-input input {
    background: #1a202c;
    color: #e2e8f0;
    border-color: #4a5568;
}

.vinovec-theme-dark .vinovec-product-card {
    background: #4a5568;
}

.vinovec-theme-dark .vinovec-product-name {
    color: #e2e8f0;
}

/* Embedded Chatbot */
.vinovec-chatbot-embed {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.vinovec-embed-window {
    display: flex !important;
    box-shadow: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .vinovec-chatbot-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .vinovec-product-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .vinovec-product-image {
        width: 100%;
        max-width: 200px;
        height: auto;
        aspect-ratio: 1;
    }
    
    .vinovec-product-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .vinovec-product-link {
        width: 100%;
    }
    
    .vinovec-chatbot-header {
        padding: 20px;
    }
    
    .vinovec-chatbot-header h3 {
        font-size: 18px;
    }
}

/* Error Message */
.vinovec-error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 13px;
}

/* Scrollbar Styles */
.vinovec-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.vinovec-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.vinovec-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.vinovec-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Typing Indicator */
.vinovec-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

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

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

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

/* Language Selection */
.vinovec-language-selection {
    padding: 20px;
    margin: 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border-radius: 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

.vinovec-language-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

.vinovec-language-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.vinovec-language-btn {
    background: white;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 16px 24px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 130px;
}

.vinovec-language-btn:hover {
    background: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.vinovec-language-btn:hover .vinovec-language-label {
    color: white;
}

.vinovec-language-emoji {
    font-size: 32px;
    line-height: 1;
}

.vinovec-language-label {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    transition: color 0.3s ease;
}

