/* Custom styles for AI Software Marketplace */

/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

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

.chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    max-height: 500px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
}

.chatbot-window.show {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

.chatbot-header {
    padding: 15px;
    background: var(--bs-primary);
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: between;
    align-items: center;
}

.chatbot-messages {
    flex: 1;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--bs-body-bg);
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background: var(--bs-primary);
    color: white;
    margin-left: auto;
    text-align: right;
}

.bot-message {
    background: var(--bs-light);
    color: var(--bs-body-color);
    margin-right: auto;
}

.chatbot-input {
    padding: 15px;
    border-top: 1px solid var(--bs-border-color);
    border-radius: 0 0 10px 10px;
    background: var(--bs-body-bg);
}

.chatbot-input .form-control {
    border-radius: 20px;
}

.chatbot-input .btn {
    border-radius: 20px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #0056b3 100%);
    min-height: 70vh;
    display: flex;
    align-items: center;
}

/* Product Cards */
.product-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

/* Feature Icons */
.feature-icon {
    width: 80px;
    height: 80px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chatbot-window {
        width: 90vw;
        right: 5vw;
        left: 5vw;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .hero-section {
        min-height: 60vh;
        text-align: center;
    }
    
    .hero-section .col-lg-6:last-child {
        display: none;
    }
}

/* Custom badge styles */
.badge {
    font-size: 0.75em;
}

/* Smooth transitions */
.btn, .card, .form-control, .form-select {
    transition: all 0.2s ease;
}

/* Focus states */
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Custom scrollbar for chat */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--bs-light);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* Animation for new messages */
.message-enter {
    animation: messageSlide 0.3s ease;
}

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

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 10px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background: var(--bs-secondary);
    display: inline-block;
    margin: 0 1px;
    animation: typing 1.4s infinite;
}

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

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

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