
/* Perplexity-Style Q&A Interface */

.chat-container {
    max-width: 900px;
    margin: 0 auto;
}

.chat-message {
    display: flex;
    margin-bottom: 24px;
    animation: slideIn 0.3s ease-out;
}

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

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

.ai-message {
    flex-direction: row;
}

.message-bubble {
    padding: 16px 20px;
    border-radius: 18px;
    max-width: 75%;
    position: relative;
}

.user-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: 12px;
}

.ai-bubble {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    margin-right: 12px;
}

.message-text {
    line-height: 1.6;
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 8px;
}

.user-avatar, .ai-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    position: relative;
}

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

.ai-avatar {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: white;
}

.model-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: bold;
    color: #4CAF50;
}

.welcome-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.welcome-message .ai-avatar {
    margin-right: 16px;
}

.welcome-message .message-content {
    flex: 1;
}

.suggested-questions {
    margin-top: 12px;
}

.typing-indicator {
    display: inline-block;
}

.typing-animation {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

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

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

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

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

.sources-section {
    border-top: 1px solid #e9ecef;
    padding-top: 12px;
}

.source-card {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s;
}

.source-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.source-number {
    width: 24px;
    height: 24px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.source-content {
    flex: 1;
}

.related-questions {
    border-top: 1px solid #e9ecef;
    padding-top: 12px;
}

.model-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s;
}

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

.model-selector-popup {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

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

.model-option {
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.model-option:hover {
    border-color: #667eea;
    background: #f8f9fa;
    transform: translateX(4px);
}

.model-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.model-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.model-option.disabled:hover {
    transform: none;
    border-color: #e9ecef;
}

/* Input styling */
#qaQuestionInput {
    border-radius: 25px !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
    border: 2px solid #e9ecef !important;
    transition: all 0.3s !important;
}

#qaQuestionInput:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .message-bubble {
        max-width: 85%;
    }
    
    .chat-container {
        padding: 12px !important;
    }
    
    .model-selector-popup {
        width: 95%;
        padding: 16px;
    }
}

/* Scrollbar styling */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}


#simpleQAModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#simpleQAModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#simpleQAInput {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px;
    font-size: 15px;
    transition: all 0.3s;
}

#simpleQAInput:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#simpleQAResponse {
    animation: fadeIn 0.3s ease-in;
}

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

#simpleQAAnswerText {
    line-height: 1.8;
    font-size: 15px;
    white-space: pre-wrap;
}


/*<!-- ADD THIS CSS TO YOUR index.php -->*/
/*<style>*/
/* Basic Q&A Styles (Orange theme) */
#basicQAModal .basic-qa-card {
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

#basicQAModal .basic-qa-card:hover {
    border-left-color: #f59e0b;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* Conversational Q&A Styles (Cyan theme) */
.chat-message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

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

.ai-message {
    flex-direction: row;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 15px;
    max-width: 75%;
}

.user-bubble {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    margin-left: 10px;
}

.ai-bubble {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    margin-right: 10px;
}

.user-avatar, .ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.user-avatar {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.ai-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.welcome-message {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    margin-bottom: 20px;
}

.typing-animation {
    display: flex;
    gap: 4px;
}

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

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

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

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

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

/* Button styling */
.btn-group .btn {
    border: none;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

/* Input styling */
#convQAInput {
    border-radius: 25px;
    border: 2px solid #e5e7eb;
    padding: 12px 20px;
    font-size: 15px;
}

#convQAInput:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

