/* RAG Chat specific styles */

/* Subtitle under header */
.header .subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: normal;
}

/* RAG controls above input */
.rag-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    margin-bottom: 8px;
}

.rag-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.rag-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.rag-toggle span {
    font-size: 14px;
    font-weight: 500;
}

.rag-status {
    font-size: 13px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

/* Sources container */
.sources-container {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #4B9CD3;
    border-radius: 4px;
}

.sources-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sources-header strong {
    color: #13294B;
    font-size: 14px;
}

.sources-toggle {
    background: #4B9CD3;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.sources-toggle:hover {
    background: #3a7ba8;
}

.sources-list {
    margin-top: 12px;
}

.source-item {
    background: white;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    transition: box-shadow 0.2s;
}

.source-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.source-item:last-child {
    margin-bottom: 0;
}

.source-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.source-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #4B9CD3;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.source-title {
    flex: 1;
    font-weight: 600;
    color: #13294B;
    font-size: 14px;
}

.source-score {
    background: #e8f4f8;
    color: #13294B;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.source-link {
    display: block;
    color: #4B9CD3;
    text-decoration: none;
    font-size: 12px;
    margin-bottom: 8px;
    word-break: break-all;
}

.source-link:hover {
    text-decoration: underline;
}

.source-excerpt {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 8px;
    font-style: italic;
}

.source-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.metadata-tag {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
}

/* Modal adjustments for RAG */
.modal .modal-content {
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #000;
}

/* Empty state warning */
.empty-state .warning {
    color: #856404;
    background: #fff3cd;
    padding: 8px 16px;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 14px;
}

/* Azure Search specific fields */
.azure-search-only {
    /* These will be shown/hidden based on provider selection */
}

/* Slider container for topK */
.slider-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.slider-container input[type="range"] {
    flex: 1;
}

.slider-container input[type="number"] {
    width: 70px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Info tooltip */
.info-tooltip {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #4B9CD3;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    cursor: help;
    margin-left: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rag-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .source-header {
        flex-wrap: wrap;
    }

    .header .header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header .header-actions button {
        font-size: 13px;
        padding: 8px 12px;
    }
}
