/* Llozi AI Chatbot Styles */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #333;
    --bg-color: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 15px;
}

.llozi-chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.llozi-chatbot-widget.llozi-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

.llozi-chatbot-widget.llozi-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

.llozi-chatbot-widget.llozi-chatbot-top-right {
    top: 20px;
    right: 20px;
}

.llozi-chatbot-widget.llozi-chatbot-top-left {
    top: 20px;
    left: 20px;
}

.llozi-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
}

.llozi-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.llozi-chatbot-toggle.active {
    background: #ff4757;
    transform: rotate(45deg);
}

.llozi-chatbot-container {
    display: none;
    width: 400px;
    height: 600px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid var(--border-color);
    flex-direction: column;
}

.llozi-chatbot-container.show {
    display: flex;
}

.llozi-chatbot-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.llozi-chatbot-status {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: #4CAF50;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.llozi-chatbot-header h3 {
    font-size: 1.5rem;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.llozi-chatbot-header p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

.llozi-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.llozi-chatbot-welcome {
    text-align: center;
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.llozi-chatbot-quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.llozi-chatbot-quick-action {
    padding: 8px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.3s;
    color: var(--text-color);
}

.llozi-chatbot-quick-action:hover {
    background: var(--border-color);
}

.llozi-chatbot-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-end;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.llozi-chatbot-message.user {
    justify-content: flex-end;
}

.llozi-chatbot-message.bot {
    justify-content: flex-start;
}

.llozi-chatbot-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.llozi-chatbot-message.user .llozi-chatbot-message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.llozi-chatbot-message.bot .llozi-chatbot-message-content {
    background: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 5px;
}

.llozi-chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.llozi-chatbot-message.user .llozi-chatbot-avatar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.llozi-chatbot-message.bot .llozi-chatbot-avatar {
    background: #f0f0f0;
    color: #666;
}

.llozi-chatbot-typing {
    display: none;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    margin-bottom: 15px;
    margin-left: 8px;
    max-width: 80px;
}

.llozi-chatbot-typing.show {
    display: flex;
}

.llozi-chatbot-typing-dots {
    display: flex;
    gap: 4px;
}

.llozi-chatbot-typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.llozi-chatbot-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.llozi-chatbot-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.llozi-chatbot-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.llozi-chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.llozi-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

.llozi-chatbot-input:focus {
    border-color: var(--primary-color);
}

.llozi-chatbot-send {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.llozi-chatbot-send:hover {
    transform: scale(1.05);
}

.llozi-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Shortcode styles */
.llozi-chatbot-shortcode {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
}

.llozi-chatbot-shortcode .llozi-chatbot-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 15px;
    text-align: center;
}

.llozi-chatbot-shortcode .llozi-chatbot-messages {
    flex: 1;
    padding: 15px;
    background: #f8f9fa;
    overflow-y: auto;
}

.llozi-chatbot-shortcode .llozi-chatbot-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
}

/* Responsive design */
@media (max-width: 480px) {
    .llozi-chatbot-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .llozi-chatbot-widget.llozi-chatbot-bottom-right,
    .llozi-chatbot-widget.llozi-chatbot-bottom-left {
        bottom: 0;
        right: 0;
        left: 0;
    }
    
    .llozi-chatbot-toggle {
        position: absolute;
        bottom: 20px;
        right: 20px;
        z-index: 10000;
    }
}

/* Widget styles */
.widget_llozi_chatbot_widget {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0;
    overflow: hidden;
}

.widget_llozi_chatbot_widget .llozi-chatbot-container {
    display: flex;
    position: relative;
    width: 100%;
    height: 500px;
}

/* Accessibility */
.llozi-chatbot-toggle:focus,
.llozi-chatbot-send:focus,
.llozi-chatbot-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-color: #000;
        --bg-color: #fff;
    }
}

/* Product Cards Styles */
.llozi-product-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin: 15px 0;
    padding: 0;
    max-width: 100%;
}

/* Responsive grid based on cards per row setting */
.llozi-product-cards.cards-1 {
    grid-template-columns: 1fr;
}

.llozi-product-cards.cards-2 {
    grid-template-columns: repeat(2, 1fr);
}

.llozi-product-cards.cards-3 {
    grid-template-columns: repeat(3, 1fr);
}

.llozi-product-cards.cards-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.llozi-product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.llozi-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.llozi-product-card.out-of-stock {
    opacity: 0.7;
}

.llozi-product-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f8f9fa;
}

.llozi-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.llozi-product-card:hover .llozi-product-image img {
    transform: scale(1.05);
}

.llozi-platform-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
    z-index: 2;
}

.llozi-platform-badge.amazon {
    background: #ff9900;
}

.llozi-platform-badge.ebay {
    background: #0064d2;
}

.llozi-platform-badge.site {
    background: var(--primary-color);
}

.llozi-product-info {
    padding: 15px;
}

.llozi-product-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.llozi-product-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.llozi-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.llozi-product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2ecc71;
}

.llozi-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.llozi-stars {
    display: flex;
    gap: 1px;
}

.llozi-star {
    font-size: 0.9rem;
    color: #ddd;
    transition: color 0.2s ease;
}

.llozi-star.filled {
    color: #ffc107;
}

.llozi-star.half {
    color: #ffc107;
    position: relative;
}

.llozi-star.half::after {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #ddd;
}

.llozi-rating-text {
    font-size: 0.8rem;
    color: #666;
    margin-left: 4px;
}

.llozi-stock-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 12px;
}

.llozi-stock-status.in-stock {
    background: #d4edda;
    color: #155724;
}

.llozi-stock-status.out-of-stock {
    background: #f8d7da;
    color: #721c24;
}

.llozi-product-cta {
    width: 100%;
}

.llozi-cta-button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.llozi-cta-button:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

.llozi-cta-button:active {
    transform: translateY(0);
}

.llozi-cta-button.clicked {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    transform: scale(0.95);
}

/* Platform-specific styling */
.llozi-product-card.amazon .llozi-cta-button {
    background: linear-gradient(135deg, #ff9900 0%, #ff6600 100%);
}

.llozi-product-card.amazon .llozi-cta-button:hover {
    background: linear-gradient(135deg, #ff6600 0%, #ff9900 100%);
}

.llozi-product-card.ebay .llozi-cta-button {
    background: linear-gradient(135deg, #0064d2 0%, #004499 100%);
}

.llozi-product-card.ebay .llozi-cta-button:hover {
    background: linear-gradient(135deg, #004499 0%, #0064d2 100%);
}

/* Responsive product cards */
@media (max-width: 480px) {
    .llozi-product-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 12px 0;
    }
    
    .llozi-product-card {
        margin: 0;
    }
    
    .llozi-product-image {
        height: 160px;
    }
    
    .llozi-product-info {
        padding: 12px;
    }
    
    .llozi-product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* Product cards in chatbot messages */
.llozi-chatbot-message.bot .llozi-chatbot-message-content {
    padding: 0;
    background: transparent;
    border: none;
}

.llozi-chatbot-message.bot .llozi-chatbot-message-content .llozi-product-cards {
    margin: 0;
}

.llozi-message-text {
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    margin-bottom: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.llozi-message-text:last-child {
    margin-bottom: 0;
}

.llozi-message-text strong {
    font-weight: 600;
    color: var(--text-color);
}

.llozi-message-text em {
    font-style: italic;
    color: #666;
}

.llozi-message-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.llozi-message-text a:hover {
    text-decoration: underline;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .llozi-chatbot-toggle,
    .llozi-chatbot-send,
    .llozi-chatbot-message {
        transition: none;
        animation: none;
    }
    
    .llozi-chatbot-status {
        animation: none;
    }
    
    .llozi-chatbot-typing-dots span {
        animation: none;
    }
    
    .llozi-product-card {
        transition: none;
    }
    
    .llozi-product-card:hover {
        transform: none;
    }
    
    .llozi-product-image img {
        transition: none;
    }
    
    .llozi-product-card:hover .llozi-product-image img {
        transform: none;
    }
}

