/* Enhanced Query Progress Meter Styles */

.enhanced-progress-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.progress-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.cancel-button {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.cancel-button:hover {
    background: #dc2626;
}

.progress-stages {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    position: relative;
}

.progress-stages::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.progress-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 2;
}

.stage-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.progress-stage.active .stage-indicator {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.progress-stage.completed .stage-indicator {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.stage-number {
    font-weight: 600;
    font-size: 0.875rem;
}

.stage-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.stage-checkmark {
    display: none;
    font-size: 1rem;
    font-weight: bold;
}

.progress-stage.active .stage-number {
    display: none;
}

.progress-stage.completed .stage-number {
    display: none;
}

.stage-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    max-width: 80px;
    line-height: 1.2;
}

.progress-stage.active .stage-label {
    color: #3b82f6;
    font-weight: 500;
}

.progress-stage.completed .stage-label {
    color: #10b981;
    font-weight: 500;
}

.progress-bar-container {
    margin-bottom: 16px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.current-stage-text {
    color: #1f2937;
    font-weight: 500;
}

.time-elapsed {
    color: #6b7280;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #6b7280;
}

.query-preview {
    max-width: 60%;
}

.query-text {
    font-weight: 500;
    color: #1f2937;
}

/* Results Display */
.query-results {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.results-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.results-header button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.results-header button:hover {
    color: #374151;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item label {
    font-weight: 500;
    color: #374151;
}

.result-value {
    color: #1f2937;
    font-weight: 600;
}

.follow-up-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.follow-up-section h4 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 1.125rem;
    font-weight: 600;
}

.follow-up-question {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.follow-up-question p {
    margin: 0 0 12px 0;
    color: #374151;
}

.question-actions {
    display: flex;
    gap: 8px;
}

.question-actions button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.question-actions button:hover {
    background: #2563eb;
}

.question-actions button:last-child {
    background: #6b7280;
}

.question-actions button:last-child:hover {
    background: #4b5563;
}

.results-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.results-actions button {
    flex: 1;
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.results-actions button:hover {
    background: #2563eb;
}

.results-actions button:last-child {
    background: #10b981;
}

.results-actions button:last-child:hover {
    background: #059669;
}

/* Error and Timeout States */
.error-container,
.timeout-container {
    text-align: center;
    padding: 20px;
}

.error-container h3,
.timeout-container h3 {
    color: #ef4444;
    margin-bottom: 12px;
}

.error-message {
    color: #6b7280;
    margin-bottom: 20px;
}

.error-actions,
.timeout-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.error-actions button,
.timeout-actions button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.error-actions button:hover,
.timeout-actions button:hover {
    background: #2563eb;
}

.error-actions button:last-child,
.timeout-actions button:last-child {
    background: #6b7280;
}

.error-actions button:last-child:hover,
.timeout-actions button:last-child:hover {
    background: #4b5563;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .enhanced-progress-container,
    .query-results {
        margin: 16px;
        padding: 16px;
    }
    
    .progress-stages {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .progress-stage {
        flex: 0 0 calc(50% - 8px);
    }
    
    .progress-details {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .query-preview {
        max-width: 100%;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .error-actions,
    .timeout-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-actions button,
    .timeout-actions button {
        width: 100%;
        max-width: 200px;
    }
}

