/* 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;
}
.follow-up-question {
    display: inline-block;
    background-color: #bfdbfe; /* Tailwind bg-blue-200 equivalent */
    border: 1px solid #93c5fd; /* Tailwind border-blue-400 equivalent */
    border-radius: 16px;
    padding: 6px 12px;
    margin: 4px 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.2s;
}
.follow-up-question:hover {
    background-color: #93c5fd; /* Tailwind bg-blue-300 equivalent */
}
@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); }
}