/* Enhanced Sheffield Africa Chat Widget Styles */

/* ENHANCEMENT: Better Product Card Styling with Promotional Focus */
.product-search-header {
    margin-bottom: 16px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #e5e7eb !important;
}

.product-search-header h4 {
    margin: 0 !important;
    color: #1f2937 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

.product-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
}

.product-card {
    display: flex !important;
    gap: 12px !important;
    padding: 12px !important;
    background: #f9fafb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

/* ENHANCEMENT: Special styling for promotional products */
.product-card.on-promotion {
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%) !important;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2) !important;
}

.product-card:hover {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}

.product-card.on-promotion:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border-color: #f59e0b !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3) !important;
}

.product-image {
    width: 80px !important;
    height: 80px !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #f3f4f6 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.product-card:hover .product-image img {
    transform: scale(1.05) !important;
}

.image-placeholder {
    color: #9ca3af !important;
    font-size: 12px !important;
    text-align: center !important;
}

.product-info {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.product-name {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    line-height: 1.3 !important;
}

.product-card.on-promotion .product-name {
    color: #92400e !important;
}

.product-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 11px !important;
    color: #6b7280 !important;
}

.product-meta span {
    background: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    border: 1px solid #e5e7eb !important;
    transition: all 0.2s ease !important;
}

.product-card.on-promotion .product-meta span {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
}

/* ENHANCEMENT: Better price styling with promotional emphasis */
.product-price {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #059669 !important;
    margin: 4px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.product-price.promotion-price {
    color: #dc2626 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

.price-badge {
    background: #dc2626 !important;
    color: white !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 9px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    animation: pulse 2s infinite !important;
}

.product-dimensions {
    font-size: 11px !important;
    color: #6b7280 !important;
    margin: 2px 0 !important;
}

.product-description {
    margin: 0 !important;
    font-size: 12px !important;
    color: #6b7280 !important;
    line-height: 1.4 !important;
}

/* ENHANCEMENT: Animated promotion badge */
.promotion-badge {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%) !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3) !important;
    z-index: 2 !important;
}

.promotion-badge.pulse {
    animation: promotionPulse 2s infinite !important;
}

@keyframes promotionPulse {
    0%, 100% { 
        transform: scale(1) !important;
        box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3) !important;
    }
    50% { 
        transform: scale(1.05) !important;
        box-shadow: 0 4px 8px rgba(220, 38, 38, 0.5) !important;
    }
}

/* ENHANCEMENT: Better "Show More" button */
.product-more {
    text-align: center !important;
    padding: 12px !important;
    margin-bottom: 12px !important;
}

.show-more-products {
    background: linear-gradient(135deg, #c02434 0%, #a01e2a 100%) !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(192, 36, 52, 0.2) !important;
}

.show-more-products:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(192, 36, 52, 0.3) !important;
    background: linear-gradient(135deg, #a01e2a 0%, #7f1d1d 100%) !important;
}

.product-footer {
    padding-top: 12px !important;
    border-top: 1px solid #e5e7eb !important;
    margin-top: 8px !important;
}

.product-footer p {
    margin: 0 !important;
    font-size: 13px !important;
    color: #4b5563 !important;
    text-align: center !important;
    line-height: 1.5 !important;
}

/* Sheffield Africa Chat Widget Styles - Enhanced */

.sheffield-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Position variants */
.sheffield-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.sheffield-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.sheffield-widget.top-right {
    top: 20px;
    right: 20px;
}

.sheffield-widget.top-left {
    top: 20px;
    left: 20px;
}

/* ENHANCEMENT: Better chat toggle with micro-animations */
.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c02434 0%, #a01e2a 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(192, 36, 52, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.chat-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-toggle:hover::before {
    opacity: 1;
}

.chat-toggle:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 30px rgba(192, 36, 52, 0.4);
}

.chat-toggle .icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.chat-toggle .close-icon {
    transform: rotate(45deg);
}

/* ENHANCEMENT: Enhanced chat window with better animations */
.chat-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 90vw;
    max-width: 800px;
    height: 85vh;
    max-height: 700px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000000;
}

.chat-window.open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Modal Backdrop */
.chat-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999999;
}

.chat-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* ENHANCEMENT: Better header with gradient and animations */
.chat-header {
    background: linear-gradient(135deg, #c02434 0%, #a01e2a 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
    position: relative;
}

.header-content .avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header-info p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}

@keyframes statusPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.minimize-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    z-index: 1;
    position: relative;
}

.minimize-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ENHANCEMENT: Better messages area */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: messageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.message.user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #c02434 0%, #a01e2a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(192, 36, 52, 0.2);
}

.message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message.user .message-content {
    align-items: flex-end;
    max-width: 80%;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    animation: bubbleAppear 0.3s ease;
}

@keyframes bubbleAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.message-bubble.bot {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    border-radius: 18px 18px 18px 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-bubble.user {
    background: linear-gradient(135deg, #c02434 0%, #a01e2a 100%);
    color: white;
    border-radius: 18px 18px 6px 18px;
    box-shadow: 0 2px 8px rgba(192, 36, 52, 0.2);
}

/* Enhanced Message Content */
.message-bubble.bot a {
    color: #c02434;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.message-bubble.bot a:hover {
    text-decoration: underline;
    color: #a01e2a;
}

.message-bubble.bot strong {
    color: #1f2937;
    font-weight: 600;
}

.message-bubble.bot h4, .message-bubble.bot h5 {
    margin: 0 0 8px 0;
    color: #1f2937;
}

.message-bubble.bot code {
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
}

.message-bubble.bot pre {
    background: #f3f4f6;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    border: 1px solid #e5e7eb;
}

.message-bubble.bot ul, .message-bubble.bot ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-bubble.bot li {
    margin: 4px 0;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-left: 12px;
    margin-right: 12px;
}

/* ENHANCEMENT: Better suggestions with hover effects */
.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.suggestion-btn {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #374151;
    font-weight: 500;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #c02434 0%, #a01e2a 100%);
    color: white;
    border-color: #c02434;
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 2px 8px rgba(192, 36, 52, 0.2);
}

/* ENHANCEMENT: Improved typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 8px;
    animation: fadeIn 0.3s ease;
}

.typing-indicator .avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #c02434 0%, #a01e2a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(192, 36, 52, 0.2);
}

.typing-dots {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px 16px 16px 4px;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ENHANCEMENT: Better input area with focus effects */
.chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #c02434;
    background: white;
    box-shadow: 0 0 0 3px rgba(192, 36, 52, 0.1);
}

#message-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    padding: 4px 8px;
    color: #374151;
    font-family: inherit;
}

#message-input::placeholder {
    color: #9ca3af;
}

.send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #e5e7eb;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn svg {
    width: 16px;
    height: 16px;
}

.send-btn:not(:disabled):hover,
.send-btn.active {
    background: linear-gradient(135deg, #c02434 0%, #a01e2a 100%);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(192, 36, 52, 0.3);
}

.send-btn:disabled {
    cursor: not-allowed;
}

/* Powered By */
.powered-by {
    padding: 8px 16px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
}

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

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

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* ENHANCEMENT: Better mobile responsiveness */
@media (max-width: 768px) {
    .chat-window {
        width: 95vw;
        height: 90vh;
        max-height: none;
        border-radius: 12px;
    }
    
    .chat-toggle {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .message.user .message-content {
        max-width: 90%;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .product-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 16px !important;
    }
    
    .product-image {
        width: 100% !important;
        height: 120px !important;
        align-self: center !important;
        margin-bottom: 8px !important;
    }
    
    .product-meta {
        justify-content: center !important;
    }

    .promotion-badge {
        top: 12px !important;
        right: 12px !important;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    
    .chat-window.open {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .chat-header {
        padding: 20px;
    }
    
    .header-info h3 {
        font-size: 18px;
    }
    
    .minimize-btn {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .product-grid {
        gap: 8px !important;
    }
    
    .product-card {
        padding: 12px !important;
    }

    .product-image {
        height: 100px !important;
    }

    .message-bubble {
        font-size: 14px !important;
        padding: 12px 16px !important;
    }

    .suggestions {
        gap: 4px;
    }

    .suggestion-btn {
        font-size: 11px !important;
        padding: 5px 10px !important;
    }
}

/* ENHANCEMENT: Dark mode support (optional) */
/* @media (prefers-color-scheme: dark) {
    .chat-messages {
        background: #1f2937 !important;
    }
    
    .product-card {
        background: #374151 !important;
        border-color: #4b5563 !important;
        color: #f9fafb !important;
    }
    
    .product-card.on-promotion {
        background: linear-gradient(135deg, #451a03 0%, #78350f 100%) !important;
        border-color: #f59e0b !important;
    }
    
    .message-bubble.bot {
        background: #374151 !important;
        border-color: #4b5563 !important;
        color: #f9fafb !important;
    }
    
    .product-meta span {
        background: #4b5563 !important;
        border-color: #6b7280 !important;
        color: #d1d5db !important;
    }
    
    .chat-input-area {
        background: #374151 !important;
        border-color: #4b5563 !important;
    }
    
    .input-wrapper {
        background: #4b5563 !important;
        border-color: #6b7280 !important;
    }
    
    #message-input {
        color: #f9fafb !important;
    }
    
    #message-input::placeholder {
        color: #9ca3af !important;
    }
} */