/* Main styles for Cosmic Inquiry */

/* Chat message styling */
.chat-message {
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    max-width: 90%;
    line-height: 1.5;
}
.user-message {
    background-color: #e5f2ff;
    margin-left: auto;
    text-align: right;
}
.ai-message {
    background-color: #f0f0f0;
    margin-right: auto;
}
.reward-badge {
    animation: pulse 1.5s infinite;
}
.follow-up-questions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ccc;
    /* Maintain original font size for questions */
    font-size: 1rem;
}
/* Removed .follow-up-question styles - using Tailwind/inline styles instead */

/* Enhanced AI message styling */
.ai-message {
    font-size: 1.05rem;
    line-height: 1.7;
}

/* AI response content specific styling - smaller font size */
.ai-response-content {
    font-size: 0.95rem;
    line-height: 1.65;
}

.ai-message strong {
    color: #1a202c;
    font-weight: 600;
}

.ai-message em {
    font-style: italic;
    color: #4a5568;
}

.ai-message mark {
    background-color: #e0f2fe;
    color: #0c4a6e;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.ai-message ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.ai-message ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.ai-message li {
    margin: 0.25rem 0;
    color: #2d3748;
}

.ai-message q {
    font-style: italic;
    color: #4a5568;
    quotes: """ """ "'" "'";
}

.ai-message q::before {
    content: open-quote;
}

.ai-message q::after {
    content: close-quote;
}

.definition-block {
    background-color: #f7fafc;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid #9f7aea;
    margin: 0.75rem 0;
    border-radius: 0.25rem;
}

/* Enhanced keyword highlights - removed !important to avoid conflicts */
.ai-message .keyword-highlight {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #fde68a;
}

.ai-message .keyword-highlight:hover {
    background-color: #fde68a;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Text enhancement classes */
.ai-message .scientific-term {
    background-color: #dbeafe;
    color: #1e3a8a;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.ai-message .important-term {
    background-color: #fef3c7;
    color: #78350f;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.ai-message .comparison-term {
    background-color: #f3e8ff;
    color: #581c87;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

.ai-message .numeric-value {
    background-color: #d1fae5;
    color: #064e3b;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.ai-message .inline-code {
    background-color: #f3f4f6;
    color: #dc2626;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.875rem;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Keyword highlight styling */
.keyword-highlight {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    font-weight: 600 !important;
    padding: 2px 4px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    border: 1px solid #bae6fd !important;
    transition: all 0.2s ease !important;
}

.keyword-highlight:hover {
    background-color: #bae6fd !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Embedded question styling for image analysis */
.embedded-question {
    position: relative;
    color: #0369a1 !important;
    border-bottom: 1px dashed #0369a1;
    cursor: pointer;
    transition: background-color 0.2s;
}

.embedded-question:hover {
    background-color: #e0f2fe !important;
    border-radius: 4px;
    padding: 2px 4px;
}

/* Image attachment styling */
.message-image-container {
    margin-top: 10px;
    max-width: 100%;
}

.message-image-attachment {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.message-image-attachment:hover {
    transform: scale(1.02);
}

/* Animation for new keywords */
@keyframes pulse-subtle {
    0% { background-color: rgba(99, 102, 241, 0.2); }
    50% { background-color: rgba(99, 102, 241, 0.4); }
    100% { background-color: rgba(99, 102, 241, 0.2); }
}

/* Animation for popup button */
@keyframes popup {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Direct ask button styling */
.direct-ask-button {
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.direct-ask-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.4);
}

/* Tippy.js tooltip styling */
.tippy-box {
    background-color: white !important;
    color: #333 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    max-width: 260px !important;
}

/* Themed borders for different highlight sections */
.tippy-box[data-theme~='keyword-green'] { 
    border: 2px solid #4ade80 !important; 
}
.tippy-box[data-theme~='keyword-yellow'] { 
    border: 2px solid #facc15 !important; 
}
.tippy-box[data-theme~='keyword-red'] { 
    border: 2px solid #f87171 !important; 
}

/* Hide unwanted tooltips */
[data-keyword-id="keyword_0"] .tippy-box {
    z-index: -1 !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Button styling within tooltip */
.tippy-box .submit-question-btn {
    background-color: #f0f0f0 !important;
    border: none !important;
    border-radius: 3px !important;
    padding: 3px 8px !important;
    color: #000 !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: background-color 0.15s ease !important;
}

.tippy-box .submit-question-btn:hover {
    background-color: #e0e0e0 !important;
}

/* Typing indicator animation */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 20px;
}
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #aaa;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
    opacity: 0.7;
}
.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes typingDot {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}