/* AI Features Comprehensive Styling */

/* Voice Search Styles */
.voice-search-button {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.voice-search-button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.voice-search-button.listening {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

.voice-listening-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: white;
}

.listening-animation {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.wave {
    width: 4px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    animation: wave 1.2s infinite ease-in-out;
}

.wave:nth-child(2) { animation-delay: -1.1s; }
.wave:nth-child(3) { animation-delay: -1.0s; }

@keyframes wave {
    0%, 40%, 100% { transform: scaleY(0.4); }
    20% { transform: scaleY(1.0); }
}

.voice-search-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 9999;
}

.voice-search-toast.show {
    transform: translateX(0);
}

.voice-search-toast.success {
    border-left: 4px solid #4caf50;
}

.voice-search-toast.error {
    border-left: 4px solid #f44336;
}

/* AI Chatbot Styles */
.chatbot-toggle {
    position: fixed;
    bottom: 220px;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.ai-chatbot {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateY(100%) scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1001;
    overflow: hidden;
}

.ai-chatbot.open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.ai-chatbot.minimized {
    height: 60px;
}

.ai-chatbot.minimized .chatbot-messages,
.ai-chatbot.minimized .chatbot-input-area {
    display: none;
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chatbot-info {
    flex: 1;
}

.chatbot-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

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

.status.online::before {
    content: '●';
    color: #4caf50;
    margin-right: 5px;
}

.chatbot-minimize,
.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.chatbot-minimize:hover,
.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.user-message {
    align-self: flex-end;
}

.bot-message {
    align-self: flex-start;
}

.message-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bot-avatar {
    width: 25px;
    height: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.message-text {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    line-height: 1.4;
    font-size: 14px;
}

.user-message .message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-time {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
    text-align: center;
}

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

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

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

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

.chatbot-input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #eee;
}

.quick-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.quick-action {
    background: #f0f2f5;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.quick-action:hover {
    background: #e4e6ea;
    transform: translateY(-1px);
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

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

#send-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#send-message:hover {
    transform: scale(1.1);
}

/* Smart Listing Styles */
.smart-suggestions {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 10px;
}

.pricing-suggestions {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.pricing-options {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.price-option {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 12px 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.price-option:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.price-option.recommended {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.3);
}

.price-option .price {
    display: block;
    font-weight: bold;
    font-size: 16px;
}

.price-option .label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-top: 4px;
}

.pricing-reasoning {
    font-size: 13px;
    opacity: 0.9;
    font-style: italic;
}

.enhance-description-btn {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.enhance-description-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 237, 234, 0.4);
}

.enhance-description-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.description-comparison-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.description-comparison-modal.show {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.comparison-content {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.description-option {
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 15px;
    transition: border-color 0.2s ease;
}

.description-option.enhanced {
    border-color: #4caf50;
    background: #f8fff8;
}

.description-option h4 {
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    background: #4caf50;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.description-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    line-height: 1.5;
    min-height: 100px;
}

.use-description {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.use-description.primary {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.use-description:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.smart-suggestion {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    border-left: 4px solid #667eea;
}

.smart-suggestion.show {
    transform: translateX(0);
}

.suggestion-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.suggestion-content i {
    color: #667eea;
    margin-top: 2px;
}

.dismiss-suggestion {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-chatbot {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 80px;
        height: 70vh;
    }
    
    .comparison-content {
        grid-template-columns: 1fr;
    }
    
    .pricing-options {
        flex-direction: column;
    }
    
    .smart-suggestion {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .voice-search-toast {
        right: 10px;
        left: 10px;
    }
}

@media (max-width: 480px) {
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 18px;
        bottom: 220px;
        right: 15px;
    }
    
    .ai-help-button {
        bottom: 150px;
        left: 15px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .voice-search-button {
        right: 45px;
        width: 30px;
        height: 30px;
    }
}

/* Scroll-to-top button positioning */
#back-to-top {
    bottom: 80px !important;
}
    
    .voice-search-button {
        width: 35px;
        height: 35px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }


/* Universal AI Features */
.ai-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.ai-powered-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.ai-help-button {
    position: fixed;
    bottom: 150px;
    left: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
    transition: all 0.3s ease;
    z-index: 998;
}

.ai-help-button:hover {
    transform: scale(1.1);
}