/* Enhanced dataFriend Response Styling */

.datafriend-references {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #001965;
}

.datafriend-references h3 {
    margin: 0 0 15px 0;
    color: #001965;
    font-size: 1.1em;
    font-weight: 600;
}

.datafriend-references ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.datafriend-references li {
    margin: 0 0 12px 0;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.datafriend-references li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.datafriend-references a {
    color: #001965;
    text-decoration: none;
    font-weight: 500;
}

.datafriend-references a:hover {
    color: #003885;
    text-decoration: underline;
}

.datafriend-references .relevance-score {
    color: #6c757d;
    font-size: 0.9em;
    font-weight: normal;
}

.datafriend-references em {
    color: #6c757d;
    font-size: 0.9em;
}

.datafriend-images {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.datafriend-images h3 {
    margin: 0 0 15px 0;
    color: #28a745;
    font-size: 1.1em;
    font-weight: 600;
}

.datafriend-image-container {
    margin: 15px 0;
    text-align: center;
}

.datafriend-image {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.datafriend-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.datafriend-image-caption {
    margin: 8px 0 0 0;
    color: #6c757d;
    font-size: 0.9em;
    font-style: italic;
}

.datafriend-image-source {
    display: block;
    margin: 4px 0 0 0;
    color: #999;
    font-size: 0.8em;
    font-style: normal;
}

.datafriend-attribution {
    margin: 20px 0 0 0;
    padding: 10px;
    background: #e9ecef;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
}

.datafriend-attribution em {
    color: #6c757d;
}

/* Enhanced chat response formatting */
.datafriend-response {
    line-height: 1.6;
}

.datafriend-response p {
    margin: 0 0 12px 0;
}

.datafriend-response p:last-child {
    margin-bottom: 0;
}

.datafriend-response strong {
    font-weight: 600;
    color: #001965;
}

.datafriend-response em {
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    .datafriend-references,
    .datafriend-images {
        margin: 15px 0;
        padding: 12px;
    }

    .datafriend-image {
        max-width: 100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .datafriend-references {
        background: #2d3748;
        border-left-color: #4299e1;
    }

    .datafriend-references h3 {
        color: #4299e1;
    }

    .datafriend-references li {
        border-bottom-color: #4a5568;
    }

    .datafriend-references a {
        color: #63b3ed;
    }

    .datafriend-references a:hover {
        color: #90cdf4;
    }

    .datafriend-images {
        background: #2d3748;
        border-left-color: #48bb78;
    }

    .datafriend-images h3 {
        color: #48bb78;
    }

    .datafriend-attribution {
        background: #4a5568;
    }

    .datafriend-attribution em {
        color: #a0aec0;
    }
}

/* Link styling in chat messages */
.datafriend-message-content a {
    color: #007AFF; /* Accent blue */
    text-decoration: underline;
    font-weight: 500;
}

.datafriend-message-content a:hover {
    color: #0056b3; /* Darker blue on hover */
    text-decoration: none;
}

/* Dark mode for chat links */
@media (prefers-color-scheme: dark) {
    .datafriend-message-content a {
        color: #63b3ed; /* Light blue */
    }

    .datafriend-message-content a:hover {
        color: #90cdf4; /* Lighter blue */
    }
}
