/* Right Panel - Query Interface Styles for Hybrid Search */

/* Header info */
.search-info {
    font-size: 12px;
    color: #667eea;
    font-weight: normal;
    margin-top: 4px;
}

/* Query Section */
.query-section {
    margin-bottom: 30px;
}

.query-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.query-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

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

.query-input::placeholder {
    color: #aaa;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Results Section */
.results-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.query-display {
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.query-display h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.query-display p {
    color: #666;
    font-style: italic;
    font-size: 14px;
}

.query-text {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.query-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.search-weights {
    font-size: 12px;
    color: #888;
    background: rgba(102, 126, 234, 0.1);
    padding: 6px 10px;
    border-radius: 4px;
    margin-top: 8px;
}

/* Results List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: white;
    transition: all 0.2s ease;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-rank {
    background: #667eea;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

/* Search metadata styling */
.search-metadata {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f0fe 100%);
    border: 1px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.metadata-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.metadata-content {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.result-path {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
}

.result-id {
    font-size: 11px;
    color: #999;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.result-content {
    color: #333;
    line-height: 1.5;
    font-size: 14px;
}

/* Query Metadata */
.query-metadata {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-left: 3px solid #667eea;
}

.metadata-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
}

.metadata-item:last-child {
    margin-bottom: 0;
}

.metadata-label {
    color: #666;
    font-weight: 500;
}

.metadata-value {
    color: #333;
    font-weight: 600;
}

.reasoning-text {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
    font-style: italic;
}

/* Answer Section Styles */
.answer-section {
    margin-top: 30px;
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.answer-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 0;
}

.answer-content {
    background: #f8f9ff;
    border: 1px solid #667eea;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    line-height: 1.6;
    font-size: 14px;
    color: #333;
    white-space: pre-wrap;
}

.answer-content h1, .answer-content h2, .answer-content h3, .answer-content h4, .answer-content h5, .answer-content h6 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
}

.answer-content p {
    margin-bottom: 12px;
}

.answer-content ul, .answer-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.answer-content li {
    margin-bottom: 5px;
}

.answer-content code {
    background: #e8f0fe;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.answer-content pre {
    background: #e8f0fe;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
}

.answer-content pre code {
    background: none;
    padding: 0;
}

.answer-metadata {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px 20px;
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.answer-metadata span {
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Answer loading state */
#answer-loading {
    margin: 20px 0;
}

#answer-loading .loading-text {
    color: #667eea;
    font-style: italic;
}

/* Answer error state */
#answer-error {
    background: #ffe6e6;
    border: 1px solid #ff9999;
    border-radius: 8px;
    padding: 15px;
    color: #cc0000;
    margin: 20px 0;
}

/* Feedback Section Styles */
.feedback-section {
    margin-top: 30px;
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.feedback-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 0;
}

.feedback-form {
    background: #f8fff8;
    border: 1px solid #28a745;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.feedback-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.feedback-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.feedback-input::placeholder {
    color: #888;
    font-style: italic;
}

.feedback-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-end;
}

.feedback-btn:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.feedback-btn:active {
    transform: translateY(0);
}

.feedback-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Feedback loading state */
#feedback-loading {
    margin: 15px 0;
}

#feedback-loading .loading-text {
    color: #28a745;
    font-style: italic;
}

/* Feedback success state */
#feedback-success {
    background: #e6ffe6;
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 12px;
    color: #155724;
    margin: 15px 0;
    font-weight: 500;
}

/* Feedback error state */
#feedback-error {
    background: #ffe6e6;
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 12px;
    color: #721c24;
    margin: 15px 0;
}